Please sign in to comment.
src: don't overwrite non-writable vm globals
Check that the property doesn't have the read-only flag set before overwriting it. This is Ben Noordhuis previous commit, but keeping is_contextual_store. is_contextual_store describes whether this.foo = 42 or foo = 42 was called. The second is contextual and will fail in strict mode if foo is used without declaration. Therefore only do an early return if it is a contextual store. In particular, don't do an early return for Object.defineProperty(this, ...). Fixes: #10223 Refs: #10227 PR-URL: #11109 Reviewed-By: Ben Noordhuis <firstname.lastname@example.org> Reviewed-By: James M Snell <email@example.com> Reviewed-By: Sakthipriyan Vairamani <firstname.lastname@example.org>
- Loading branch information...
Showing with 31 additions and 9 deletions.