diff --git a/test/staging/upsert/WeakMap/getOrInsert/adds-object-element.js b/test/built-ins/WeakMap/prototype/getOrInsert/adds-object-element.js similarity index 95% rename from test/staging/upsert/WeakMap/getOrInsert/adds-object-element.js rename to test/built-ins/WeakMap/prototype/getOrInsert/adds-object-element.js index 201beb40c5..bf7b00c3bc 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/adds-object-element.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/adds-object-element.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Adds a value with an Object key if key is not already in the map. info: | @@ -13,7 +13,6 @@ info: | 6. Append p to M.[[WeakMapData]]. ... features: [WeakMap, upsert] -flags: [noStrict] ---*/ var map = new WeakMap(); var foo = {}; diff --git a/test/staging/upsert/WeakMap/getOrInsert/adds-symbol-element.js b/test/built-ins/WeakMap/prototype/getOrInsert/adds-symbol-element.js similarity index 96% rename from test/staging/upsert/WeakMap/getOrInsert/adds-symbol-element.js rename to test/built-ins/WeakMap/prototype/getOrInsert/adds-symbol-element.js index 5382ae96cf..2e22963a64 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/adds-symbol-element.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/adds-symbol-element.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Adds a value with a Symbol key if key is not already in the map. info: | @@ -13,7 +13,6 @@ info: | 6. Append p to M.[[WeakMapData]]. ... features: [Symbol, WeakMap, symbols-as-weakmap-keys, upsert] -flags: [noStrict] ---*/ var map = new WeakMap(); var foo = Symbol('a description'); diff --git a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js rename to test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js index 9c7310c276..515e2c9e47 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-array.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot. info: | @@ -13,7 +13,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]). ... features: [upsert] -flags: [noStrict] ---*/ assert.throws(TypeError, function() { WeakMap.prototype.getOrInsert.call([], {}, 1); diff --git a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js rename to test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js index 3c5abde074..8e239b6587 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-map.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot. info: | @@ -13,7 +13,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]). ... features: [Map, upsert] -flags: [noStrict] ---*/ assert.throws(TypeError, function() { WeakMap.prototype.getOrInsert.call(new Map(), {}, 1); diff --git a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js rename to test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js index 1afd5a4717..b32829740b 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-object.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot. info: | @@ -13,7 +13,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]). ... features: [upsert] -flags: [noStrict] ---*/ assert.throws(TypeError, function() { WeakMap.prototype.getOrInsert.call({}, {}, 1); diff --git a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js rename to test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js index 4c38e12251..07877fed82 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-set.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot. info: | @@ -13,7 +13,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]). ... features: [Set, upsert] -flags: [noStrict] ---*/ assert.throws(TypeError, function() { WeakMap.prototype.getOrInsert.call(new Set(), {}, 1); diff --git a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js rename to test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js index 9d20de72db..fe9a56375e 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/does-not-have-weakmapdata-internal-slot-weakmap-prototype.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if `this` doesn't have a [[WeakMapData]] internal slot. info: | @@ -13,7 +13,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]). ... features: [upsert] -flags: [noStrict] ---*/ assert.throws(TypeError, function() { WeakMap.prototype.getOrInsert.call(WeakMap.prototype, {}, 1); diff --git a/test/staging/upsert/WeakMap/getOrInsert/getOrInsert.js b/test/built-ins/WeakMap/prototype/getOrInsert/getOrInsert.js similarity index 94% rename from test/staging/upsert/WeakMap/getOrInsert/getOrInsert.js rename to test/built-ins/WeakMap/prototype/getOrInsert/getOrInsert.js index 1f98c6675a..6644590844 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/getOrInsert.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/getOrInsert.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | WeakMap.prototype.getOrInsert property descriptor info: | @@ -11,7 +11,6 @@ info: | 17 ECMAScript Standard Built-in Objects includes: [propertyHelper.js] features: [upsert] -flags: [noStrict] ---*/ assert.sameValue( typeof WeakMap.prototype.getOrInsert, diff --git a/test/staging/upsert/WeakMap/getOrInsert/length.js b/test/built-ins/WeakMap/prototype/getOrInsert/length.js similarity index 93% rename from test/staging/upsert/WeakMap/getOrInsert/length.js rename to test/built-ins/WeakMap/prototype/getOrInsert/length.js index 400f78477d..9bde3e82ac 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/length.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/length.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | WeakMap.prototype.getOrInsert.length descriptor info: | @@ -11,7 +11,6 @@ info: | 17 ECMAScript Standard Built-in Objects includes: [propertyHelper.js] features: [upsert] -flags: [noStrict] ---*/ verifyProperty(WeakMap.prototype.getOrInsert, "length", { value: 2, diff --git a/test/staging/upsert/WeakMap/getOrInsert/name.js b/test/built-ins/WeakMap/prototype/getOrInsert/name.js similarity index 93% rename from test/staging/upsert/WeakMap/getOrInsert/name.js rename to test/built-ins/WeakMap/prototype/getOrInsert/name.js index ea2f71885a..511c3715ca 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/name.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/name.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | WeakMap.prototype.getOrInsert.name descriptor info: | @@ -11,7 +11,6 @@ info: | 17 ECMAScript Standard Built-in Objects includes: [propertyHelper.js] features: [upsert] -flags: [noStrict] ---*/ verifyProperty(Map.prototype.getOrInsert, "name", { value: "getOrInsert", diff --git a/test/staging/upsert/WeakMap/getOrInsert/not-a-constructor.js b/test/built-ins/WeakMap/prototype/getOrInsert/not-a-constructor.js similarity index 96% rename from test/staging/upsert/WeakMap/getOrInsert/not-a-constructor.js rename to test/built-ins/WeakMap/prototype/getOrInsert/not-a-constructor.js index 5cf7f1b715..e8396ba629 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/not-a-constructor.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/not-a-constructor.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | WeakMap.prototype.getOrInsert does not implement [[Construct]], is not new-able info: | @@ -19,7 +19,6 @@ info: | ... includes: [isConstructor.js] features: [Reflect.construct, WeakMap, arrow-function, upsert] -flags: [noStrict] ---*/ assert.sameValue( isConstructor(WeakMap.prototype.getOrInsert), diff --git a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-object-key.js b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-object-key.js similarity index 95% rename from test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-object-key.js rename to test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-object-key.js index 3579702a41..379770afc6 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-object-key.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-object-key.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Returns the value given as parameter when key is not present. info: | @@ -15,7 +15,6 @@ info: | 6. Append p to M.[[WeakMapData]]. 7. Return value. features: [WeakMap, upsert] -flags: [noStrict] ---*/ var foo = {}; var bar = {}; diff --git a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js similarity index 66% rename from test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js rename to test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js index 38e46b171d..ffc3c43853 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-not-present-symbol-key.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Returns the value given as parameter when key is not present. info: | @@ -15,17 +15,16 @@ info: | 6. Append p to M.[[WeakMapData]]. 7. Return value. features: [Symbol, WeakMap, symbols-as-weakmap-keys, upsert] -flags: [noStrict] ---*/ var foo = Symbol('a description'); var bar = Symbol('a description'); var baz = Symbol('different description'); var map = new WeakMap(); -assert.sameValue(map.getOrInsert(foo, 0), 0, 'Regular symbol as key, added in constructor'); +assert.sameValue(map.getOrInsert(foo, 0), 0); -assert.sameValue(map.getOrInsert(baz, 2), 2, 'Regular symbol as key, added with set()'); -assert.sameValue(map.getOrInsert(bar, 1), 1, "Symbols with the same description don't overwrite each other"); +assert.sameValue(map.getOrInsert(baz, 2), 2); +assert.sameValue(map.getOrInsert(bar, 1), 1); -assert.sameValue(map.getOrInsert(Symbol.hasInstance, 3), 3, 'Well-known symbol as key'); +assert.sameValue(map.getOrInsert(Symbol.hasInstance, 3), 3); diff --git a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-object-key.js b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-object-key.js similarity index 95% rename from test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-object-key.js rename to test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-object-key.js index dd70592b10..715ec16f1c 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-object-key.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-object-key.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Returns the value from the specified Object key info: | @@ -13,7 +13,6 @@ info: | a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]]. ... features: [WeakMap, upsert] -flags: [noStrict] ---*/ var foo = {}; var bar = {}; diff --git a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-symbol-key.js b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-symbol-key.js similarity index 96% rename from test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-symbol-key.js rename to test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-symbol-key.js index f0e8f5ea7e..7ca4fec714 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/returns-value-if-key-is-present-symbol-key.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/returns-value-if-key-is-present-symbol-key.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Returns the value from the specified Symbol key info: | @@ -13,7 +13,6 @@ info: | a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]]. ... features: [Symbol, WeakMap, symbols-as-weakmap-keys, upsert] -flags: [noStrict] ---*/ var foo = Symbol('a description'); var bar = Symbol('a description'); diff --git a/test/staging/upsert/WeakMap/getOrInsert/this-not-object-throw.js b/test/built-ins/WeakMap/prototype/getOrInsert/this-not-object-throw.js similarity index 96% rename from test/staging/upsert/WeakMap/getOrInsert/this-not-object-throw.js rename to test/built-ins/WeakMap/prototype/getOrInsert/this-not-object-throw.js index c598431880..a719d9e6a8 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/this-not-object-throw.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/this-not-object-throw.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes, Sune Eriksson Lianes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws a TypeError if `this` is not an Object. info: | @@ -12,7 +12,6 @@ info: | 2. Perform ? RequireInternalSlot(M, [[WeakMapData]]) ... features: [Symbol, upsert] -flags: [noStrict] ---*/ var m = new WeakMap(); diff --git a/test/staging/upsert/WeakMap/getOrInsert/throw-if-key-cannot-be-held-weakly.js b/test/built-ins/WeakMap/prototype/getOrInsert/throw-if-key-cannot-be-held-weakly.js similarity index 96% rename from test/staging/upsert/WeakMap/getOrInsert/throw-if-key-cannot-be-held-weakly.js rename to test/built-ins/WeakMap/prototype/getOrInsert/throw-if-key-cannot-be-held-weakly.js index 0fabbc8659..4aad4ba06b 100644 --- a/test/staging/upsert/WeakMap/getOrInsert/throw-if-key-cannot-be-held-weakly.js +++ b/test/built-ins/WeakMap/prototype/getOrInsert/throw-if-key-cannot-be-held-weakly.js @@ -2,7 +2,7 @@ // Copyright (C) 2025 Jonas Haukenes. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: proposal-upsert +esid: sec-weakmap.prototype.getOrInsert description: | Throws TypeError if key cannot be held weakly. info: | @@ -12,7 +12,6 @@ info: | 3. If CanBeHeldWeakly(key) is false, throw a TypeError exception. ... features: [Symbol, WeakMap, upsert] -flags: [noStrict] ---*/ var s = new WeakMap();