summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/JSON/parse-array-gc.js
blob: f617ea66dc653fe8110647569fc6ac5b5e81eb61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

var gTestfile = "parse-array-gc.js";
//-----------------------------------------------------------------------------
var BUGNUMBER = 852563;
var summary =
  "IdValuePair::value should be initialized to avoid GC sequence-point issues";

print(BUGNUMBER + ": " + summary);

print("Note: You must run this test under valgrind to be certain it passes");

/**************
 * BEGIN TEST *
 **************/

var x;

if (typeof gczeal === "function")
  gczeal(2, 1);
x = JSON.parse('{"foo":[]}');
Object.getPrototypeOf(x.foo) == Array.prototype;
x = JSON.parse('{"foo":[], "bar":[]}');

/******************************************************************************/

if (typeof reportCompare === "function")
  reportCompare(true, true);

if (typeof gczeal === "function")
  gczeal(0);

print("Tests complete");