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

Update cases for async arrow fns with a line terminator
This commit is contained in:
Rick Waldron 2017-04-07 16:25:51 -04:00 committed by GitHub
commit 3c79e9dbac
11 changed files with 86 additions and 16 deletions

View File

@ -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 => {}
});

View File

@ -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) => { }

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
flags: [onlyStrict]
---*/
!{
({
async foo (arguments) { }
}
})

View File

@ -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() { }
})

View File

@ -9,7 +9,7 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo (x = await) { }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo (await) { }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo () { super() }
}
})

View File

@ -10,6 +10,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(a, a) { }
}
})

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
flags: [onlyStrict]
---*/
!{
({
async foo(eval) { }
}
})

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
---*/
!{
({
async function foo(bar) { let bar; }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(foo = super()) { }
}
})