node/test/parallel/test-vm-global-identity.js

11 lines
275 B
JavaScript

var common = require('../common');
var assert = require('assert');
var vm = require('vm');
var ctx = vm.createContext();
ctx.window = ctx;
var thisVal = vm.runInContext('this;', ctx);
var windowVal = vm.runInContext('window;', ctx);
assert.strictEqual(thisVal, windowVal);