summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Number/S15.7.1.1_A2.js
blob: f349ec370a9860bc09e93b884df134b737cd9b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: Number() returns +0
es5id: 15.7.1.1_A2
description: Call Number() and check result
---*/

//CHECK#1
if (typeof Number() !== "number") {
  $ERROR('#1: typeof Number() should be "number", actual is "' + typeof Number() + '"');
}

//CHECK#2
if (Number() !== 0) {
  $ERROR('#2: Number() === 0, actual is ' + Number());
} else if (1 / Number() !== Number.POSITIVE_INFINITY) {
  $ERROR('#2: Number() === +0, actual is ' + Number());
}

reportCompare(0, 0);