aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/11_Expressions/11.11_Binary_Logical_Operators/11.11.2_Logical_OR_Operator/S11.11.2_A3_T1.js
blob: bf9d6a968ee44dd212b0520e5973dead6dffc168 (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
48
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S11.11.2_A3_T1;
* @section: 11.11.2;
* @assertion: If ToBoolean(x) is false, return y;
* @description: Type(x) and Type(y) vary between primitive boolean and Boolean object;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S11.11.2_A3_T1",

path: "TestCases/11_Expressions/11.11_Binary_Logical_Operators/11.11.2_Logical_OR_Operator/S11.11.2_A3_T1.js",

assertion: "If ToBoolean(x) is false, return y",

description: "Type(x) and Type(y) vary between primitive boolean and Boolean object",

test: function testcase() {
   //CHECK#1
if ((false || true) !== true) {
  $ERROR('#1: (false || true) === true');
}

//CHECK#2
if ((false || false) !== false) {
  $ERROR('#2: (false || false) === false');
}

//CHECK#3
var y = new Boolean(true);
if ((false || y) !== y) {
  $ERROR('#3: (var y = new Boolean(true); false || y) === y');
}

//CHECK#4
var y = new Boolean(false);
if ((false || y) !== y) {
  $ERROR('#4: (var y = new Boolean(false); false || y) === y');
}

 }
});