js/src/tests/ecma/extensions/15.2.1.1.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial