forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds .length property descriptor tests for explicit resource management
- Loading branch information
Showing
17 changed files
with
522 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack | ||
description: AsyncDisposableStack.length property descriptor | ||
info: | | ||
AsyncDisposableStack ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack, 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/adopt/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack.prototype.adopt | ||
description: AsyncDisposableStack.prototype.adopt.length property descriptor | ||
info: | | ||
AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack.prototype.adopt, 'length', { | ||
value: 2, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/defer/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack.prototype.defer | ||
description: AsyncDisposableStack.prototype.defer.length property descriptor | ||
info: | | ||
AsyncDisposableStack.prototype.defer ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack.prototype.defer, 'length', { | ||
value: 1, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/disposeAsync/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack.prototype.disposeAsync | ||
description: AsyncDisposableStack.prototype.disposeAsync.length property descriptor | ||
info: | | ||
AsyncDisposableStack.prototype.disposeAsync ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack.prototype.disposeAsync, 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
23 changes: 23 additions & 0 deletions
23
test/built-ins/AsyncDisposableStack/prototype/disposed/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-get-asyncdisposablestack.prototype.disposed | ||
description: > | ||
Map.prototype.size.length value and descriptor. | ||
info: | | ||
get Map.prototype.size | ||
17 ECMAScript Standard Built-in Objects | ||
includes: [propertyHelper.js] | ||
---*/ | ||
|
||
var descriptor = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); | ||
|
||
assert.sameValue( | ||
descriptor.get.length, 0, | ||
'The value of `Map.prototype.size.length` is `0`' | ||
); | ||
|
||
verifyNotEnumerable(descriptor.get, 'length'); | ||
verifyNotWritable(descriptor.get, 'length'); | ||
verifyConfigurable(descriptor.get, 'length'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/move/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack.prototype.move | ||
description: AsyncDisposableStack.prototype.move.length property descriptor | ||
info: | | ||
AsyncDisposableStack.prototype.move ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack.prototype.move, 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/use/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-asyncdisposablestack.prototype.use | ||
description: AsyncDisposableStack.prototype.use.length property descriptor | ||
info: | | ||
AsyncDisposableStack.prototype.use ( value ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(AsyncDisposableStack.prototype.use, 'length', { | ||
value: 1, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
30 changes: 30 additions & 0 deletions
30
test/built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-%asynciteratorprototype%-@@asyncDispose | ||
description: Length of %AsyncIteratorPrototype%[ @@asyncDispose ] | ||
info: | | ||
ES6 Section 17: | ||
Every built-in Function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this value | ||
is equal to the largest number of named arguments shown in the subclause | ||
headings for the function description, including optional parameters. | ||
[...] | ||
Unless otherwise specified, the length property of a built-in Function | ||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
features: [explicit-resource-management] | ||
includes: [propertyHelper.js] | ||
---*/ | ||
|
||
async function* generator() {} | ||
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype)) | ||
|
||
verifyProperty(AsyncIteratorPrototype[Symbol.asyncDispose], 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-disposablestack | ||
description: DisposableStack.length property descriptor | ||
info: | | ||
DisposableStack ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(DisposableStack, 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-disposablestack.prototype.adopt | ||
description: DisposableStack.prototype.adopt.length property descriptor | ||
info: | | ||
DisposableStack.prototype.adopt ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(DisposableStack.prototype.adopt, 'length', { | ||
value: 2, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-disposablestack.prototype.defer | ||
description: DisposableStack.prototype.defer.length property descriptor | ||
info: | | ||
DisposableStack.prototype.defer ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(DisposableStack.prototype.defer, 'length', { | ||
value: 1, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/dispose/length.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-disposablestack.prototype.dispose | ||
description: DisposableStack.prototype.dispose.length property descriptor | ||
info: | | ||
DisposableStack.prototype.dispose ( ) | ||
17 ECMAScript Standard Built-in Objects | ||
Every built-in function object, including constructors, has a length | ||
property whose value is an integer. Unless otherwise specified, this | ||
value is equal to the largest number of named arguments shown in the | ||
subclause headings for the function description. Optional parameters | ||
(which are indicated with brackets: [ ]) or rest parameters (which | ||
are shown using the form «...name») are not included in the default | ||
argument count. | ||
Unless otherwise specified, the length property of a built-in | ||
function object has the attributes { [[Writable]]: false, | ||
[[Enumerable]]: false, [[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [explicit-resource-management] | ||
---*/ | ||
|
||
verifyProperty(DisposableStack.prototype.dispose, 'length', { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); |
Oops, something went wrong.