summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-global-assignment.js
blob: 3fb3470b4c2a4301986b07875ea5a23b2bb003e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict';
// Regression test for https://github.com/nodejs/node/issues/10806

require('../common');
const assert = require('assert');
const vm = require('vm');
const ctx = vm.createContext({ open() { } });
const window = vm.runInContext('this', ctx);
const other = 123;

assert.notStrictEqual(window.open, other);
window.open = other;
assert.strictEqual(window.open, other);
window.open = other;
assert.strictEqual(window.open, other);