Debian Codegraph @

rhino/testsrc/tests/ecma_3/Number/15.7.4.2-01.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 = '15.7.4.2-01.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = "411889";
9 var summary = "num.toString(), num.toString(10), and num.toString(undefined)" +
10 " should all be equivalent";
11 var actual, expect;
12
13 printBugNumber(BUGNUMBER);
14 printStatus(summary);
15
16 /**************
17 * BEGIN TEST *
18 **************/
19
20 var failed = false;
21
22 try
23 {
24 var noargs = 3.3.toString();
25 var tenarg = 3.3.toString(10);
26 var undefarg = 3.3.toString(undefined);
27
28 if (noargs !== tenarg)
29 throw "() !== (10): " + noargs + " !== " + tenarg;
30 if (tenarg !== undefarg)
31 throw "(10) !== (undefined): " + tenarg + " !== " + undefarg;
32 }
33 catch (e)
34 {
35 failed = e;
36 }
37
38 expect = false;
39 actual = failed;
40
41 reportCompare(expect, actual, summary);
42
43 expect = 1;
44 actual = 3.3.toString.length;
45 reportCompare(expect, actual, '3.3.toString.length should be 1');