You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! This is very minor and is only an issue with Show Runtime Values - Experimental checked, but I thought it would be worth reporting, mostly in case others come across it.
The conditions I've encountered may not be everything, but are fairly specific:
Show Runtime Values - Experimental is checked.
Object.defineProperty modifies a global value (e.g. Array.prototype)
defineProperty uses a getter, setter, or explicitly sets writable: false.
Any valid syntax follows the defineProperty call, even if it would throw an error.
When using defineProperty on a global like Array.prototype I encounter TypeError: Cannot redefine property: and execution stops, but only if there is code following the defineProperty call:
// Code before executes as expected and displays outputa=2;Object.defineProperty(Array.prototype,'not',{get(){returnfalse;},});// TypeError: Cannot redefine property: not// happens and execution stops if any code is after define// with valid syntax, even if it would throw an errorb;
The error does not happen with a local variable:
consta={is: true};// No error when defineProperty is on a local variableObject.defineProperty(a,'not',{get(){return!this.is;},});a.is;// truea.not;// false
And an image demonstrating the error for completeness:
I'm not sure if this is a worth further research as it works properly when you turn off Show Runtime Values.
Thank you so much for making this amazing tool. I love it and regularly recommend it to others.
The text was updated successfully, but these errors were encountered:
Hello! This is very minor and is only an issue with Show Runtime Values - Experimental checked, but I thought it would be worth reporting, mostly in case others come across it.
The conditions I've encountered may not be everything, but are fairly specific:
Object.defineProperty
modifies a global value (e.g. Array.prototype)defineProperty
uses a getter, setter, or explicitly setswritable: false
.defineProperty
call, even if it would throw an error.When using
defineProperty
on a global likeArray.prototype
I encounterTypeError: Cannot redefine property:
and execution stops, but only if there is code following the defineProperty call:The error does not happen with a local variable:
And an image demonstrating the error for completeness:
I'm not sure if this is a worth further research as it works properly when you turn off Show Runtime Values.
Thank you so much for making this amazing tool. I love it and regularly recommend it to others.
The text was updated successfully, but these errors were encountered: