Skip to content

Commit a8107a3

Browse files
MylesBorinsandrew749
authored andcommitted
Revert "src: fix delete operator on vm context"
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]>
1 parent 1078086 commit a8107a3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/node_contextify.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,8 @@ class ContextifyContext {
441441

442442
Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), property);
443443

444-
if (success.FromMaybe(false))
445-
return;
446-
447-
// Delete failed on the sandbox, intercept and do not delete on
448-
// the global object.
449-
args.GetReturnValue().Set(false);
444+
if (success.IsJust())
445+
args.GetReturnValue().Set(success.FromJust());
450446
}
451447

452448

test/parallel/test-vm-deleting-property.js renamed to test/known_issues/test-vm-deleting-property.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ const res = vm.runInContext(`
1212
Object.getOwnPropertyDescriptor(this, 'x');
1313
`, context);
1414

15-
assert.strictEqual(res, undefined);
15+
assert.strictEqual(res.value, undefined);

0 commit comments

Comments
 (0)