| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
When the Object function is called with one argument value, |
| 7 |
and the value neither is null nor undefined, and is supplied, return ToObject(value) |
| 8 |
es5id: 15.2.1.1_A2_T13 |
| 9 |
description: Calling Object function with boolean expression as argument value |
| 10 |
---*/ |
| 11 |
|
| 12 |
var obj = Object((1 === 1) && (!false)); |
| 13 |
|
| 14 |
//CHECK#1 |
| 15 |
if (obj.constructor !== Boolean) { |
| 16 |
$ERROR('#1: Object(expression) returns ToObject(expression)'); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK#1.1 |
| 20 |
if (typeof obj !== "object") { |
| 21 |
$ERROR('#1.1: Object(expression) returns ToObject(expression)'); |
| 22 |
} |
| 23 |
|
| 24 |
//CHECK#2 |
| 25 |
if (!(obj)) { |
| 26 |
$ERROR('#2: Object(expression) returns ToObject(expression)'); |
| 27 |
} |
| 28 |
|
| 29 |
//CHECK#3 |
| 30 |
if (obj === true) { |
| 31 |
$ERROR('#3: Object(expression) returns ToObject(expression)'); |
| 32 |
} |