mirror of
https://github.com/tc39/test262.git
synced 2025-09-18 15:47:56 +02:00
Coverage: async arrow in ClassHeritage. Fixes gh-1736
This commit is contained in:
parent
fd92897147
commit
b59bd307a8
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name.
|
||||||
|
info: |
|
||||||
|
ClassTail : ClassHeritage { ClassBody }
|
||||||
|
|
||||||
|
ClassHeritage :
|
||||||
|
extends LeftHandSideExpression
|
||||||
|
|
||||||
|
template: syntax/invalid
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- heritage
|
||||||
|
extends () => {}
|
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name.
|
||||||
|
info: |
|
||||||
|
ClassTail : ClassHeritage { ClassBody }
|
||||||
|
|
||||||
|
ClassHeritage :
|
||||||
|
extends LeftHandSideExpression
|
||||||
|
|
||||||
|
template: syntax/invalid
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- heritage
|
||||||
|
extends async () => {}
|
31
test/language/expressions/class/heritage-arrow-function.js
Normal file
31
test/language/expressions/class/heritage-arrow-function.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
|
description: >
|
||||||
|
Throw a TypeError exception if IsConstructor(superclass) is false (async arrow)
|
||||||
|
info: |
|
||||||
|
Runtime Semantics: ClassDefinitionEvaluation
|
||||||
|
|
||||||
|
ClassTail : ClassHeritage { ClassBody }
|
||||||
|
...
|
||||||
|
|
||||||
|
5. Else,
|
||||||
|
Set the running execution context's LexicalEnvironment to classScope.
|
||||||
|
Let superclassRef be the result of evaluating ClassHeritage.
|
||||||
|
Set the running execution context's LexicalEnvironment to env.
|
||||||
|
Let superclass be ? GetValue(superclassRef).
|
||||||
|
If superclass is null, then
|
||||||
|
Let protoParent be null.
|
||||||
|
Let constructorParent be %Function.prototype%.
|
||||||
|
Else if IsConstructor(superclass) is false, throw a TypeError exception.
|
||||||
|
...
|
||||||
|
features: [class]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
var C = class extends (async () => {}) {};
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
|
description: >
|
||||||
|
Throw a TypeError exception if IsConstructor(superclass) is false (async arrow)
|
||||||
|
info: |
|
||||||
|
Runtime Semantics: ClassDefinitionEvaluation
|
||||||
|
|
||||||
|
ClassTail : ClassHeritage { ClassBody }
|
||||||
|
...
|
||||||
|
|
||||||
|
5. Else,
|
||||||
|
Set the running execution context's LexicalEnvironment to classScope.
|
||||||
|
Let superclassRef be the result of evaluating ClassHeritage.
|
||||||
|
Set the running execution context's LexicalEnvironment to env.
|
||||||
|
Let superclass be ? GetValue(superclassRef).
|
||||||
|
If superclass is null, then
|
||||||
|
Let protoParent be null.
|
||||||
|
Let constructorParent be %Function.prototype%.
|
||||||
|
Else if IsConstructor(superclass) is false, throw a TypeError exception.
|
||||||
|
...
|
||||||
|
features: [class]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
var C = class extends (async () => {}) {};
|
||||||
|
});
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user