Debian Codegraph @

rhino/testsrc/tests/e4x/GC/regress-357063-01.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = 'regress-357063-01.js';
8
9 var BUGNUMBER = 357063;
10 var summary = 'GC hazard in XMLEquality';
11 var actual = 'No Crash';
12 var expect = 'No Crash';
13
14 printBugNumber(BUGNUMBER);
15 START(summary);
16
17
18 var xml = new XML("<xml><a>text</a><a>text</a></xml>");
19 var xml2 = new XML("<xml><a>text</a><a>text</a></xml>");
20 var list1 = xml.a;
21 var list2 = xml2.a;
22
23 XML.prototype.function::toString = function() {
24 if (xml2) {
25 delete list2[1];
26 delete list2[0];
27 xml2 = null;
28 gc();
29 }
30 return "text";
31 }
32
33 var value = list1 == list2;
34
35 print('list1: ' + list1.toXMLString());
36 print('list2: ' + list2.toXMLString());
37 print('list1 == list2: ' + value);
38
39 TEST(1, expect, actual);
40
41 END();