0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/parallel/test-vm-symbols.js
Daniel Abrão 708084aea1
test: remove error msg in test-vm-symbols.js
PR-URL: https://github.com/nodejs/node/pull/15873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-19 02:47:45 -02:00

24 lines
442 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const vm = require('vm');
const symbol = Symbol();
function Document() {
this[symbol] = 'foo';
}
Document.prototype.getSymbolValue = function() {
return this[symbol];
};
const context = new Document();
vm.createContext(context);
assert.strictEqual(context.getSymbolValue(), 'foo');
assert.strictEqual(vm.runInContext('this.getSymbolValue()', context), 'foo');