mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Adds property descriptor tests for explicit resource management objects
These are all the prop-desc.js tests from @rbuckton's PR #3866 to make reviewing easier.
This commit is contained in:
parent
3b89be9c5d
commit
3a615a0c0e
22
test/built-ins/AsyncDisposableStack/prop-desc.js
Normal file
22
test/built-ins/AsyncDisposableStack/prop-desc.js
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-asyncdisposablestack-constructor
|
||||
description: >
|
||||
Property descriptor of AsyncDisposableStack
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
verifyProperty(this, 'AsyncDisposableStack', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/AsyncDisposableStack/prototype/adopt/prop-desc.js
vendored
Normal file
24
test/built-ins/AsyncDisposableStack/prototype/adopt/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of AsyncDisposableStack.prototype.adopt
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof AsyncDisposableStack.prototype.adopt, 'function');
|
||||
|
||||
verifyProperty(AsyncDisposableStack.prototype, 'adopt', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/AsyncDisposableStack/prototype/defer/prop-desc.js
vendored
Normal file
24
test/built-ins/AsyncDisposableStack/prototype/defer/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of AsyncDisposableStack.prototype.defer
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof AsyncDisposableStack.prototype.defer, 'function');
|
||||
|
||||
verifyProperty(AsyncDisposableStack.prototype, 'defer', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/AsyncDisposableStack/prototype/disposeAsync/prop-desc.js
vendored
Normal file
24
test/built-ins/AsyncDisposableStack/prototype/disposeAsync/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of AsyncDisposableStack.prototype.disposeAsync
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof AsyncDisposableStack.prototype.disposeAsync, 'function');
|
||||
|
||||
verifyProperty(AsyncDisposableStack.prototype, 'disposeAsync', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/AsyncDisposableStack/prototype/move/prop-desc.js
vendored
Normal file
24
test/built-ins/AsyncDisposableStack/prototype/move/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of AsyncDisposableStack.prototype.move
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof AsyncDisposableStack.prototype.move, 'function');
|
||||
|
||||
verifyProperty(AsyncDisposableStack.prototype, 'move', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
18
test/built-ins/AsyncDisposableStack/prototype/prop-desc.js
vendored
Normal file
18
test/built-ins/AsyncDisposableStack/prototype/prop-desc.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: The property descriptor AsyncDisposableStack.prototype
|
||||
esid: sec-properties-of-the-asyncdisposablestack-constructor
|
||||
info: |
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: false }.
|
||||
features: [explicit-resource-management]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(AsyncDisposableStack, 'prototype', {
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: false
|
||||
});
|
24
test/built-ins/AsyncDisposableStack/prototype/use/prop-desc.js
vendored
Normal file
24
test/built-ins/AsyncDisposableStack/prototype/use/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of AsyncDisposableStack.prototype.use
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof AsyncDisposableStack.prototype.use, 'function');
|
||||
|
||||
verifyProperty(AsyncDisposableStack.prototype, 'use', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -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-%asynciteratorprototype%-@@asyncDispose
|
||||
description: Property descriptor
|
||||
info: |
|
||||
ES6 Section 17
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex
|
||||
B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
features: [explicit-resource-management]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
async function* generator() {}
|
||||
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype))
|
||||
|
||||
verifyProperty(AsyncIteratorPrototype, Symbol.asyncDispose, {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
22
test/built-ins/DisposableStack/prop-desc.js
Normal file
22
test/built-ins/DisposableStack/prop-desc.js
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-disposablestack-constructor
|
||||
description: >
|
||||
Property descriptor of DisposableStack
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
verifyProperty(this, 'DisposableStack', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/DisposableStack/prototype/adopt/prop-desc.js
vendored
Normal file
24
test/built-ins/DisposableStack/prototype/adopt/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of DisposableStack.prototype.adopt
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof DisposableStack.prototype.adopt, 'function');
|
||||
|
||||
verifyProperty(DisposableStack.prototype, 'adopt', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/DisposableStack/prototype/defer/prop-desc.js
vendored
Normal file
24
test/built-ins/DisposableStack/prototype/defer/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of DisposableStack.prototype.defer
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof DisposableStack.prototype.defer, 'function');
|
||||
|
||||
verifyProperty(DisposableStack.prototype, 'defer', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/DisposableStack/prototype/dispose/prop-desc.js
vendored
Normal file
24
test/built-ins/DisposableStack/prototype/dispose/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of DisposableStack.prototype.dispose
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof DisposableStack.prototype.dispose, 'function');
|
||||
|
||||
verifyProperty(DisposableStack.prototype, 'dispose', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/DisposableStack/prototype/move/prop-desc.js
vendored
Normal file
24
test/built-ins/DisposableStack/prototype/move/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of DisposableStack.prototype.move
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof DisposableStack.prototype.move, 'function');
|
||||
|
||||
verifyProperty(DisposableStack.prototype, 'move', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
18
test/built-ins/DisposableStack/prototype/prop-desc.js
vendored
Normal file
18
test/built-ins/DisposableStack/prototype/prop-desc.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: The property descriptor DisposableStack.prototype
|
||||
esid: sec-properties-of-the-disposablestack-constructor
|
||||
info: |
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: false }.
|
||||
features: [explicit-resource-management]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyProperty(DisposableStack, 'prototype', {
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: false
|
||||
});
|
24
test/built-ins/DisposableStack/prototype/use/prop-desc.js
vendored
Normal file
24
test/built-ins/DisposableStack/prototype/use/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: >
|
||||
Property descriptor of DisposableStack.prototype.use
|
||||
info: |
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof DisposableStack.prototype.use, 'function');
|
||||
|
||||
verifyProperty(DisposableStack.prototype, 'use', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
23
test/built-ins/Iterator/prototype/Symbol.dispose/prop-desc.js
vendored
Normal file
23
test/built-ins/Iterator/prototype/Symbol.dispose/prop-desc.js
vendored
Normal file
@ -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-%iteratorprototype%-@@dispose
|
||||
description: Property descriptor
|
||||
info: |
|
||||
ES6 Section 17
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex
|
||||
B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
features: [explicit-resource-management]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
const IteratorPrototype = Object.getPrototypeOf(
|
||||
Object.getPrototypeOf([][Symbol.iterator]())
|
||||
);
|
||||
|
||||
verifyProperty(IteratorPrototype, Symbol.dispose, {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
26
test/built-ins/NativeErrors/SuppressedError/prop-desc.js
Normal file
26
test/built-ins/NativeErrors/SuppressedError/prop-desc.js
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-suppressederror-objects
|
||||
description: >
|
||||
Property descriptor of SuppressedError
|
||||
info: |
|
||||
SuppressedError Objects
|
||||
|
||||
ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof SuppressedError, 'function');
|
||||
|
||||
verifyProperty(this, 'SuppressedError', {
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
24
test/built-ins/NativeErrors/SuppressedError/prototype/prop-desc.js
vendored
Normal file
24
test/built-ins/NativeErrors/SuppressedError/prototype/prop-desc.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2023 Ron Buckton. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-aggregate-error.prototype
|
||||
description: >
|
||||
Property descriptor of SuppressedError.prototype
|
||||
info: |
|
||||
SuppressedError.prototype
|
||||
|
||||
The initial value of SuppressedError.prototype is the intrinsic object %AggregateErrorPrototype%.
|
||||
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof SuppressedError.prototype, 'object');
|
||||
|
||||
verifyProperty(SuppressedError, 'prototype', {
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
configurable: false
|
||||
});
|
17
test/built-ins/Symbol/asyncDispose/prop-desc.js
Normal file
17
test/built-ins/Symbol/asyncDispose/prop-desc.js
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
`Symbol.asyncDispose` property descriptor
|
||||
info: |
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]:
|
||||
false, [[Configurable]]: false }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Symbol.asyncDispose, 'symbol');
|
||||
verifyNotEnumerable(Symbol, 'asyncDispose');
|
||||
verifyNotWritable(Symbol, 'asyncDispose');
|
||||
verifyNotConfigurable(Symbol, 'asyncDispose');
|
17
test/built-ins/Symbol/dispose/prop-desc.js
Normal file
17
test/built-ins/Symbol/dispose/prop-desc.js
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
`Symbol.dispose` property descriptor
|
||||
info: |
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]:
|
||||
false, [[Configurable]]: false }.
|
||||
includes: [propertyHelper.js]
|
||||
features: [explicit-resource-management]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Symbol.dispose, 'symbol');
|
||||
verifyNotEnumerable(Symbol, 'dispose');
|
||||
verifyNotWritable(Symbol, 'dispose');
|
||||
verifyNotConfigurable(Symbol, 'dispose');
|
Loading…
x
Reference in New Issue
Block a user