regress-496922.js (1044B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 //----------------------------------------------------------------------------- 7 var BUGNUMBER = 496922; 8 var summary = 'Incorrect handling of extra arguments'; 9 var actual = '' 10 var expect = '0,0,1,1,2,2,3,3'; 11 12 13 //----------------------------------------------------------------------------- 14 15 // The code must run as part of the top-level script in order to get the bug. 16 printBugNumber(BUGNUMBER); 17 printStatus (summary); 18 19 var a = []; 20 { 21 let f = function() { 22 for (let x = 0; x < 4; ++x) { 23 (function() { 24 for (let y = 0; y < 2; ++y) { 25 a.push(x); 26 } 27 })() 28 } 29 }; (function() {})() 30 f(99) 31 } 32 actual = '' + a; 33 34 reportCompare(expect, actual, summary); 35 //-----------------------------------------------------------------------------