Debian Codegraph @

js/src/tests/non262/WeakMap/getOrInsertComputed/getOrInsertComputed.js

raw
1 // |reftest| shell-option(--enable-upsert) skip-if(!WeakMap.prototype.getOrInsertComputed)
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: >
8 WeakMap.prototype.getOrInsertComputed property descriptor
9 info: |
10 WeakMap.prototype.getOrInsertComputed ( key, callbackfn )
11
12 17 ECMAScript Standard Built-in Objects
13
14 includes: [propertyHelper.js]
15 ---*/
16
17 assertEq(
18 typeof WeakMap.prototype.getOrInsertComputed,
19 'function',
20 'typeof WeakMap.prototype.getOrInsertComputed is "function"'
21 );
22
23 assertDeepEq(Object.getOwnPropertyDescriptor(WeakMap.prototype, "getOrInsertComputed"), {
24 value: WeakMap.prototype.getOrInsertComputed,
25 writable: true,
26 enumerable: false,
27 configurable: true
28 });
29
30 reportCompare(0, 0);