parse-array-gc.js (911B)
1 // Any copyright is dedicated to the Public Domain. 2 // http://creativecommons.org/licenses/publicdomain/ 3 4 var gTestfile = "parse-array-gc.js"; 5 //----------------------------------------------------------------------------- 6 var BUGNUMBER = 852563; 7 var summary = 8 "IdValuePair::value should be initialized to avoid GC sequence-point issues"; 9 10 print(BUGNUMBER + ": " + summary); 11 12 print("Note: You must run this test under valgrind to be certain it passes"); 13 14 /************** 15 * BEGIN TEST * 16 **************/ 17 18 var x; 19 20 if (typeof gczeal === "function") 21 gczeal(2, 1); 22 x = JSON.parse('{"foo":[]}'); 23 Object.getPrototypeOf(x.foo) == Array.prototype; 24 x = JSON.parse('{"foo":[], "bar":[]}'); 25 26 /******************************************************************************/ 27 28 if (typeof reportCompare === "function") 29 reportCompare(true, true); 30 31 if (typeof gczeal === "function") 32 gczeal(0); 33 34 print("Tests complete");