summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js')
-rw-r--r--js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js
new file mode 100644
index 0000000000..e0edbaf641
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Boolean.prototype.valueOf() returns this boolean value
+esid: sec-boolean.prototype.valueof
+description: no arguments
+---*/
+assert.sameValue(Boolean.prototype.valueOf(), false, 'Boolean.prototype.valueOf() must return false');
+assert.sameValue((new Boolean()).valueOf(), false, '(new Boolean()).valueOf() must return false');
+assert.sameValue((new Boolean(0)).valueOf(), false, '(new Boolean(0)).valueOf() must return false');
+assert.sameValue((new Boolean(-1)).valueOf(), true, '(new Boolean(-1)).valueOf() must return true');
+assert.sameValue((new Boolean(1)).valueOf(), true, '(new Boolean(1)).valueOf() must return true');
+
+assert.sameValue(
+ (new Boolean(new Object())).valueOf(),
+ true,
+ '(new Boolean(new Object())).valueOf() must return true'
+);
+
+reportCompare(0, 0);