Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Number/S15.7.1.1_A2.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: Number() returns +0
6 es5id: 15.7.1.1_A2
7 description: Call Number() and check result
8 ---*/
9
10 //CHECK#1
11 if (typeof Number() !== "number") {
12 $ERROR('#1: typeof Number() should be "number", actual is "' + typeof Number() + '"');
13 }
14
15 //CHECK#2
16 if (Number() !== 0) {
17 $ERROR('#2: Number() === 0, actual is ' + Number());
18 } else if (1 / Number() !== Number.POSITIVE_INFINITY) {
19 $ERROR('#2: Number() === +0, actual is ' + Number());
20 }