diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/gc/bug-880776.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/gc/bug-880776.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,21 @@ + +gczeal(11); +var otherGlobal = newGlobal(); +function test(str, arg, result) +{ + var fun = new Function('x', str); + var code = "(function (x) { " + str + " })"; + var c = clone(otherGlobal.evaluate(code, {compileAndGo: false})); + assertEq(c.toSource(), eval(code).toSource()); +} +test('return let (y) x;'); +test('return let (x) "" + x;', 'unicorns', 'undefined'); +test('return let (y = x) (y++, "" + y);', 'unicorns', 'NaN'); +test('return let (y = 1) (y = x, y);'); +test('return let ([] = x) x;'); +test('return let ([, ] = x) x;'); +test('return let ([, , , , ] = x) x;'); +test('return let ([[]] = x) x;'); +test('return let ([[[[[[[[[[[[[]]]]]]]]]]]]] = x) x;'); +test('return let ([[], []] = x) x;'); +test('return let ([[[[]]], [], , [], [[]]] = x) x;');