2016-03-11 01:35:14 +01:00
|
|
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
description: AnnexB extension not honored in strict mode (IfStatement with a declaration in the second statement position in the global scope)
|
|
|
|
esid: sec-if-statement
|
|
|
|
es6id: 13.6
|
|
|
|
flags: [onlyStrict]
|
2016-01-31 00:57:28 +01:00
|
|
|
negative:
|
2017-12-03 06:06:42 +01:00
|
|
|
phase: parse
|
2016-01-31 00:57:28 +01:00
|
|
|
type: SyntaxError
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2016-03-11 01:35:14 +01:00
|
|
|
The following rules for IfStatement augment those in 13.6:
|
|
|
|
|
|
|
|
IfStatement[Yield, Return]:
|
|
|
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
|
|
|
|
if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
|
|
|
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
|
|
|
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
|
|
|
|
|
|
|
|
B.3.3.2 Changes to GlobalDeclarationInstantiation
|
2018-09-27 01:18:22 +02:00
|
|
|
|
2016-03-11 01:35:14 +01:00
|
|
|
1. 1. Let strict be IsStrict of script
|
|
|
|
2. If strict is *false*, then
|
|
|
|
[...]
|
|
|
|
---*/
|
|
|
|
|
2018-10-11 16:59:24 +02:00
|
|
|
$DONOTEVALUATE();
|
2017-04-29 22:31:08 +02:00
|
|
|
|
2016-03-11 01:35:14 +01:00
|
|
|
if (false) ; else function f() {}
|