Debian Codegraph @

rhino/testsrc/tests/js1_5/GC/regress-313479.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-313479.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 313479;
9 var summary = 'Root access in jsnum.c';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 var prepared_string = String(1);
17 String(2); // To remove prepared_string from newborn
18
19 var likeString = {
20 toString: function() {
21 var tmp = prepared_string;
22 prepared_string = null;
23 return tmp;
24 }
25 };
26
27 var likeNumber = {
28 valueOf: function() {
29 gc();
30 return 10;
31 }
32 }
33
34 var expect = 1;
35 var actual = parseInt(likeString, likeNumber);
36 printStatus("expect="+expect+" actual="+actual);
37
38 reportCompare(expect, actual, summary);