michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: Brendan Eich michael@0: */ michael@0: michael@0: var summary = "Partial flat expression closure upvar order test"; michael@0: michael@0: function f(a) { michael@0: if (a) { michael@0: let b = 42; michael@0: let c = function () b+a; michael@0: ++b; michael@0: return c; michael@0: } michael@0: return null; michael@0: } michael@0: michael@0: var expect = 44; michael@0: var actual = f(1)(); michael@0: michael@0: reportCompare(expect, actual, summary);