harness: Remove hidden-constructors harness file

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.
This commit is contained in:
Philip Chimento 2025-02-11 15:37:23 -08:00 committed by Philip Chimento
parent 2af27af915
commit 84f820258b
5 changed files with 8 additions and 34 deletions

View File

@ -1,27 +0,0 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: |
Provides uniform access to built-in constructors that are not exposed to the global object.
defines:
- AsyncFunction
- AsyncGeneratorFunction
- GeneratorFunction
---*/
var AsyncFunction;
var AsyncGeneratorFunction;
var GeneratorFunction;
try {
AsyncFunction = Object.getPrototypeOf(new Function('return async function dummy() {}')()).constructor;
} catch(e) {}
try {
AsyncGeneratorFunction = Object.getPrototypeOf(new Function('return async function* dummy() {}')()).constructor;
} catch(e) {}
try {
GeneratorFunction = Object.getPrototypeOf(new Function('return function* dummy() {}')()).constructor;
} catch(e) {}

View File

@ -15,10 +15,10 @@ info: |
If Type(argument) is not Object, return false. If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true. If argument has a [[Construct]] internal method, return true.
Return false. Return false.
includes: [isConstructor.js, hidden-constructors.js] includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct] features: [Reflect.construct]
---*/ ---*/
var AsyncFunction = getWellKnownIntrinsicObject('%AsyncFunction%');
assert.sameValue(isConstructor(AsyncFunction), true, 'isConstructor(AsyncFunction) must return true'); assert.sameValue(isConstructor(AsyncFunction), true, 'isConstructor(AsyncFunction) must return true');
new AsyncFunction(); new AsyncFunction();

View File

@ -15,14 +15,14 @@ info: |
If Type(argument) is not Object, return false. If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true. If argument has a [[Construct]] internal method, return true.
Return false. Return false.
includes: [isConstructor.js, hidden-constructors.js] includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct] features: [Reflect.construct]
---*/ ---*/
var AsyncGeneratorFunction = getWellKnownIntrinsicObject('%AsyncGeneratorFunction%');
assert.sameValue( assert.sameValue(
isConstructor(AsyncGeneratorFunction), isConstructor(AsyncGeneratorFunction),
true, true,
'isConstructor(AsyncGeneratorFunction) must return true' 'isConstructor(AsyncGeneratorFunction) must return true'
); );
new AsyncGeneratorFunction(); new AsyncGeneratorFunction();

View File

@ -15,10 +15,10 @@ info: |
If Type(argument) is not Object, return false. If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true. If argument has a [[Construct]] internal method, return true.
Return false. Return false.
includes: [isConstructor.js, hidden-constructors.js] includes: [isConstructor.js, wellKnownIntrinsicObjects.js]
features: [Reflect.construct] features: [Reflect.construct]
---*/ ---*/
var GeneratorFunction = getWellKnownIntrinsicObject('%GeneratorFunction%');
assert.sameValue(isConstructor(GeneratorFunction), true, 'isConstructor(GeneratorFunction) must return true'); assert.sameValue(isConstructor(GeneratorFunction), true, 'isConstructor(GeneratorFunction) must return true');
new GeneratorFunction(); new GeneratorFunction();

View File

@ -11,7 +11,8 @@ info: |
6. Let closure be OrdinaryFunctionCreate(%AsyncFunction.prototype%, sourceText, parameters, 6. Let closure be OrdinaryFunctionCreate(%AsyncFunction.prototype%, sourceText, parameters,
AsyncConciseBody, lexical-this, env, privateEnv). AsyncConciseBody, lexical-this, env, privateEnv).
... ...
includes: [hidden-constructors.js] includes: [wellKnownIntrinsicObjects.js]
---*/ ---*/
var AsyncFunction = getWellKnownIntrinsicObject('%AsyncFunction%');
assert.sameValue(Object.getPrototypeOf(async () => {}), AsyncFunction.prototype); assert.sameValue(Object.getPrototypeOf(async () => {}), AsyncFunction.prototype);