Debian Codegraph @

rhino/testsrc/tests/ecma_3/Number/15.7.4.7-2.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.7-2.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = "411893";
9 var summary = "num.toPrecision(undefined) should equal num.toString()";
10 var actual, expect;
11
12 printBugNumber(BUGNUMBER);
13 printStatus(summary);
14
15 /**************
16 * BEGIN TEST *
17 **************/
18
19 var failed = false;
20
21 try
22 {
23 var prec = 3.3.toPrecision(undefined);
24 var str = 3.3.toString();
25 if (prec !== str)
26 {
27 throw "not equal! " +
28 "3.3.toPrecision(undefined) === '" + prec + "', " +
29 "3.3.toString() === '" + str + "'";
30 }
31 }
32 catch (e)
33 {
34 failed = e;
35 }
36
37 expect = false;
38 actual = failed;
39
40 reportCompare(expect, actual, summary);