Sha256: be8f80331f5bf376b625b5f53218e0517672859a425b09b74344a58e7e0c4073

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

'use strict';

require('../common');
var assert = require('assert');

var vm = require('vm');

var symbol = Symbol();

function Document() {
  this[symbol] = 'foo';
}

Document.prototype.getSymbolValue = function() {
  return this[symbol];
};

var context = new Document();
vm.createContext(context);

assert.equal(context.getSymbolValue(), 'foo',
             'should return symbol-keyed value from the outside');

assert.equal(vm.runInContext('this.getSymbolValue()', context), 'foo',
             'should return symbol-keyed value from the inside');

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/test/parallel/test-vm-symbols.js
node-compiler-0.9.0 vendor/node-v7.2.1/test/parallel/test-vm-symbols.js
node-compiler-0.8.0 vendor/node-v7.2.0/test/parallel/test-vm-symbols.js
node-compiler-0.7.0 vendor/node-v6.9.1/test/parallel/test-vm-symbols.js
node-compiler-0.7.0 vendor/node-v7.1.0/test/parallel/test-vm-symbols.js