|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 /** |
|
8 File Name: 15.2.1.1.js |
|
9 ECMA Section: 15.2.1.1 The Object Constructor Called as a Function: |
|
10 Object(value) |
|
11 Description: When Object is called as a function rather than as a |
|
12 constructor, the following steps are taken: |
|
13 |
|
14 1. If value is null or undefined, create and return a |
|
15 new object with no properties other than internal |
|
16 properties exactly as if the object constructor |
|
17 had been called on that same value (15.2.2.1). |
|
18 2. Return ToObject (value), whose rules are: |
|
19 |
|
20 undefined generate a runtime error |
|
21 null generate a runtime error |
|
22 boolean create a new Boolean object whose default |
|
23 value is the value of the boolean. |
|
24 number Create a new Number object whose default |
|
25 value is the value of the number. |
|
26 string Create a new String object whose default |
|
27 value is the value of the string. |
|
28 object Return the input argument (no conversion). |
|
29 |
|
30 Author: christine@netscape.com |
|
31 Date: 17 july 1997 |
|
32 */ |
|
33 |
|
34 var SECTION = "15.2.1.1"; |
|
35 var VERSION = "ECMA_1"; |
|
36 startTest(); |
|
37 var TITLE = "Object( value )"; |
|
38 |
|
39 writeHeaderToLog( SECTION + " "+ TITLE); |
|
40 |
|
41 |
|
42 var NULL_OBJECT = Object(null); |
|
43 |
|
44 new TestCase( SECTION, "Object(null).__proto__", Object.prototype, (Object(null)).__proto__ ); |
|
45 |
|
46 new TestCase( SECTION, "Object(void 0).__proto__", Object.prototype, (Object(void 0)).__proto__ ); |
|
47 |
|
48 test(); |