2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: >
|
|
|
|
When the Object function is called with one argument value,
|
|
|
|
and the value neither is null nor undefined, and is supplied, return ToObject(value)
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.2.1.1_A2_T4
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Calling Object function with object argument value
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
var obj = {flag:true};
|
|
|
|
|
|
|
|
//CHECK#1
|
|
|
|
if (typeof(obj) !== 'object') {
|
2015-06-09 18:08:02 +02:00
|
|
|
$ERROR('#1: obj = {flag:true} should be an Object');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var n_obj = Object(obj);
|
|
|
|
|
|
|
|
//CHECK#2
|
|
|
|
if ((n_obj !== obj)||(!(n_obj['flag']))) {
|
|
|
|
$ERROR('#2: Object({flag:true}) returns ToObject({flag:true})');
|
|
|
|
}
|