File: esnext.weak-map.of.js

package info (click to toggle)
node-core-js 3.33.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,828 kB
  • sloc: javascript: 87,204; makefile: 13
file content (18 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
QUnit.test('WeakMap.of', assert => {
  const { of } = WeakMap;
  assert.isFunction(of);
  assert.arity(of, 0);
  assert.name(of, 'of');
  assert.looksNative(of);
  assert.nonEnumerable(WeakMap, 'of');
  const array = [];
  assert.true(WeakMap.of() instanceof WeakMap);
  assert.same(WeakMap.of([array, 2]).get(array), 2);
  assert.throws(() => of(1));
  let arg = null;
  function F(it) {
    return arg = it;
  }
  of.call(F, 1, 2, 3);
  assert.deepEqual(arg, [1, 2, 3]);
});