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: #12721
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
MylesBorins committed Apr 29, 2017
1 parent aae3765 commit bed6acb
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 bed6acb

Please sign in to comment.