Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Fix reference error issue when setting a new value for property #546

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/chrome/variablesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ export class VariablesManager {
}

public setPropertyValue(objectId: string, propName: string, value: string): Promise<string> {
const setPropertyValueFn = `function() { return this["{propName}"] = {value} }`;
const setPropertyValueFn = `function() { return this["${propName}"] = ${value}; }`;
return this.chrome.Runtime.callFunctionOn({
objectId, functionDeclaration: setPropertyValueFn,
objectId,
functionDeclaration: setPropertyValueFn,
silent: true
}).then(response => {
if (response.exceptionDetails) {
Expand Down