diff --git a/test/built-ins/AsyncDisposableStack/length.js b/test/built-ins/AsyncDisposableStack/length.js new file mode 100644 index 0000000000..f90ee3ea3d --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncDisposableStack/prototype/adopt/length.js b/test/built-ins/AsyncDisposableStack/prototype/adopt/length.js new file mode 100644 index 0000000000..34a25af15a --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/adopt/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncDisposableStack/prototype/defer/length.js b/test/built-ins/AsyncDisposableStack/prototype/defer/length.js new file mode 100644 index 0000000000..96a62e3bc8 --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/defer/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncDisposableStack/prototype/disposeAsync/length.js b/test/built-ins/AsyncDisposableStack/prototype/disposeAsync/length.js new file mode 100644 index 0000000000..2dc5102e26 --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/disposeAsync/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncDisposableStack/prototype/disposed/length.js b/test/built-ins/AsyncDisposableStack/prototype/disposed/length.js new file mode 100644 index 0000000000..3f30906c3c --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/disposed/length.js @@ -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'); diff --git a/test/built-ins/AsyncDisposableStack/prototype/move/length.js b/test/built-ins/AsyncDisposableStack/prototype/move/length.js new file mode 100644 index 0000000000..f6919ea1f3 --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/move/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncDisposableStack/prototype/use/length.js b/test/built-ins/AsyncDisposableStack/prototype/use/length.js new file mode 100644 index 0000000000..5634b9d349 --- /dev/null +++ b/test/built-ins/AsyncDisposableStack/prototype/use/length.js @@ -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 +}); diff --git a/test/built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/length.js b/test/built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/length.js new file mode 100644 index 0000000000..a9c34d30ed --- /dev/null +++ b/test/built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/length.js @@ -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, +}); diff --git a/test/built-ins/DisposableStack/length.js b/test/built-ins/DisposableStack/length.js new file mode 100644 index 0000000000..7d0def4fb1 --- /dev/null +++ b/test/built-ins/DisposableStack/length.js @@ -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 +}); diff --git a/test/built-ins/DisposableStack/prototype/adopt/length.js b/test/built-ins/DisposableStack/prototype/adopt/length.js new file mode 100644 index 0000000000..f2dd3c63ec --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/adopt/length.js @@ -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 +}); diff --git a/test/built-ins/DisposableStack/prototype/defer/length.js b/test/built-ins/DisposableStack/prototype/defer/length.js new file mode 100644 index 0000000000..6b3e90e774 --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/defer/length.js @@ -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 +}); diff --git a/test/built-ins/DisposableStack/prototype/dispose/length.js b/test/built-ins/DisposableStack/prototype/dispose/length.js new file mode 100644 index 0000000000..326223f36f --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/dispose/length.js @@ -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 +}); diff --git a/test/built-ins/DisposableStack/prototype/disposed/length.js b/test/built-ins/DisposableStack/prototype/disposed/length.js new file mode 100644 index 0000000000..3e1d77f3df --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/disposed/length.js @@ -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-disposablestack.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'); diff --git a/test/built-ins/DisposableStack/prototype/move/length.js b/test/built-ins/DisposableStack/prototype/move/length.js new file mode 100644 index 0000000000..7091a70b6e --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/move/length.js @@ -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.move +description: DisposableStack.prototype.move.length property descriptor +info: | + DisposableStack.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(DisposableStack.prototype.move, 'length', { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/built-ins/DisposableStack/prototype/use/length.js b/test/built-ins/DisposableStack/prototype/use/length.js new file mode 100644 index 0000000000..969531f743 --- /dev/null +++ b/test/built-ins/DisposableStack/prototype/use/length.js @@ -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.use +description: DisposableStack.prototype.use.length property descriptor +info: | + DisposableStack.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(DisposableStack.prototype.use, 'length', { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/built-ins/Iterator/prototype/Symbol.dispose/length.js b/test/built-ins/Iterator/prototype/Symbol.dispose/length.js new file mode 100644 index 0000000000..4a31d3b38e --- /dev/null +++ b/test/built-ins/Iterator/prototype/Symbol.dispose/length.js @@ -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-%iteratorprototype%-@@dispose +description: Length of %IteratorPrototype%[ @@dispose ] +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] +---*/ +const IteratorPrototype = Object.getPrototypeOf( + Object.getPrototypeOf([][Symbol.iterator]()) +); + +verifyProperty(IteratorPrototype[Symbol.dispose], 'length', { + value: 0, + writable: false, + enumerable: false, + configurable: true, +}); diff --git a/test/built-ins/NativeErrors/SuppressedError/length.js b/test/built-ins/NativeErrors/SuppressedError/length.js new file mode 100644 index 0000000000..6e8fc344be --- /dev/null +++ b/test/built-ins/NativeErrors/SuppressedError/length.js @@ -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-properties-of-the-suppressederror-constructors +description: SuppressedError.length property descriptor +info: | + SuppressedError ( error, suppressed, message ) + + 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(SuppressedError, 'length', { + value: 3, + writable: false, + enumerable: false, + configurable: true +});