mirror of https://github.com/tc39/test262.git
Add tests for restricted grammar productions
This commit is contained in:
parent
24391fb9e8
commit
14595b47b8
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-scripts
|
||||
es6id: 15.1
|
||||
description: ReturnStatement may not be used directly within global code
|
||||
info: |
|
||||
Syntax
|
||||
|
||||
Script :
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody :
|
||||
StatementList[~Yield, ~Return]
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
return;
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-scripts
|
||||
es6id: 15.1
|
||||
description: >
|
||||
The `yield` token is interpreted as an Identifier when it appears in global
|
||||
code (non-strict mode)
|
||||
info: |
|
||||
Syntax
|
||||
|
||||
Script :
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody :
|
||||
StatementList[~Yield, ~Return]
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
// Avoid test failures in cases where the host has defined a `yield` property
|
||||
// on the global object.
|
||||
try {
|
||||
yield = 0;
|
||||
} catch (_) {}
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-scripts
|
||||
es6id: 15.1
|
||||
description: >
|
||||
The `yield` token is interpreted as an Identifier when it appears in global
|
||||
code (strict mode)
|
||||
info: |
|
||||
Syntax
|
||||
|
||||
Script :
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody :
|
||||
StatementList[~Yield, ~Return]
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
yield;
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-modules
|
||||
es6id: 15.2
|
||||
description: ReturnStatement may not be used directly within ModuleBody
|
||||
info: |
|
||||
Syntax
|
||||
|
||||
Module :
|
||||
ModuleBodyopt
|
||||
|
||||
ModuleBody :
|
||||
ModuleItemList
|
||||
|
||||
ModuleItemList :
|
||||
ModuleItem
|
||||
ModuleItemList ModuleItem
|
||||
|
||||
ModuleItem:
|
||||
ImportDeclaration
|
||||
ExportDeclaration
|
||||
StatementListItem[~Yield, ~Return]
|
||||
flags: [module]
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
return;
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-modules
|
||||
es6id: 15.2
|
||||
description: YieldExpression may not be used directly within ModuleBody
|
||||
info: |
|
||||
Syntax
|
||||
|
||||
Module :
|
||||
ModuleBodyopt
|
||||
|
||||
ModuleBody :
|
||||
ModuleItemList
|
||||
|
||||
ModuleItemList :
|
||||
ModuleItem
|
||||
ModuleItemList ModuleItem
|
||||
|
||||
ModuleItem:
|
||||
ImportDeclaration
|
||||
ExportDeclaration
|
||||
StatementListItem[~Yield, ~Return]
|
||||
flags: [module]
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
yield;
|
Loading…
Reference in New Issue