summaryrefslogtreecommitdiff
path: root/src/annex-b-fns/eval-func/direct-if-stmt-else-decl.template
blob: ef99e5ff528712747d1f6bbf0c30b98b69972d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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/eval-code/direct/func-if-stmt-else-decl-
name: IfStatement with a declaration in the second statement position in eval code
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]
---*/

(function(/*{ params }*/) {
  eval(
    '/*{ before }*/if (false) ; else function f() { /*{ body }*/ }/*{ after }*/'
  );
}(/*{ args }*/));