Debian Codegraph @

js/src/tests/non262/Map/getOrInsert/getOrInsert.js

raw
1 // |reftest| shell-option(--enable-upsert) skip-if(!Map.prototype.getOrInsert)
2 // Copyright (C) 2015 the V8 project authors. All rights reserved.
3 // Copyright (C) 2024 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 Property type and descriptor.
9 info: |
10 Map.prototype.getOrInsert ( key , value )
11
12 17 ECMAScript Standard Built-in Objects
13
14 includes: [propertyHelper.js]
15 ---*/
16
17 assertEq(
18 typeof Map.prototype.getOrInsert,
19 'function',
20 '`typeof Map.prototype.getOrInsert` is `function`'
21 );
22
23
24 assertDeepEq(Object.getOwnPropertyDescriptor(Map.prototype, "getOrInsert"), {
25 value: Map.prototype.getOrInsert,
26 writable: true,
27 enumerable: false,
28 configurable: true
29 });
30
31
32 reportCompare(0, 0);