michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * When the [[Construct]] property for a Function object F is called, michael@0: * and the object created in the function is returned, the object (declared with "this" within a function) will be strong and healthy michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A15_T1.js michael@0: * @description Function declared at the end of the program and "obj" property is declared with "var obj = {}" michael@0: */ michael@0: michael@0: var __obj = new __FACTORY(); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (typeof obj !== "undefined") { michael@0: $ERROR('#1: typeof obj === "undefined". Actual: typeof obj ==='+typeof obj); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__obj.prop !== "A") { michael@0: $ERROR('#2: __obj.prop === "A". Actual: __obj.prop ==='+__obj.prop); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (__obj.slot.prop !==1) { michael@0: $ERROR('#3: __obj.slot.prop ===1. Actual: __obj.slot.prop ==='+__obj.slot.prop); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: function __FACTORY(){ michael@0: this.prop = 1; michael@0: var obj = {}; michael@0: obj.prop = "A"; michael@0: obj.slot = this; michael@0: return obj; michael@0: } michael@0: