mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 04:54:44 +02:00
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:
parent
2af27af915
commit
84f820258b
@ -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) {}
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user