From bed6acb1edae5076dc9161f1de03b032a92b9f31 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Fri, 28 Apr 2017 13:03:49 +0200 Subject: [PATCH] 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 Reviewed-By: Franziska Hinkelmann --- src/node_contextify.cc | 8 ++------ .../test-vm-deleting-property.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) rename test/{parallel => known_issues}/test-vm-deleting-property.js (88%) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index b8b60e97adcd17..741f568259a1a6 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -441,12 +441,8 @@ class ContextifyContext { Maybe 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()); } diff --git a/test/parallel/test-vm-deleting-property.js b/test/known_issues/test-vm-deleting-property.js similarity index 88% rename from test/parallel/test-vm-deleting-property.js rename to test/known_issues/test-vm-deleting-property.js index 994aa0aff94f2d..cda3371a33bf16 100644 --- a/test/parallel/test-vm-deleting-property.js +++ b/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);