diff --git a/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js b/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js index 93c5c390a36..8f1c192c1e2 100644 --- a/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js +++ b/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js @@ -12,10 +12,10 @@ print(BUGNUMBER + ": " + summary); * BEGIN TEST * **************/ -var str = '['; -for (var i = 0, sz = Math.pow(2, 21); i < sz; i++) - str += '0,'; -str += '0]'; +var body = "0,"; +for (var i = 0; i < 21; i++) + body = body + body; +var str = '[' + body + '0]'; var arr = JSON.parse(str); assertEq(arr.length, Math.pow(2, 21) + 1);