Skip to content

Commit 5b75df8

Browse files
authored
Merge branch 'main' into dasaria/await-dictionary-keyed-runtime-tests
2 parents 89ed7e3 + ff0d161 commit 5b75df8

504 files changed

Lines changed: 10318 additions & 3843 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

WEB_FEATURES.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ features:
367367
- test/annexB/built-ins/String/prototype/substr
368368
- test/annexB/built-ins/String/prototype/sup
369369

370+
- name: import-text
371+
files:
372+
- test/language/expressions/dynamic-import/import-attributes/2nd-param-with-type-text.js
373+
- test/language/import/import-attributes/text-*
374+
- "!test/language/import/import-attributes/text-*_FIXTURE*"
375+
tags:
376+
- import-text
377+
370378
- name: intl-display-names
371379
files:
372380
- test/intl402/DisplayNames
@@ -518,7 +526,8 @@ features:
518526

519527
- name: json-modules
520528
files:
521-
- test/language/import/import-attributes
529+
- test/language/import/import-attributes/json-*
530+
- "!test/language/import/import-attributes/json-*_FIXTURE*"
522531
tags:
523532
- json-modules
524533

features.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ decorators
4343
# https://github.com/tc39/proposal-duplicate-named-capturing-groups
4444
regexp-duplicate-named-groups
4545

46-
# https://tc39.es/proposal-array-from-async/
47-
Array.fromAsync
48-
49-
# JSON.parse with source
50-
# https://github.com/tc39/proposal-json-parse-with-source
51-
json-parse-with-source
52-
5346
# Explicit Resource Management
5447
# https://github.com/tc39/proposal-explicit-resource-management
5548
explicit-resource-management
@@ -68,18 +61,14 @@ Atomics.pause
6861
# https://tc39.es/proposal-defer-import-eval
6962
import-defer
7063

71-
# Iterator Sequencing
72-
# https://github.com/tc39/proposal-iterator-sequencing
73-
iterator-sequencing
64+
# Import Text
65+
# https://github.com/tc39/proposal-import-text
66+
import-text
7467

7568
# Time Zone Canonicalization
7669
# https://github.com/tc39/proposal-canonical-tz
7770
canonical-tz
7871

79-
# Upsert
80-
# https://github.com/tc39/proposal-upsert
81-
upsert
82-
8372
# Immutable Array Buffer
8473
# https://github.com/tc39/proposal-immutable-arraybuffer
8574
immutable-arraybuffer
@@ -112,6 +101,7 @@ align-detached-buffer-semantics-with-web-reality # https://github.com/tc39/ecma
112101
arbitrary-module-namespace-names # https://github.com/tc39/ecma262/pull/2154
113102
ArrayBuffer
114103
array-find-from-last
104+
Array.fromAsync
115105
Array.prototype.at
116106
Array.prototype.flat
117107
Array.prototype.flatMap
@@ -169,6 +159,7 @@ hashbang
169159
import-attributes
170160
import.meta
171161
iterator-helpers
162+
iterator-sequencing
172163
Int8Array
173164
Int16Array
174165
Int32Array
@@ -188,6 +179,7 @@ Intl.NumberFormat-unified
188179
Intl.RelativeTimeFormat
189180
Intl.Segmenter
190181
json-modules
182+
json-parse-with-source
191183
json-superset
192184
let
193185
logical-assignment-operators
@@ -268,6 +260,7 @@ uint8array-base64
268260
Uint16Array
269261
Uint32Array
270262
Uint8ClampedArray
263+
upsert
271264
WeakMap
272265
WeakRef
273266
WeakSet

src/import-defer/super-property-set-exported.case

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,62 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-module-namespace-exotic-objects-set-p-v-receiver
6-
desc: _ [[Set]] exported called as super access
5+
esid: sec-module-namespace-exotic-objects-getownproperty-p
6+
desc: _ [[GetOwnProperty]] called on super access
77
info: |
8-
[[Set]] ( P, V, Receiver )
9-
1. return false.
8+
SuperProperty : super [ Expression ]
9+
1. Let _env_ be GetThisEnvironment().
10+
1. Let _actualThis_ be ? _env_.GetThisBinding().
11+
1. Let _propertyNameReference_ be ? Evaluation of |Expression|.
12+
1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_).
13+
1. Let _strict_ be IsStrict(this |SuperProperty|).
14+
1. Return MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_).
1015

