• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3require('../common');
4const assert = require('assert');
5
6const vm = require('vm');
7
8const symbol = Symbol();
9
10function Document() {
11  this[symbol] = 'foo';
12}
13
14Document.prototype.getSymbolValue = function() {
15  return this[symbol];
16};
17
18const context = new Document();
19vm.createContext(context);
20
21assert.strictEqual(context.getSymbolValue(), 'foo');
22
23assert.strictEqual(vm.runInContext('this.getSymbolValue()', context), 'foo');
24