mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
e86a638305
Add initial shadow realm support behind an off-by-default flag `--experimental-shadow-realm`. PR-URL: https://github.com/nodejs/node/pull/42869 Refs: https://github.com/nodejs/node/issues/42528 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
13 lines
402 B
JavaScript
13 lines
402 B
JavaScript
// Flags: --experimental-shadow-realm
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// Validates we can construct ShadowRealm successfully.
|
|
const shadowRealm = new ShadowRealm();
|
|
|
|
const getter = shadowRealm.evaluate('globalThis.realmValue = "inner"; () => globalThis.realmValue;');
|
|
assert.strictEqual(getter(), 'inner');
|
|
assert.strictEqual('realmValue' in globalThis, false);
|