Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: fix delete operator on vm context #11266

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/node_contextify.cc
Expand Up @@ -456,8 +456,12 @@ class ContextifyContext {

Maybe<bool> 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);
}


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

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