Skip to content

Commit

Permalink
harness: Remove hidden-constructors harness file
Browse files Browse the repository at this point in the history
The objects it provides are also available in another harness file,
wellKnownIntrinsicObjects.js. There's no point in duplicating that in the
harness. Rewrite each test that used hidden-constructors.js to use
getWellKnownIntrinsicObject instead.
  • Loading branch information
ptomato committed Feb 11, 2025
1 parent e6f37b3 commit a4733ba
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 34 deletions.
27 changes: 0 additions & 27 deletions harness/hidden-constructors.js

This file was deleted.

4 changes: 2 additions & 2 deletions test/built-ins/AsyncFunction/is-a-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ info: |
If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true.
Return false.
includes: [isConstructor.js, hidden-constructors.js]
includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct]
---*/

var AsyncFunction = getWellKnownIntrinsicObject('%AsyncFunction%');
assert.sameValue(isConstructor(AsyncFunction), true, 'isConstructor(AsyncFunction) must return true');
new AsyncFunction();

4 changes: 2 additions & 2 deletions test/built-ins/AsyncGeneratorFunction/is-a-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ info: |
If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true.
Return false.
includes: [isConstructor.js, hidden-constructors.js]
includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct]
---*/

var AsyncGeneratorFunction = getWellKnownIntrinsicObject('%AsyncGeneratorFunction%');
assert.sameValue(
isConstructor(AsyncGeneratorFunction),
true,
'isConstructor(AsyncGeneratorFunction) must return true'
);
new AsyncGeneratorFunction();

4 changes: 2 additions & 2 deletions test/built-ins/GeneratorFunction/is-a-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ info: |
If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true.
Return false.
includes: [isConstructor.js, hidden-constructors.js]
includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct]
---*/

var GeneratorFunction = getWellKnownIntrinsicObject('%GeneratorFunction%');
assert.sameValue(isConstructor(GeneratorFunction), true, 'isConstructor(GeneratorFunction) must return true');
new GeneratorFunction();

3 changes: 2 additions & 1 deletion test/language/expressions/async-arrow-function/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ info: |
6. Let closure be OrdinaryFunctionCreate(%AsyncFunction.prototype%, sourceText, parameters,
AsyncConciseBody, lexical-this, env, privateEnv).
...
includes: [hidden-constructors.js]
includes: [wellKnownIntrinsicObjects.js]
---*/

var AsyncFunction = getWellKnownIntrinsicObject('%AsyncFunction%');
assert.sameValue(Object.getPrototypeOf(async () => {}), AsyncFunction.prototype);

0 comments on commit a4733ba

Please sign in to comment.