S13.2.2_A15_T4.js (1547B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 When the [[Construct]] property for a Function object F is called, 7 and the object created in the function is returned, the object (declared with "this" within a function) will be strong and healthy 8 es5id: 13.2.2_A15_T4 9 description: > 10 Function declared at the end of the program and "obj" property is 11 declared with "obj = {}" 12 ---*/ 13 14 var __FACTORY, __obj, obj; 15 16 __FACTORY = function(){ 17 this.prop = 1; 18 obj = {}; 19 obj.prop = "A"; 20 obj.slot = this; 21 return obj; 22 } 23 24 __obj = new __FACTORY(); 25 26 ////////////////////////////////////////////////////////////////////////////// 27 //CHECK#1 28 if (obj.prop !== "A") { 29 throw new Test262Error('#1: obj.prop === "A". Actual: obj.prop ==='+obj.prop); 30 } 31 // 32 ////////////////////////////////////////////////////////////////////////////// 33 34 ////////////////////////////////////////////////////////////////////////////// 35 //CHECK#2 36 if (__obj.prop !== "A") { 37 throw new Test262Error('#2: __obj.prop === "A". Actual: __obj.prop ==='+obj.prop); 38 } 39 // 40 ////////////////////////////////////////////////////////////////////////////// 41 42 ////////////////////////////////////////////////////////////////////////////// 43 //CHECK#3 44 if (__obj.slot.prop !==1) { 45 throw new Test262Error('#3: __obj.slot.prop ===1. Actual: __obj.slot.prop ==='+obj.slot.prop); 46 } 47 // 48 ////////////////////////////////////////////////////////////////////////////// 49 50 reportCompare(0, 0);