Skip to content

Commit

Permalink
Revert "src: fix delete operator on vm context"
Browse files Browse the repository at this point in the history
This reverts commit 587857e. It was found to have subtle
behavior changes in deleting objects.

PR-URL: nodejs/node#12721
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
  • Loading branch information
MylesBorins authored and andrew749 committed Jul 19, 2017
1 parent 1078086 commit a8107a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ const res = vm.runInContext(`
Object.getOwnPropertyDescriptor(this, 'x');
`, context);

assert.strictEqual(res, undefined);
assert.strictEqual(res.value, undefined);

0 comments on commit a8107a3

Please sign in to comment.