Debian Codegraph @

rhino/testsrc/tests/e4x/GC/regress-357063-02.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-02.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 var xml1 = new XML("<xml>text<a>B</a></xml>");
18 var xml2 = new XML("<xml>text<a>C</a></xml>");
19
20 XML.prototype.function::toString = function() {
21 if (xml2) {
22 delete xml2.*;
23 xml2 = null;
24 gc();
25 }
26 return "text";
27 }
28
29 print('xml1: ' + xml1);
30 print('xml2: ' + xml2);
31
32 if (xml1 == xml2)
33 throw "unexpected result";
34
35 TEST(1, expect, actual);
36
37 END();