blob: d949b83b624525f318125380faeee177615e12c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-boolean.prototype.tostring
info: |
toString: If this boolean value is true, then the string "true"
is returned, otherwise, this boolean value must be false, and the string
"false" is returned
es5id: 15.6.4.2_A1_T2
description: with some argument
---*/
//CHECK#1
if(Boolean.prototype.toString(true) !== "false"){
$ERROR('#1: Boolean.prototype.toString(true) === "false"');
}
//CHECK#2
if((new Boolean()).toString(true) !== "false"){
$ERROR('#2: (new Boolean()).toString(true) === "false"');
}
//CHECK#3
if((new Boolean(false)).toString(true) !== "false"){
$ERROR('#3: (new Boolean(false)).toString(true) === "false"');
}
//CHECK#4
if((new Boolean(true)).toString(false) !== "true"){
$ERROR('#4: (new Boolean(true)).toString(false) === "true"');
}
//CHECK#5
if((new Boolean(1)).toString(false) !== "true"){
$ERROR('#5: (new Boolean(1)).toString(false) === "true"');
}
//CHECK#6
if((new Boolean(0)).toString(true) !== "false"){
$ERROR('#6: (new Boolean(0)).toString(true) === "false"');
}
//CHECK#7
if((new Boolean(new Object())).toString(false) !== "true"){
$ERROR('#7: (new Boolean(new Object())).toString(false) === "true"');
}
|