• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../../common');
3const assert = require('assert');
4
5// Testing api calls for symbol
6const test_symbol = require(`./build/${common.buildType}/test_symbol`);
7
8const sym = test_symbol.New('test');
9assert.strictEqual(sym.toString(), 'Symbol(test)');
10
11const myObj = {};
12const fooSym = test_symbol.New('foo');
13const otherSym = test_symbol.New('bar');
14myObj.foo = 'bar';
15myObj[fooSym] = 'baz';
16myObj[otherSym] = 'bing';
17assert.strictEqual(myObj.foo, 'bar');
18assert.strictEqual(myObj[fooSym], 'baz');
19assert.strictEqual(myObj[otherSym], 'bing');
20