Debian Codegraph @

js/src/tests/non262/WeakMap/getOrInsert/getOrInsert.js

raw
1 // |reftest| shell-option(--enable-upsert) skip-if(!WeakMap.prototype.getOrInsert)
2 // Copyright (C) 2015 the V8 project authors. All rights reserved.
3 // Copyright (C) 2025 Jonas Haukenes. All rights reserved.
4 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: proposal-upsert
7 description: WeakMap.prototype.getOrInsert property descriptor
8 info: |
9 WeakMap.prototype.getOrInsert ( key, value )
10
11 17 ECMAScript Standard Built-in Objects
12
13 includes: [propertyHelper.js]
14 ---*/
15
16 assertEq(
17 typeof WeakMap.prototype.getOrInsert,
18 'function',
19 'typeof WeakMap.prototype.getOrInsert is "function"'
20 );
21
22 assertDeepEq(Object.getOwnPropertyDescriptor(WeakMap.prototype, "getOrInsert"), {
23 value: WeakMap.prototype.getOrInsert,
24 writable: true,
25 enumerable: false,
26 configurable: true
27 });
28
29 reportCompare(0, 0);