Debian Codegraph @

rhino/testsrc/tests/js1_5/GC/regress-316885-02.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-316885-02.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 316885;
9 var summary = 'Unrooted access in jsinterp.c';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 var str = "test";
17
18 var lval = {
19 valueOf: function() {
20 return str+"1";
21 }
22 };
23
24 var ONE = 1;
25
26 var rval = {
27 valueOf: function() {
28 // Make sure that the result of the previous lval.valueOf
29 // is not GC-rooted.
30 var tmp = "x"+lval;
31 if (typeof gc == "function")
32 gc();
33 for (var i = 0; i != 40000; ++i) {
34 tmp = 1e100 / ONE;
35 }
36 return str;
37 }
38 };
39
40 expect = (str+"1" > str);
41 actual = (lval > rval);
42
43 reportCompare(expect, actual, summary);