diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply')
50 files changed, 1048 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A10.js new file mode 100644 index 000000000..86fa9ad92 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A10.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A10; +* @section: 15.3.4.3; +* @assertion: The Function.prototype.apply.length property has the attribute ReadOnly; +* @description: Checking if varying the Function.prototype.apply.length property fails; +*/ + +//CHECK#1 +if (!(Function.prototype.apply.hasOwnProperty('length'))) { + $FAIL('#1: the Function.prototype.apply has length property.'); +} + +var obj = Function.prototype.apply.length; + +Function.prototype.apply.length = function(){return "shifted";}; + +//CHECK#2 +if (Function.prototype.apply.length !== obj) { + $ERROR('#2: the Function.prototype.apply length property has the attributes ReadOnly.'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A11.js new file mode 100644 index 000000000..18664ef07 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A11.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A11; +* @section: 15.3.4.3; +* @assertion: The Function.prototype.apply.length property has the attribute DontEnum; +* @description: TChecking if enumerating the Function.prototype.apply.length property fails; +*/ + +//CHECK#0 +if (!(Function.prototype.apply.hasOwnProperty('length'))) { + $FAIL('#0: the Function.prototype.apply has length property.'); +} + + +// CHECK#1 +if (Function.prototype.apply.propertyIsEnumerable('length')) { + $ERROR('#1: the Function.prototype.apply.length property has the attributes DontEnum'); +} + +// CHECK#2 +for (var p in Function.prototype.apply){ + if (p==="length") + $ERROR('#2: the Function.prototype.apply.length property has the attributes DontEnum'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A12.js new file mode 100644 index 000000000..3be50be81 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A12.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A12; +* @section: 15.3.4.3, 13.2; +* @assertion: Function.prototype.apply has not prototype property; +* @description: Checking if obtaining the prototype property of Function.prototype.apply fails; +*/ + +//CHECK#1 +if (Function.prototype.apply.prototype !== undefined) { + $ERROR('#1: Function.prototype.apply has not prototype property'+Function.prototype.apply.prototype); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js new file mode 100644 index 000000000..01196f9a0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js @@ -0,0 +1,11 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A13; +* @section: 15.3.4.3; +* @assertion: If IsCallable(func) is false, then throw a TypeError exception. +* @negative TypeError; +*/ + +Function.prototype.apply.call(undefined, {}, []); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js new file mode 100644 index 000000000..c756e4c41 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js @@ -0,0 +1,11 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A14; +* @section: 15.3.4.3; +* @assertion: If IsCallable(func) is false, then throw a TypeError exception. +* @negative TypeError; +*/ + +Function.prototype.apply.call(null, {}, []); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js new file mode 100644 index 000000000..339d44689 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js @@ -0,0 +1,11 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A15; +* @section: 15.3.4.3; +* @assertion: If IsCallable(func) is false, then throw a TypeError exception. +* @negative TypeError; +*/ + +Function.prototype.apply.call({}, {}, []); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js new file mode 100644 index 000000000..08425ed70 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js @@ -0,0 +1,27 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A16; +* @section: 15.3.4.3; +* @assertion: If IsCallable(func) is false, then throw a TypeError exception. +* @description: A RegExp is not a function, but it may be +* callable. Iff it is, it's typeof should be 'function', +* in which case apply should accept it as a valid this +* value. +*/ + +var re = (/x/); +if (typeof re === 'function') { + Function.prototype.apply.call(re, undefined, ['x']); +} else { + try { + Function.prototype.bind.call(re, undefined); + $FAIL('#1: If IsCallable(func) is false, ' + + 'then (bind should) throw a TypeError exception'); + } catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1: TypeError expected. Actual: ' + e); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T1.js new file mode 100644 index 000000000..d3dc9e0cc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T1.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A1_T1; +* @section: 15.3.4.3; +* @assertion: The apply method performs a function call using the [[Call]] property of the object. If the object does not have a [[Call]] property, a TypeError exception is thrown; +* @description: Calling "apply" method of the object that does not have a [[Call]] property. +* Prototype of the object is Function(); +*/ + +var proto=Function(); + +function FACTORY(){}; + +FACTORY.prototype=proto; + +var obj = new FACTORY; + +//CHECK#1 +if (typeof obj.apply !== "function") { + $ERROR('#1: apply method accessed'); +} + +//CHECK#2 +try { + obj.apply(); + $FAIL('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T2.js new file mode 100644 index 000000000..04ea48b62 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A1_T2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A1_T2; +* @section: 15.3.4.3; +* @assertion: The apply method performs a function call using the [[Call]] property of the object. If the object does not have a [[Call]] property, a TypeError exception is thrown; +* @description: Calling "apply" method of the object that does not have a [[Call]] property. +* Prototype of the object is Function.prototype; +*/ + +function FACTORY(){}; + +FACTORY.prototype=Function.prototype; + +var obj = new FACTORY; + +//CHECK#1 +if (typeof obj.apply !== "function") { + $ERROR('#1: apply method accessed'); +} + +//CHECK#2 +try { + obj.apply(); + $FAIL('#2: If the object does not have a [[Call]] property, a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: If the object does not have a [[Call]] property, a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T1.js new file mode 100644 index 000000000..e7d375f3f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T1.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A2_T1; +* @section: 15.3.4.3; +* @assertion: The length property of the apply method is 2; +* @description: Checking Function.prototype.apply.length; +*/ + +//CHECK#1 +if (typeof Function.prototype.apply !== "function") { + $ERROR('#1: apply method defined'); +} + +//CHECK#2 +if (typeof Function.prototype.apply.length === "undefined") { + $ERROR('#2: length property of apply method defined'); +} + +//CHECK#3 +if (Function.prototype.apply.length !== 2) { + $ERROR('#3: The length property of the apply method is 2'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T2.js new file mode 100644 index 000000000..4ccc10353 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A2_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A2_T2; +* @section: 15.3.4.3; +* @assertion: The length property of the apply method is 2; +* @description: Checking f.apply.length, where f is new Function; +*/ + +var f=new Function; + +//CHECK#1 +if (typeof f.apply !== "function") { + $ERROR('#1: apply method accessed'); +} + +//CHECK#2 +if (typeof f.apply.length === "undefined") { + $ERROR('#2: length property of apply method defined'); +} + +//CHECK#3 +if (f.apply.length !== 2) { + $ERROR('#3: The length property of the apply method is 2'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T1.js new file mode 100644 index 000000000..194aee792 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T1.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T1; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Not any arguments at apply function; +*/ + +Function("this.field=\"strawberry\"").apply(); + +//CHECK#1 +if (this["field"] !== "strawberry") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T10.js new file mode 100644 index 000000000..ee53b6bf9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T10.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T10; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Checking by using eval, no any arguments at apply function; +*/ + +eval(" (function(){this.feat=1}).apply()"); + +//CHECK#1 +if (this["feat"] !== 1) { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T2.js new file mode 100644 index 000000000..2f4f0ebb8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T2.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T2; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is null; +*/ + +Function("this.field=\"green\"").apply(null); + +//CHECK#1 +if (this["field"] !== "green") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T3.js new file mode 100644 index 000000000..e13458a89 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T3.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T3; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is void 0; +*/ + +Function("this.field=\"battle\"").apply(void 0); + +//CHECK#1 +if (this["field"] !== "battle") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T4.js new file mode 100644 index 000000000..8bb939e0b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T4.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T4; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is undefined; +*/ + +Function("this.field=\"oil\"").apply(undefined); + +//CHECK#1 +if (this["field"] !== "oil") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T5.js new file mode 100644 index 000000000..dd4f08dff --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T5.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T5; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: No any arguments at apply function and it called inside function declaration; +*/ + +function FACTORY(){ + Function("this.feat=\"in da haus\"").apply(); +}; + +var obj = new FACTORY; + +//CHECK#1 +if (this["feat"] !== "in da haus") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} + +//CHECK#2 +if (typeof obj.feat !== "undefined") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T6.js new file mode 100644 index 000000000..913903275 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T6.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T6; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is null and it called inside function declaration; +*/ + +function FACTORY(){ + (function(){this.feat="kamon beyba"}).apply(null); +}; + +var obj = new FACTORY; + +//CHECK#1 +if (this["feat"] !== "kamon beyba") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} + +//CHECK#2 +if (typeof obj.feat !== "undefined") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T7.js new file mode 100644 index 000000000..a7b469040 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T7.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T7; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is void 0 and it called inside function declaration; +*/ + +(function FACTORY(){ + Function("this.feat=\"in da haus\"").apply(void 0); +})(); + + +//CHECK#1 +if (this["feat"] !== "in da haus") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T8.js new file mode 100644 index 000000000..89e2627b7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T8.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T8; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Argument at apply function is undefined and it called inside function declaration; +*/ + +(function FACTORY(){ + (function(){this.feat="kamon beyba"}).apply(undefined); +})(); + +//CHECK#1 +if (this["feat"] !== "kamon beyba") { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T9.js new file mode 100644 index 000000000..dce9397a1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A3_T9.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A3_T9; +* @section: 15.3.4.3; +* @assertion: If thisArg is null or undefined, the called function is passed the global object as the this value; +* @description: Checking by using eval, argument at apply function is void 0; +*/ + +eval( " Function(\"this.feat=1\").apply(void 0) " ); + +//CHECK#1 +if (this["feat"] !== 1) { + $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T1.js new file mode 100644 index 000000000..b20620174 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T1; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is number; +*/ + +var obj=1; + +var retobj = Function("this.touched= true; return this;").apply(obj); + +//CHECK#1 +if (typeof obj.touched !== "undefined") { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + +//CHECK#2 +if (!(retobj["touched"])) { + $ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +}
\ No newline at end of file diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T2.js new file mode 100644 index 000000000..d7e191f5d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T2; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is boolean true; +*/ + +var obj=true; + +var retobj = new Function("this.touched= true; return this;").apply(obj); + +//CHECK#1 +if (typeof obj.touched !== "undefined") { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + +//CHECK#2 +if (!(retobj["touched"])) { + $ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T3.js new file mode 100644 index 000000000..27c08ff88 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T3.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T3; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is string; +*/ + +var obj="soap"; + +var retobj = ( function(){this.touched= true; return this;} ).apply(obj); + +//CHECK#1 +if (typeof obj.touched !== "undefined") { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + +//CHECK#2 +if (!(retobj["touched"])) { + $ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T4.js new file mode 100644 index 000000000..e01212846 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T4.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T4; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is function variable that return this; +*/ + +f = function(){this.touched= true; return this;}; + +retobj = f.apply(obj); + +//CHECK#1 +if (typeof obj !== "undefined") { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + +//CHECK#2 +if (!(retobj["touched"])) { + $ERROR('#2: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + +var obj; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T5.js new file mode 100644 index 000000000..235a3d489 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T5.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T5; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is function variable; +*/ + +var f = function(){this.touched= true;}; + +var obj={}; + +f.apply(obj); + +//CHECK#1 +if (!(obj.touched)) { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T6.js new file mode 100644 index 000000000..ca64419b2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T6.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T6; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is new String(); +*/ + +var obj=new String("soap"); + +( function(){this.touched= true;}).apply(obj); + +//CHECK#1 +if (!(obj.touched)) { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T7.js new file mode 100644 index 000000000..96a28fb31 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T7.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T7; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is new Number(); +*/ + +var obj=new Number(1); + +Function("this.touched= true;").apply(obj); + +//CHECK#1 +if (!(obj.touched)) { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T8.js new file mode 100644 index 000000000..d3a814f81 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A5_T8.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A5_T8; +* @section: 15.3.4.3; +* @assertion: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value; +* @description: thisArg is Function(); +*/ + +var obj=Function(); + +new Function("this.touched= true; return this;").apply(obj); + +//CHECK#1 +if (!(obj.touched)) { + $ERROR('#1: If thisArg is not null(defined) the called function is passed ToObject(thisArg) as the this value'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T1.js new file mode 100644 index 000000000..66123546d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A6_T1; +* @section: 15.3.4.3; +* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown; +* @description: argArray is (1,{}); +*/ + +//CHECK#1 +try { + Function().apply(1,{}); + $FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T2.js new file mode 100644 index 000000000..88ed4a692 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T2.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A6_T2; +* @section: 15.3.4.3; +* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown; +* @description: argArray is (null,1); +*/ + +//CHECK#1 +try { + Function().apply(null,1); + $FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T3.js new file mode 100644 index 000000000..9049ae414 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A6_T3; +* @section: 15.3.4.3; +* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown; +* @description: argArray is (object,"1,3,4"); +*/ + +obj={}; + +//CHECK#1 +try { + Function().apply(obj,"1,3,4"); + $FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T4.js new file mode 100644 index 000000000..3fbb53935 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A6_T4.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A6_T4; +* @section: 15.3.4.3; +* @assertion: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown; +* @description: argArray is (this,function(){return arguments;}); +*/ + +//CHECK#1 +try { + Function().apply(this,function(){return arguments;}); + $FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T1.js new file mode 100644 index 000000000..a83bfce0a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T1.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T1; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (null,[1]); +*/ + +Function("a1,a2,a3","this.shifted=a1;").apply(null,[1]); + +//CHECK#1 +if (this["shifted"] !== 1) { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T10.js new file mode 100644 index 000000000..11ffe978c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T10.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T10; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (empty object, arguments), inside function call without declaration used; +*/ + +var obj={}; + +(function (){ + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(obj,arguments); +})("",4,2); + +//CHECK#1 +if (obj["shifted"] !== "42") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (typeof this["shifted"] !== "undefined") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T2.js new file mode 100644 index 000000000..72ab307d2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T2.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T2; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (null,[1,2,3]); +*/ + +new Function("a1,a2","a3","this.shifted=a2;").apply(null,[1,2,3]); + +//CHECK#1 +if (this["shifted"] !== 2) { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T3.js new file mode 100644 index 000000000..93afc2b0e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T3; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (empty object, new Array("nine","inch","nails")); +*/ + +i=0; + +p={toString:function(){return "a"+(++i);}}; + +obj={}; + +Function(p,"a2,a3","this.shifted=a1;").apply(obj, new Array("nine","inch","nails")); + +//CHECK#1 +if (obj["shifted"] !== "nine") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (typeof this["shifted"] !== "undefined") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T4.js new file mode 100644 index 000000000..a56aea8aa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T4; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (empty object, ( function(){return arguments;}) ("a","b","c")); +*/ + +i=0; + +p={toString:function(){return "a"+(++i);}}; + +obj={}; + +new Function(p,p,p, "this.shifted=a3;").apply( obj,( function(){return arguments;}) ("a","b","c") ); + +//CHECK#1 +if (obj["shifted"] !== "c") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (typeof this["shifted"] !== "undefined") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T5.js new file mode 100644 index 000000000..342599129 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T5; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (null, arguments), inside function declaration used; +*/ + +function FACTORY(){ + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(null,arguments); +} + +obj=new FACTORY("",1,2); + +//CHECK#1 +if (this["shifted"] !== "12") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (typeof obj.shifted !== "undefined") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T6.js new file mode 100644 index 000000000..cd3a45c81 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T6.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T6; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (this, arguments), inside function declaration used; +*/ + +function FACTORY(){ + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(this,arguments); +} + +obj=new FACTORY("",4,2); + +//CHECK#1 +if (obj["shifted"] !== "42") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (typeof this["shifted"] !== "undefined") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T7.js new file mode 100644 index 000000000..a129184dd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T7.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T7; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (null, arguments), inside function call without declaration used; +*/ + +(function (){ + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(null,arguments); +})("",1,2); + +//CHECK#1 +if (this["shifted"] !== "12") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T8.js new file mode 100644 index 000000000..58428b72d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T8.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T8; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (this, arguments), inside function call without declaration used; +*/ + +(function (){ + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(this,arguments); +})("",4,2); + +//CHECK#2 +if (this["shifted"] !== "42") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T9.js new file mode 100644 index 000000000..79dae88d8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A7_T9.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A7_T9; +* @section: 15.3.4.3; +* @assertion: If argArray is either an array or an arguments object, +* the function is passed the (ToUint32(argArray.length)) arguments argArray[0], argArray[1],...,argArray[ToUint32(argArray.length)-1]; +* @description: argArray is (empty object, arguments), inside function declaration used; +*/ + +function FACTORY(){ + var obj = {}; + Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(obj,arguments); + return obj; +} + +obj=new FACTORY("",1,2); + +//CHECK#1 +if (typeof this["shifted"] !== "undefined") { + $ERROR('#1: If argArray is either an array or an arguments object, the function is passed the...'); +} + +//CHECK#2 +if (obj.shifted !== "12") { + $ERROR('#2: If argArray is either an array or an arguments object, the function is passed the...'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T1.js new file mode 100644 index 000000000..4b2ec53e0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T1.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T1; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new Function.prototype.apply" fails; +*/ + +try { + obj = new Function.prototype.apply; + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T2.js new file mode 100644 index 000000000..cf6e5a42c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T2.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T2; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new Function.prototype.apply()" fails; +*/ + +try { + obj = new Function.prototype.apply(); + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T3.js new file mode 100644 index 000000000..d97d2c2d7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T3; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new Function.apply" fails; +*/ + +try { + obj = new Function.apply; + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T4.js new file mode 100644 index 000000000..51a17f8fe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T4.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T4; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new (Function("this.p1=1").apply)" fails; +*/ + +try { + obj = new (Function("this.p1=1").apply); + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T5.js new file mode 100644 index 000000000..37f65da29 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T5.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T5; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new Function("this.p1=1").apply" fails; +*/ + +try { + FACTORY = Function("this.p1=1").apply; + obj = new FACTORY(); + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T6.js new file mode 100644 index 000000000..a1838190e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A8_T6.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A8_T6; +* @section: 15.3.4.3; +* @assertion: Function.prototype.apply can`t be used as [[create]] caller; +* @description: Checking if creating "new (Function("function f(){this.p1=1;};return f").apply())" fails; +*/ + +//CHECK#1 +try { + obj = new (Function("function f(){this.p1=1;};return f").apply()); +} catch (e) { + $ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); +} + +//CHECK#2 +if (obj.p1!== 1) { + $ERROR('#2: Function.prototype.apply can\'t be used as [[create]] caller'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A9.js new file mode 100644 index 000000000..e5ce9fb89 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A9.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.3.4.3_A9; +* @section: 15.3.4.3; +* @assertion: The Function.prototype.apply.length property has the attribute DontDelete; +* @description: Checking if deleting the Function.prototype.apply.length property fails; +*/ + +//CHECK#0 +if (!(Function.prototype.apply.hasOwnProperty('length'))) { + $FAIL('#0: the Function.prototype.apply has length property'); +} + +//CHECK#1 +if (delete Function.prototype.apply.length) { + $ERROR('#1: The Function.prototype.apply.length property has the attributes DontDelete'); +} + +//CHECK#2 +if (!(Function.prototype.apply.hasOwnProperty('length'))) { + $FAIL('#2: The Function.prototype.apply.length property has the attributes DontDelete'); +} |