11-
template: ignore
16+
MakeSuperPropertyReference ( _actualThis_, _propertyKey_, _strict_ )
17+
1. Let _env_ be GetThisEnvironment().
18+
1. Assert: _env_.HasSuperBinding() is *true*.
19+
1. Assert: _env_ is a Function Environment Record.
20+
1. Let _baseValue_ be GetSuperBase(_env_).
21+
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }.
22+
23+
PutValue ( _V_, _W_ )
24+
1. If _V_ is not a Reference Record, throw a *ReferenceError* exception.
25+
...
26+
1. If IsPropertyReference(_V_) is *true*, then
27+
1. Let _baseObj_ be ? ToObject(_V_.[[Base]]).
28+
...
29+
1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)).
30+
1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception.
31+
1. Return ~unused~.
32+
...
33+
34+
OrdinarySetWithOwnDescriptor ( _O_, _P_, _V_, _Receiver_, _ownDesc_ )
35+
1. If _ownDesc_ is *undefined*, then
36+
1. Let _parent_ be ? _O_.[[GetPrototypeOf]]().
37+
1. If _parent_ is not *null*, return ? _parent_.[[Set]](_P_, _V_, _Receiver_).
38+
1. Set _ownDesc_ to the PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }.
39+
1. If IsDataDescriptor(_ownDesc_) is *true*, then
40+
1. If _ownDesc_.[[Writable]] is *false*, return *false*.
41+
1. If _Receiver_ is not an Object, return *false*.
42+
1. Let _existingDescriptor_ be ? _Receiver_.[[GetOwnProperty]](_P_).
43+
1. If _existingDescriptor_ is *undefined*, then
44+
1. Assert: _Receiver_ does not currently have a property _P_.
45+
1. Return ? CreateDataProperty(_Receiver_, _P_, _V_).
46+
1. If IsAccessorDescriptor(_existingDescriptor_) is *true*, return *false*.
47+
1. If _existingDescriptor_.[[Writable]] is *false*, return *false*.
48+
1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _V_ }.
49+
1. Return ? _Receiver_.[[DefineOwnProperty]](_P_, _valueDesc_).
50+
...
51+
52+
template: trigger-on-possible-export
1253
---*/
1354

1455
//- body
1556
class A { constructor() { return ns; } };
1657
class B extends A {
1758
constructor() {
1859
super();
19-
super.exported = 14;
60+
super[key] = 14;
2061
}
2162
};
2263

