diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 7710c252b2..ff66ffdaaa 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -456,8 +456,12 @@ class ContextifyContext { Maybe success = ctx->sandbox()->Delete(ctx->context(), property); - if (success.IsJust()) - args.GetReturnValue().Set(success.FromJust()); + if (success.FromMaybe(false)) + return; + + // Delete failed on the sandbox, intercept and do not delete on + // the global object. + args.GetReturnValue().Set(false); } diff --git a/test/known_issues/test-vm-deleting-property.js b/test/parallel/test-vm-deleting-property.js similarity index 88% rename from test/known_issues/test-vm-deleting-property.js rename to test/parallel/test-vm-deleting-property.js index cda3371a33..994aa0aff9 100644 --- a/test/known_issues/test-vm-deleting-property.js +++ b/test/parallel/test-vm-deleting-property.js @@ -12,4 +12,4 @@ const res = vm.runInContext(` Object.getOwnPropertyDescriptor(this, 'x'); `, context); -assert.strictEqual(res.value, undefined); +assert.strictEqual(res, undefined);