summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-strict-mode.js
Commit message (Collapse)AuthorAgeFilesLines
* src: fix vm module for strict modeFranziska Hinkelmann2017-10-271-0/+14
| | | | | | | | | | | | | This patch fixes the problem with variables that are declared only on the sandbox but not on the global proxy. PR-URL: https://github.com/nodejs/node/pull/16487 Fixes: https://github.com/nodejs/node/issues/12300 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src: use new V8 API in vm moduleFranziska Hinkelmann2017-10-231-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the CopyProperties() hack in the vm module, i.e., Contextify. Use different V8 API methods, that allow interception of DefineProperty() and do not flatten accessor descriptors to property descriptors. Move many known issues to test cases. Factor out the last test in test-vm-context.js for https://github.com/nodejs/node/issues/10223 into its own file, test-vm-strict-assign.js. Part of this CL is taken from a stalled PR by https://github.com/AnnaMag https://github.com/nodejs/node/pull/13265 This PR requires a backport of https://chromium.googlesource.com/v8/v8/+/37a3a15c3e52e2146e45f41c427f24414e4d7f6f PR-URL: https://github.com/nodejs/node/pull/16293 Fixes: https://github.com/nodejs/node/issues/2734 Fixes: https://github.com/nodejs/node/issues/10223 Fixes: https://github.com/nodejs/node/issues/11803 Fixes: https://github.com/nodejs/node/issues/11902 Ref: https://github.com/nodejs/node/issues/6283 Ref: https://github.com/nodejs/node/pull/15114 Ref: https://github.com/nodejs/node/pull/13265 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* src: do not copy on failing setProperty()Franziska Hinkelmann2016-08-041-0/+27
In vm, the setter interceptor should not copy a value onto the sandbox, if setting it on the global object will fail. It will fail if we are in strict mode and set a value without declaring it. Fixes: https://github.com/nodejs/node/issues/5344 PR-URL: https://github.com/nodejs/node/pull/7908 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>