mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 17:55:31 +00:00

While it was supposed to fix most of the remaining issues, https://github.com/nodejs/node/pull/46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`. PR-URL: https://github.com/nodejs/node/pull/46615 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
27 lines
677 B
JavaScript
27 lines
677 B
JavaScript
'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.strictEqual(global[totoSymbol], 4);
|
|
assert.ok(Object.getOwnPropertySymbols(global).includes(totoSymbol));
|
|
|
|
const totoKey = 'toto';
|
|
Object.defineProperty(global, totoKey, {
|
|
enumerable: true,
|
|
writable: true,
|
|
value: 5,
|
|
configurable: true,
|
|
});
|
|
assert.strictEqual(global[totoKey], 5);
|
|
assert.ok(Object.getOwnPropertyNames(global).includes(totoKey));
|