summaryrefslogtreecommitdiff
path: root/test/built-ins/Boolean/S9.2_A1_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Boolean/S9.2_A1_T1.js')
-rw-r--r--test/built-ins/Boolean/S9.2_A1_T1.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/built-ins/Boolean/S9.2_A1_T1.js b/test/built-ins/Boolean/S9.2_A1_T1.js
new file mode 100644
index 000000000..c67593159
--- /dev/null
+++ b/test/built-ins/Boolean/S9.2_A1_T1.js
@@ -0,0 +1,30 @@
+// 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 undefined value is false
+es5id: 9.2_A1_T1
+description: >
+ Undefined, void and others are converted to Boolean by explicit
+ transformation
+---*/
+
+// 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()));
+}