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

Commit

Permalink
Merge pull request #546 from ahmadov/fix_set_property_value
Browse files Browse the repository at this point in the history
Fix reference error issue when setting a new value for property
  • Loading branch information
roblourens authored Nov 25, 2019
2 parents ab878dc + 6b4de3c commit 85f93ad
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 85f93ad

Please sign in to comment.