Debian Codegraph @

js/src/tests/test262/language/expressions/property-accessors/S11.2.1_A3_T2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 MemberExpression calls ToObject(MemberExpression) and
7 ToString(Expression). CallExpression calls ToObject(CallExpression) and
8 ToString(Expression)
9 es5id: 11.2.1_A3_T2
10 description: Checking Number case
11 ---*/
12
13 //CHECK#1
14 if (1..toString() !== "1") {
15 throw new Test262Error('#1: 1..toString() === "1". Actual: ' + (1..toString()));
16 }
17
18 //CHECK#2
19 if (1.1.toFixed(5) !== "1.10000") {
20 throw new Test262Error('#2: 1.1.toFixed(5) === "1.10000". Actual: ' + (1.1.toFixed(5)));
21 }
22
23 //CHECK#3
24 if (1["toString"]() !== "1") {
25 throw new Test262Error('#3: 1["toString"]() === "1". Actual: ' + (1["toString"]()));
26 }
27
28 //CHECK#4
29 if (1.["toFixed"](5) !== "1.00000") {
30 throw new Test262Error('#4: 1.["toFixed"](5) === "1.00000". Actual: ' + (1.["toFixed"](5)));
31 }
32
33 //CHECK#5
34 if (new Number(1).toString() !== "1") {
35 throw new Test262Error('#5: new Number(1).toString() === "1". Actual: ' + (new Number(1).toString()));
36 }
37
38 //CHECK#6
39 if (new Number(1)["toFixed"](5) !== "1.00000") {
40 throw new Test262Error('#6: new Number(1)["toFixed"](5) === "1.00000". Actual: ' + (new Number(1)["toFixed"](5)));
41 }
42
43 reportCompare(0, 0);