test262/test/built-ins/Boolean/S9.2_A4_T1.js

27 lines
730 B
JavaScript
Raw Normal View History

// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
Result of boolean conversion from number value is false if the argument
is +0, -0, or NaN; otherwise, is true
2017-07-27 18:17:54 +02:00
esid: sec-toboolean
2014-07-25 00:41:42 +02:00
es5id: 9.2_A4_T1
description: +0, -0 and NaN convert to Boolean by explicit transformation
---*/
// CHECK#1
if (Boolean(+0) !== false) {
2017-07-27 18:17:54 +02:00
$ERROR('#1: Boolean(+0) === false. Actual: ' + (Boolean(+0)));
}
// CHECK#2
if (Boolean(-0) !== false) {
$ERROR('#2: Boolean(-0) === false. Actual: ' + (Boolean(-0)));
}
// CHECK#3
if (Boolean(Number.NaN) !== false) {
$ERROR('#3: Boolean(Number.NaN) === false. Actual: ' + (Boolean(Number.NaN)));
}