-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
to make reviewing easier.
- Loading branch information
Showing
13 changed files
with
390 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,23 @@ | ||
// Copyright (C) 2023 Ron Buckton. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-ecmascript-standard-built-in-objects | ||
description: > | ||
The AsyncDisposableStack constructor implements [[Construct]] | ||
info: | | ||
IsConstructor ( argument ) | ||
The abstract operation IsConstructor takes argument argument (an ECMAScript language value). | ||
It determines if argument is a function object with a [[Construct]] internal method. | ||
It performs the following steps when called: | ||
If Type(argument) is not Object, return false. | ||
If argument has a [[Construct]] internal method, return true. | ||
Return false. | ||
includes: [isConstructor.js] | ||
features: [explicit-resource-management, Reflect.construct] | ||
---*/ | ||
|
||
assert.sameValue(isConstructor(AsyncDisposableStack), true, 'isConstructor(AsyncDisposableStack) must return true'); | ||
new AsyncDisposableStack(); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/adopt/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(AsyncDisposableStack.prototype.adopt), | ||
false, | ||
'isConstructor(AsyncDisposableStack.prototype.adopt) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new AsyncDisposableStack({}); new stack.adopt(); | ||
}, '`let stack = new AsyncDisposableStack({}); new stack.adopt()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/defer/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(AsyncDisposableStack.prototype.defer), | ||
false, | ||
'isConstructor(AsyncDisposableStack.prototype.defer) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new AsyncDisposableStack({}); new stack.defer(); | ||
}, '`let stack = new AsyncDisposableStack({}); new stack.defer()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/disposeAsync/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(AsyncDisposableStack.prototype.disposeAsync), | ||
false, | ||
'isConstructor(AsyncDisposableStack.prototype.disposeAsync) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new AsyncDisposableStack({}); new stack.disposeAsync(); | ||
}, '`let stack = new AsyncDisposableStack({}); new stack.disposeAsync()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/move/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(AsyncDisposableStack.prototype.move), | ||
false, | ||
'isConstructor(AsyncDisposableStack.prototype.move) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new AsyncDisposableStack({}); new stack.move(); | ||
}, '`let stack = new AsyncDisposableStack({}); new stack.move()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/AsyncDisposableStack/prototype/use/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(AsyncDisposableStack.prototype.use), | ||
false, | ||
'isConstructor(AsyncDisposableStack.prototype.use) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new AsyncDisposableStack({}); new stack.use(); | ||
}, '`let stack = new AsyncDisposableStack({}); new stack.use()` throws TypeError'); |
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-ecmascript-standard-built-in-objects | ||
description: > | ||
The DisposableStack constructor implements [[Construct]] | ||
info: | | ||
IsConstructor ( argument ) | ||
The abstract operation IsConstructor takes argument argument (an ECMAScript language value). | ||
It determines if argument is a function object with a [[Construct]] internal method. | ||
It performs the following steps when called: | ||
If Type(argument) is not Object, return false. | ||
If argument has a [[Construct]] internal method, return true. | ||
Return false. | ||
includes: [isConstructor.js] | ||
features: [explicit-resource-management, Reflect.construct] | ||
---*/ | ||
|
||
assert.sameValue(isConstructor(DisposableStack), true, 'isConstructor(DisposableStack) must return true'); | ||
new DisposableStack(); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/adopt/not-a-constructor.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.adopt | ||
description: > | ||
DisposableStack.prototype.adopt does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(DisposableStack.prototype.adopt), | ||
false, | ||
'isConstructor(DisposableStack.prototype.adopt) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new DisposableStack({}); new stack.adopt(); | ||
}, '`let stack = new DisposableStack({}); new stack.adopt()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/defer/not-a-constructor.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.defer | ||
description: > | ||
DisposableStack.prototype.defer does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(DisposableStack.prototype.defer), | ||
false, | ||
'isConstructor(DisposableStack.prototype.defer) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new DisposableStack({}); new stack.defer(); | ||
}, '`let stack = new DisposableStack({}); new stack.defer()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/dispose/not-a-constructor.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 does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(DisposableStack.prototype.dispose), | ||
false, | ||
'isConstructor(DisposableStack.prototype.dispose) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new DisposableStack({}); new stack.dispose(); | ||
}, '`let stack = new DisposableStack({}); new stack.dispose()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/move/not-a-constructor.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.move | ||
description: > | ||
DisposableStack.prototype.move does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(DisposableStack.prototype.move), | ||
false, | ||
'isConstructor(DisposableStack.prototype.move) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new DisposableStack({}); new stack.move(); | ||
}, '`let stack = new DisposableStack({}); new stack.move()` throws TypeError'); |
32 changes: 32 additions & 0 deletions
32
test/built-ins/DisposableStack/prototype/use/not-a-constructor.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.use | ||
description: > | ||
DisposableStack.prototype.use does not implement [[Construct]], is not new-able | ||
info: | | ||
ECMAScript Function Objects | ||
Built-in function objects that are not identified as constructors do not | ||
implement the [[Construct]] internal method unless otherwise specified in | ||
the description of a particular function. | ||
sec-evaluatenew | ||
... | ||
7. If IsConstructor(constructor) is false, throw a TypeError exception. | ||
... | ||
includes: [isConstructor.js] | ||
features: [Reflect.construct, explicit-resource-management, arrow-function] | ||
---*/ | ||
|
||
assert.sameValue( | ||
isConstructor(DisposableStack.prototype.use), | ||
false, | ||
'isConstructor(DisposableStack.prototype.use) must return false' | ||
); | ||
|
||
assert.throws(TypeError, () => { | ||
let stack = new DisposableStack({}); new stack.use(); | ||
}, '`let stack = new DisposableStack({}); new stack.use()` throws TypeError'); |
Oops, something went wrong.