1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch13/13.2/S13.2.2_A7_T2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * When the [[Construct]] property for a Function object F is called: 1.9 + * A new native ECMAScript object is created. 1.10 + * Invoke the [[Call]] property of F, providing just created native ECMAScript object as the this value and providing the argument 1.11 + * list passed into [[Construct]] as the argument values. 1.12 + * If Type( [[Call]] returned) is an Object then return this just as obtained object 1.13 + * 1.14 + * @path ch13/13.2/S13.2.2_A7_T2.js 1.15 + * @description Declaring a "function as function __func (arg)" 1.16 + */ 1.17 + 1.18 +__FRST="one"; 1.19 +__SCND="two"; 1.20 + 1.21 +__func = function(arg1, arg2){ 1.22 + this.first=arg1; 1.23 + var __obj={second:arg2}; 1.24 + return __obj; 1.25 + 1.26 +}; 1.27 + 1.28 +__obj__ = new __func(__FRST, __SCND); 1.29 + 1.30 +////////////////////////////////////////////////////////////////////////////// 1.31 +//CHECK#1 1.32 +if (__obj__.first !== undefined) { 1.33 + $ERROR('#1: __obj__.first === undefined. Actual: __obj__.first==='+__obj__.first); 1.34 +} 1.35 +// 1.36 +////////////////////////////////////////////////////////////////////////////// 1.37 + 1.38 +////////////////////////////////////////////////////////////////////////////// 1.39 +//CHECK#2 1.40 +if (__obj__.second !== __SCND) { 1.41 + $ERROR('#2: __obj__.second === __SCND. Actual: __obj__.second ==='+__obj__.second); 1.42 +} 1.43 +// 1.44 +////////////////////////////////////////////////////////////////////////////// 1.45 +