Skip to content

src: use new V8 API in vm module

This PR removes the CopyProperties() hack in the vm module, i.e., Contextify. Instead, it uses 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

Refs: https://github.com/nodejs/node/issues/6283 Refs: https://github.com/nodejs/node/pull/15114 Refs: https://github.com/nodejs/node/pull/13265

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

This PR requires a backport of 37a3a15 otherwise some tests will fail. Cherry pick PR.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

src

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

src

Merge request reports

Loading