Browse Source

Revert "src: fix delete operator on vm context"

This reverts commit 587857e301. It was found to have subtle
behavior changes in deleting objects.

PR-URL: https://github.com/nodejs/node/pull/12721
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
v6.x
Myles Borins 8 years ago
parent
commit
bed6acb1ed
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 8
      src/node_contextify.cc
  2. 2
      test/known_issues/test-vm-deleting-property.js

8
src/node_contextify.cc

@ -441,12 +441,8 @@ class ContextifyContext {
Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), property);
if (success.FromMaybe(false))
return;
// Delete failed on the sandbox, intercept and do not delete on
// the global object.
args.GetReturnValue().Set(false);
if (success.IsJust())
args.GetReturnValue().Set(success.FromJust());
}

2
test/parallel/test-vm-deleting-property.js → test/known_issues/test-vm-deleting-property.js

@ -12,4 +12,4 @@ const res = vm.runInContext(`
Object.getOwnPropertyDescriptor(this, 'x');
`, context);
assert.strictEqual(res, undefined);
assert.strictEqual(res.value, undefined);
Loading…
Cancel
Save