src/import-defer/super-property-set-not-exported.case

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype-@@toStringTag
6+
description: >
7+
`Symbol.toStringTag` property descriptor
8+
info: |
9+
The initial value of the @@toStringTag property is the String value
10+
'AsyncDisposableStack'.
11+
12+
This property has the attributes { [[Writable]]: false, [[Enumerable]]:
13+
false, [[Configurable]]: true }.
14+
includes: [propertyHelper.js]
15+
features: [explicit-resource-management, Symbol, Symbol.toStringTag]
16+
---*/
17+
18+
verifyProperty(AsyncDisposableStack.prototype, Symbol.toStringTag, {
19+
value: 'AsyncDisposableStack',
20+
writable: false,
21+
enumerable: false,
22+
configurable: true
23+
});
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype.adopt
6+
description: Adds a disposable resource to the stack
7+
info: |
8+
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
9+
10+
1. Let asyncDisposableStack be the this value.
11+
2. Perform ? RequireInternalSlot(asyncDisposableStack, [[AsyncDisposableState]]).
12+
3. If asyncDisposableStack.[[AsyncDisposableState]] is disposed, throw a ReferenceError exception.
13+
4. If IsCallable(onDisposeAsync) is false, throw a TypeError exception.
14+
5. Let closure be a new Abstract Closure with no parameters that captures value and onDisposeAsync and performs the following steps when called:
15+
a. Perform ? Call(onDisposeAsync, undefined, « value »).
16+
6. Let F be CreateBuiltinFunction(closure, 0, "", « »).
17+
7. Perform ? AddDisposableResource(asyncDisposableStack.[[DisposeCapability]], undefined, async-dispose, F).
18+
...
19+
20+
AddDisposableResource ( disposeCapability, V, hint [, method ] )
21+
22+
1. If method is not present then,
23+
...
24+
2. Else,
25+
a. Assert: V is undefined.
26+
b. Let resource be ? CreateDisposableResource(undefined, hint, method).
27+
3. Append resource to disposeCapability.[[DisposableResourceStack]].
28+
4. Return unused.
29+
30+
flags: [async]
31+
includes: [asyncHelpers.js]
32+
features: [explicit-resource-management]
33+
---*/
34+
35+
asyncTest(async function () {
36+
var stack = new AsyncDisposableStack();
37+
var resource = { disposed: false };
38+
stack.adopt(resource, async r => { r.disposed = true });
39+
await stack.disposeAsync();
40+
assert.sameValue(resource.disposed, true, 'Expected resource to have been disposed');
41+
});
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype.adopt
6+
description: Allows any 'value'
7+
info: |
8+
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
9+
10+
1. Let asyncDisposableStack be the this value.
11+
2. Perform ? RequireInternalSlot(asyncDisposableStack, [[AsyncDisposableState]]).
12+
3. If asyncDisposableStack.[[AsyncDisposableState]] is disposed, throw a ReferenceError exception.
13+
4. If IsCallable(onDisposeAsync) is false, throw a TypeError exception.
14+
5. Let closure be a new Abstract Closure with no parameters that captures value and onDisposeAsync and performs the following steps when called:
15+
a. Perform ? Call(onDisposeAsync, undefined, « value »).
16+
6. Let F be CreateBuiltinFunction(closure, 0, "", « »).
17+
7. Perform ? AddDisposableResource(asyncDisposableStack.[[DisposeCapability]], undefined, async-dispose, F).
18+
...
19+
20+
features: [explicit-resource-management]
21+
---*/
22+
23+
var stack = new AsyncDisposableStack();
24+
stack.adopt(null, async _ => {});
25+
stack.adopt(undefined, async _ => {});
26+
stack.adopt({}, async _ => {});
27+
stack.adopt({ async [Symbol.asyncDispose]() {} }, async _ => {});
28+
stack.adopt(() => {}, async _ => {});
29+
stack.adopt(true, async _ => {});
30+
stack.adopt(false, async _ => {});
31+
stack.adopt(1, async _ => {});
32+
stack.adopt('object', async _ => {});
33+
stack.adopt(Symbol(), async _ => {});
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype.adopt
6+
description: Adds a disposable resource to the stack
7+
info: |
8+
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
9+
10+
1. Let asyncDisposableStack be the this value.
11+
2. Perform ? RequireInternalSlot(asyncDisposableStack, [[AsyncDisposableState]]).
12+
3. If asyncDisposableStack.[[AsyncDisposableState]] is disposed, throw a ReferenceError exception.
13+
4. If IsCallable(onDisposeAsync) is false, throw a TypeError exception.
14+
5. Let closure be a new Abstract Closure with no parameters that captures value and onDisposeAsync and performs the following steps when called:
15+
a. Perform ? Call(onDisposeAsync, undefined, « value »).
16+
6. Let F be CreateBuiltinFunction(closure, 0, "", « »).
17+
7. Perform ? AddDisposableResource(asyncDisposableStack.[[DisposeCapability]], undefined, async-dispose, F).
18+
...
19+
20+
AddDisposableResource ( disposeCapability, V, hint [, method ] )
21+
22+
1. If method is not present then,
23+
...
24+
2. Else,
25+
a. Assert: V is undefined.
26+
b. Let resource be ? CreateDisposableResource(undefined, hint, method).
27+
3. Append resource to disposeCapability.[[DisposableResourceStack]].
28+
4. Return unused.
29+
30+
flags: [async]
31+
includes: [asyncHelpers.js]
32+
features: [explicit-resource-management]
33+
---*/
34+
35+
asyncTest(async function () {
36+
var stack = new AsyncDisposableStack();
37+
var disposed = [];
38+
var resource1 = {};
39+
async function dispose1(res) { disposed.push([res, dispose1]); }
40+
var resource2 = {};
41+
function dispose2(res) { disposed.push([res, dispose2]); }
42+
stack.adopt(resource1, dispose1);
43+
stack.adopt(resource2, dispose2);
44+
await stack.disposeAsync();
45+
assert.sameValue(2, disposed.length);
46+
assert.sameValue(disposed[0][0], resource2, 'Expected resource2 to be the first disposed resource');
47+
assert.sameValue(disposed[0][1], dispose2, 'Expected dispose2 to be the first onDispose invoked');
48+
assert.sameValue(disposed[1][0], resource1, 'Expected resource1 to be the second disposed resource');
49+
assert.sameValue(disposed[1][1], dispose1, 'Expected dispose1 to be the second onDispose invoked');
50+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype.adopt
6+
description: Returns the argument provided.
7+
info: |
8+
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
9+
10+
...
11+
8. Return value.
12+
13+
features: [explicit-resource-management]
14+
---*/
15+
16+
var stack = new AsyncDisposableStack();
17+
var resource = {};
18+
assert.sameValue(stack.adopt(resource, async _ => {}), resource);
19+
assert.sameValue(stack.adopt(null, async _ => {}), null);
20+
assert.sameValue(stack.adopt(undefined, async _ => {}), undefined);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2026 Ron Buckton. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-asyncdisposablestack.prototype.adopt
6+
description: Throws a ReferenceError if this is disposed.
7+
info: |
8+
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync )
9+
10+
1. Let asyncDisposableStack be the this value.
11+
2. Perform ? RequireInternalSlot(asyncDisposableStack, [[AsyncDisposableState]]).
12+
3. If asyncDisposableStack.[[AsyncDisposableState]] is disposed, throw a ReferenceError exception.
13+
...
14+
15+
features: [explicit-resource-management]
16+
---*/
17+
18+
var stack = new AsyncDisposableStack();
19+
stack.disposeAsync();
20+
21+
assert.throws(ReferenceError, function() {
22+
stack.adopt(null, async _ => {});
23+
});

0 commit comments

Comments
 (0)