michael@0: michael@0: gczeal(11); michael@0: var otherGlobal = newGlobal(); michael@0: function test(str, arg, result) michael@0: { michael@0: var fun = new Function('x', str); michael@0: var code = "(function (x) { " + str + " })"; michael@0: var c = clone(otherGlobal.evaluate(code, {compileAndGo: false})); michael@0: assertEq(c.toSource(), eval(code).toSource()); michael@0: } michael@0: test('return let (y) x;'); michael@0: test('return let (x) "" + x;', 'unicorns', 'undefined'); michael@0: test('return let (y = x) (y++, "" + y);', 'unicorns', 'NaN'); michael@0: test('return let (y = 1) (y = x, y);'); michael@0: test('return let ([] = x) x;'); michael@0: test('return let ([, ] = x) x;'); michael@0: test('return let ([, , , , ] = x) x;'); michael@0: test('return let ([[]] = x) x;'); michael@0: test('return let ([[[[[[[[[[[[[]]]]]]]]]]]]] = x) x;'); michael@0: test('return let ([[], []] = x) x;'); michael@0: test('return let ([[[[]]], [], , [], [[]]] = x) x;');