Skip to content
Snippets Groups Projects
Commit 3c79e9db authored by Rick Waldron's avatar Rick Waldron Committed by GitHub
Browse files

Merge pull request #953 from leobalter/syg-async-lineterm

Update cases for async arrow fns with a line terminator
parents 230f9fc5 6030e4ed
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 16 deletions
// 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 => {}
});
// 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
flags: [onlyStrict]
---*/
!{
({
async foo (arguments) { }
}
})
// 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
type: SyntaxError
---*/
!{
({
async foo (x = await) { }
}
})
......@@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo (await) { }
}
})
......@@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo () { super() }
}
})
......@@ -10,6 +10,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(a, a) { }
}
})
......@@ -10,6 +10,6 @@ negative:
type: SyntaxError
flags: [onlyStrict]
---*/
!{
({
async foo(eval) { }
}
})
......@@ -10,6 +10,6 @@ negative:
type: SyntaxError
---*/
!{
({
async function foo(bar) { let bar; }
}
})
......@@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(foo = super()) { }
}
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment