Skip to content
Snippets Groups Projects
Commit 14595b47 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Add tests for restricted grammar productions

parent 24391fb9
No related branches found
No related tags found
No related merge requests found
// 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;
// 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 (_) {}
// 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;
// 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;
// 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;
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