test262/src/annex-b-fns/global/if-decl-else-decl-b.template

20 lines
914 B
Plaintext

// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: annexB/language/global-code/if-decl-else-decl-b-
name: IfStatement with a declaration in both statement positions in the global scope
esid: sec-functiondeclarations-in-ifstatement-statement-clauses
es6id: B.3.4
info: |
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]
flags: [noStrict]
---*/
if (false) function _f() {} else function f() { /*{ body }*/ }