Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,9 @@ void ContextifyContext::PropertySetterCallback(
return;

USE(ctx->sandbox()->Set(context, property, value));
args.GetReturnValue().Set(value);
if (is_function) {
args.GetReturnValue().Set(value);
}
}

// static
Expand Down
15 changes: 15 additions & 0 deletions test/parallel/test-vm-global-symbol.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';
require('../common');
const assert = require('assert');
const vm = require('vm');

const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
enumerable: true,
writable: true,
value: 4,
configurable: true,
});
assert.ok(global[totoSymbol] === 4);
Comment thread
dubzzz marked this conversation as resolved.
Outdated
assert.ok(Object.getOwnPropertySymbols(global).includes(totoSymbol));