mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 19:56:48 +00:00

PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
16 lines
507 B
JavaScript
16 lines
507 B
JavaScript
'use strict';
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
|
|
// Testing api calls for symbol
|
|
const test_symbol = require(`./build/${common.buildType}/test_symbol`);
|
|
|
|
const fooSym = test_symbol.New('foo');
|
|
const myObj = {};
|
|
myObj.foo = 'bar';
|
|
myObj[fooSym] = 'baz';
|
|
Object.keys(myObj); // -> [ 'foo' ]
|
|
Object.getOwnPropertyNames(myObj); // -> [ 'foo' ]
|
|
Object.getOwnPropertySymbols(myObj); // -> [ Symbol(foo) ]
|
|
assert.strictEqual(Object.getOwnPropertySymbols(myObj)[0], fooSym);
|