xref: /third_party/node/test/js-native-api/test_symbol/test3.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/js-native-api/test_symbol/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// Testing api calls for symbol
61cb0ef41Sopenharmony_ciconst test_symbol = require(`./build/${common.buildType}/test_symbol`);
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciassert.notStrictEqual(test_symbol.New(), test_symbol.New());
91cb0ef41Sopenharmony_ciassert.notStrictEqual(test_symbol.New('foo'), test_symbol.New('foo'));
101cb0ef41Sopenharmony_ciassert.notStrictEqual(test_symbol.New('foo'), test_symbol.New('bar'));
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ciconst foo1 = test_symbol.New('foo');
131cb0ef41Sopenharmony_ciconst foo2 = test_symbol.New('foo');
141cb0ef41Sopenharmony_ciconst object = {
151cb0ef41Sopenharmony_ci  [foo1]: 1,
161cb0ef41Sopenharmony_ci  [foo2]: 2,
171cb0ef41Sopenharmony_ci};
181cb0ef41Sopenharmony_ciassert.strictEqual(object[foo1], 1);
191cb0ef41Sopenharmony_ciassert.strictEqual(object[foo2], 2);
20

Indexes created Thu Nov 07 10:32:03 CST 2024