Skip to content
Snippets Groups Projects
Commit 6391689a authored by Caitlin Potter's avatar Caitlin Potter Committed by Rick Waldron
Browse files

Add tests for async generator function expressions

parent 82c2ca07
No related branches found
No related tags found
No related merge requests found
Showing
with 297 additions and 0 deletions
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
IsSimpleParameterList of UniqueFormalParameters is false.
negative:
phase: early
type: SyntaxError
---*/
(async function*(x = 1) {"use strict"});
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a SyntaxError if FormalParameters contains arguments in strict mode.
negative:
phase: early
type: SyntaxError
flags: [onlyStrict]
---*/
(async function*(arguments) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1.1
description: >
`await` is not a valid BindingIdentifier for AsyncGeneratorExpressions.
negative:
phase: early
type: SyntaxError
---*/
(async function* await() { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
If the source code matching this production is strict code, it is a
Syntax Error if BindingIdentifier is the IdentifierName arguments.
negative:
phase: early
type: SyntaxError
flags: [onlyStrict]
---*/
(async function* arguments() { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
If the source code matching this production is strict code, it is a
Syntax Error if BindingIdentifier is the IdentifierName eval.
negative:
phase: early
type: SyntaxError
flags: [onlyStrict]
---*/
(async function* eval() { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a syntax error if AsyncGeneratorBody contains SuperCall is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*() { super(); });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a syntax error if AsyncGeneratorBody contains SuperProperty is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*() { super.prop; });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a SyntaxError if FormalParameters contains eval in strict mode.
negative:
phase: early
type: SyntaxError
flags: [onlyStrict]
---*/
(async function*(eval) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a SyntaxError if BoundNames of FormalParameters also occurs in the
LexicallyDeclaredNames of AsyncFunctionBody
negative:
phase: early
type: SyntaxError
---*/
(async function*(a) { const a = 0; });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a SyntaxError if BoundNames of FormalParameters also occurs in the
LexicallyDeclaredNames of AsyncFunctionBody
negative:
phase: early
type: SyntaxError
---*/
(async function*(a) { let a; });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a Syntax Error if FormalParameters Contains AwaitExpression is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*(x = await 1) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1
description: >
`await` is a reserved keyword within async generator function bodies and may
not be used as the binding identifier of a parameter.
negative:
phase: early
type: SyntaxError
---*/
(async function*(await) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a syntax error if FormalParameters contains SuperCall is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*(a = super()) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a syntax error if FormalParameters contains SuperProperty is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*(a = super.prop) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
It is a Syntax Error if FormalParameters Contains YieldExpression is true.
negative:
phase: early
type: SyntaxError
---*/
(async function*(x = yield) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1
description: >
`await` is a reserved keyword within async generator function bodies and may
not be used as the binding identifier of a parameter.
negative:
phase: early
type: SyntaxError
---*/
(async function*(yield) { });
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1.1
description: >
`await` is a reserved keyword within async generator function bodies and may
not be used as a label.
negative:
phase: early
type: SyntaxError
---*/
(async function*() {
await: 1;
});
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1.1
description: >
`yield` is a reserved keyword within async generator function bodies and may
not be used as a label.
negative:
phase: early
type: SyntaxError
---*/
(async function*() {
yield: 1;
});
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: pending
description: >
Async generator function expressions are not a simple assignment target.
negative:
phase: early
type: ReferenceError
---*/
(async function*() { } = 1);
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Caitlin Potter <caitp@igalia.com>
esid: 12.1.1
description: >
`yield` is not a valid BindingIdentifier for AsyncGeneratorExpressions.
negative:
phase: early
type: SyntaxError
---*/
(async function* yield() { });
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