mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
5f44475b5a
PR-URL: https://github.com/nodejs/node/pull/4997 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
17 lines
529 B
JavaScript
17 lines
529 B
JavaScript
'use strict';
|
|
require('../common');
|
|
var assert = require('assert');
|
|
var vm = require('vm');
|
|
|
|
// The sandbox should have its own Symbol constructor.
|
|
var sandbox = {};
|
|
vm.runInNewContext('this.Symbol = Symbol', sandbox);
|
|
assert(typeof sandbox.Symbol === 'function');
|
|
assert(sandbox.Symbol !== Symbol);
|
|
|
|
// Unless we copy the Symbol constructor explicitly, of course.
|
|
sandbox = { Symbol: Symbol };
|
|
vm.runInNewContext('this.Symbol = Symbol', sandbox);
|
|
assert(typeof sandbox.Symbol === 'function');
|
|
assert(sandbox.Symbol === Symbol);
|