michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 15.js michael@0: ECMA Section: 15 Native ECMAScript Objects michael@0: Description: Every built-in prototype object has the Object prototype michael@0: object, which is the value of the expression michael@0: Object.prototype (15.2.3.1) as the value of its internal michael@0: [[Prototype]] property, except the Object prototype michael@0: object itself. michael@0: michael@0: Every native object associated with a program-created michael@0: function also has the Object prototype object as the michael@0: value of its internal [[Prototype]] property. michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 28 october 1997 michael@0: michael@0: */ michael@0: var SECTION = "15-1"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: var TITLE = "Native ECMAScript Objects"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: /* michael@0: new TestCase( SECTION, "Function.prototype.__proto__", Object.prototype, Function.prototype.__proto__ ); michael@0: new TestCase( SECTION, "Array.prototype.__proto__", Object.prototype, Array.prototype.__proto__ ); michael@0: new TestCase( SECTION, "String.prototype.__proto__", Object.prototype, String.prototype.__proto__ ); michael@0: new TestCase( SECTION, "Boolean.prototype.__proto__", Object.prototype, Boolean.prototype.__proto__ ); michael@0: new TestCase( SECTION, "Number.prototype.__proto__", Object.prototype, Number.prototype.__proto__ ); michael@0: // new TestCase( SECTION, "Math.prototype.__proto__", Object.prototype, Math.prototype.__proto__ ); michael@0: new TestCase( SECTION, "Date.prototype.__proto__", Object.prototype, Date.prototype.__proto__ ); michael@0: new TestCase( SECTION, "TestCase.prototype.__proto__", Object.prototype, TestCase.prototype.__proto__ ); michael@0: michael@0: new TestCase( SECTION, "MyObject.prototype.__proto__", Object.prototype, MyObject.prototype.__proto__ ); michael@0: */ michael@0: new TestCase( SECTION, "Function.prototype.__proto__ == Object.prototype", true, Function.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "Array.prototype.__proto__ == Object.prototype", true, Array.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "String.prototype.__proto__ == Object.prototype", true, String.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "Boolean.prototype.__proto__ == Object.prototype", true, Boolean.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype", true, Number.prototype.__proto__ == Object.prototype ); michael@0: // new TestCase( SECTION, "Math.prototype.__proto__ == Object.prototype", true, Math.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "Date.prototype.__proto__ == Object.prototype", true, Date.prototype.__proto__ == Object.prototype ); michael@0: new TestCase( SECTION, "TestCase.prototype.__proto__ == Object.prototype", true, TestCase.prototype.__proto__ == Object.prototype ); michael@0: michael@0: new TestCase( SECTION, "MyObject.prototype.__proto__ == Object.prototype", true, MyObject.prototype.__proto__ == Object.prototype ); michael@0: michael@0: michael@0: test(); michael@0: michael@0: michael@0: function MyObject( value ) { michael@0: this.value = value; michael@0: this.valueOf = new Function( "return this.value" ); michael@0: }