summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8/extensions/expclo2.js
blob: 2c192d861b18437aae837b78b4290289d6ee0c6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
/*
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/
 * Contributor: Brendan Eich
 */

var summary = "Partial flat expression closure upvar order test";

function f(a) {
    if (a) {
        let b = 42;
        let c = function () b+a;
        ++b;
        return c;
    }
    return null;
}

var expect = 44;
var actual = f(1)();

reportCompare(expect, actual, summary);