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 property descriptor tests for explicit resource management objects
- Loading branch information
Showing
20 changed files
with
450 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,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 changes: 24 additions & 0 deletions
24
test/built-ins/AsyncDisposableStack/prototype/adopt/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/AsyncDisposableStack/prototype/defer/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/AsyncDisposableStack/prototype/disposeAsync/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/AsyncDisposableStack/prototype/move/prop-desc.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,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 changes: 18 additions & 0 deletions
18
test/built-ins/AsyncDisposableStack/prototype/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/AsyncDisposableStack/prototype/use/prop-desc.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,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 | ||
}); |
23 changes: 23 additions & 0 deletions
23
test/built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/prop-desc.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-%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, | ||
}); |
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,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 changes: 24 additions & 0 deletions
24
test/built-ins/DisposableStack/prototype/adopt/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/DisposableStack/prototype/defer/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/DisposableStack/prototype/dispose/prop-desc.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,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 changes: 24 additions & 0 deletions
24
test/built-ins/DisposableStack/prototype/move/prop-desc.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,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 | ||
}); |
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,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 | ||
}); |
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,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 changes: 23 additions & 0 deletions
23
test/built-ins/Iterator/prototype/Symbol.dispose/prop-desc.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-%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, | ||
}); |
Oops, something went wrong.