summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1.js
blob: e0edbaf6412f0cb4a2a6778ab4ed0c308b4b84d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);