1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/gc/bug-880776.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 + 1.5 +gczeal(11); 1.6 +var otherGlobal = newGlobal(); 1.7 +function test(str, arg, result) 1.8 +{ 1.9 + var fun = new Function('x', str); 1.10 + var code = "(function (x) { " + str + " })"; 1.11 + var c = clone(otherGlobal.evaluate(code, {compileAndGo: false})); 1.12 + assertEq(c.toSource(), eval(code).toSource()); 1.13 +} 1.14 +test('return let (y) x;'); 1.15 +test('return let (x) "" + x;', 'unicorns', 'undefined'); 1.16 +test('return let (y = x) (y++, "" + y);', 'unicorns', 'NaN'); 1.17 +test('return let (y = 1) (y = x, y);'); 1.18 +test('return let ([] = x) x;'); 1.19 +test('return let ([, ] = x) x;'); 1.20 +test('return let ([, , , , ] = x) x;'); 1.21 +test('return let ([[]] = x) x;'); 1.22 +test('return let ([[[[[[[[[[[[[]]]]]]]]]]]]] = x) x;'); 1.23 +test('return let ([[], []] = x) x;'); 1.24 +test('return let ([[[[]]], [], , [], [[]]] = x) x;');