mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Merge pull request #953 from leobalter/syg-async-lineterm
Update cases for async arrow fns with a line terminator
This commit is contained in:
commit
3c79e9dbac
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: prod-AsyncArrowFunction
|
||||||
|
description: >
|
||||||
|
async arrows cannot have a line terminator between "async" and the AsyncArrowBindingIdentifier
|
||||||
|
info: |
|
||||||
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
AsyncArrowFunction:
|
||||||
|
async [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] => AsyncConciseBody
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
async
|
||||||
|
identifier => {}
|
||||||
|
});
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: prod-AsyncArrowHead
|
||||||
|
description: async arrows cannot have a line terminator between "async" and the formals
|
||||||
|
info: |
|
||||||
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
AsyncArrowFunction:
|
||||||
|
[...]
|
||||||
|
CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] => AsyncConciseBody
|
||||||
|
|
||||||
|
Supplemental Syntax
|
||||||
|
|
||||||
|
When processing an instance of the production
|
||||||
|
|
||||||
|
AsyncArrowFunction:
|
||||||
|
CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] => AsyncConciseBody
|
||||||
|
|
||||||
|
the interpretation of CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
|
||||||
|
|
||||||
|
AsyncArrowHead:
|
||||||
|
async [no LineTerminator here] ArrowFormalParameters
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async
|
||||||
|
(foo) => { }
|
@ -10,6 +10,6 @@ negative:
|
|||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo (arguments) { }
|
async foo (arguments) { }
|
||||||
}
|
})
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: prod-AsyncMethod
|
||||||
|
description: async methods cannot have a line terminator between "async" and the property name
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncMethod:
|
||||||
|
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
({
|
||||||
|
async
|
||||||
|
foo() { }
|
||||||
|
})
|
@ -9,7 +9,7 @@ negative:
|
|||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo (x = await) { }
|
async foo (x = await) { }
|
||||||
}
|
})
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@ negative:
|
|||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo (await) { }
|
async foo (await) { }
|
||||||
}
|
})
|
||||||
|
@ -9,6 +9,6 @@ negative:
|
|||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo () { super() }
|
async foo () { super() }
|
||||||
}
|
})
|
||||||
|
@ -10,6 +10,6 @@ negative:
|
|||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo(a, a) { }
|
async foo(a, a) { }
|
||||||
}
|
})
|
||||||
|
@ -10,6 +10,6 @@ negative:
|
|||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo(eval) { }
|
async foo(eval) { }
|
||||||
}
|
})
|
||||||
|
@ -10,6 +10,6 @@ negative:
|
|||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
!{
|
({
|
||||||
async function foo(bar) { let bar; }
|
async function foo(bar) { let bar; }
|
||||||
}
|
})
|
||||||
|
@ -9,6 +9,6 @@ negative:
|
|||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
!{
|
({
|
||||||
async foo(foo = super()) { }
|
async foo(foo = super()) { }
|
||||||
}
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user