2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: Result of boolean conversion from undefined value is false
|
2017-07-27 18:17:54 +02:00
|
|
|
esid: sec-toboolean
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 9.2_A1_T1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Undefined, void and others are converted to Boolean by explicit
|
|
|
|
transformation
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
// CHECK#1
|
|
|
|
if (Boolean(undefined) !== false) {
|
|
|
|
$ERROR('#1: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK#2
|
|
|
|
if (Boolean(void 0) !== false) {
|
|
|
|
$ERROR('#2: Boolean(undefined) === false. Actual: ' + (Boolean(undefined)));
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK#3
|
|
|
|
if (Boolean(eval("var x")) !== false) {
|
|
|
|
$ERROR('#3: Boolean(eval("var x")) === false. Actual: ' + (Boolean(eval("var x"))));
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK#4
|
|
|
|
if (Boolean() !== false) {
|
|
|
|
$ERROR('#4: Boolean() === false. Actual: ' + (Boolean()));
|
|
|
|
}
|