diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf')
23 files changed, 569 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A10.js new file mode 100644 index 000000000..d26b5f32a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A10.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.5.4.8_A10; +* @section: 15.5.4.8; +* @assertion: The String.prototype.lastIndexOf.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.lastIndexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.lastIndexOf.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.lastIndexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.lastIndexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.lastIndexOf.length; + +String.prototype.lastIndexOf.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.lastIndexOf.length !== __obj) { + $ERROR('#2: __obj = String.prototype.lastIndexOf.length; String.prototype.lastIndexOf.length = function(){return "shifted";}; String.prototype.lastIndexOf.length === __obj. Actual: '+String.prototype.lastIndexOf.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A11.js new file mode 100644 index 000000000..0861b86f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A11.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.5.4.8_A11; +* @section: 15.5.4.8; +* @assertion: The length property of the lastIndexOf method is 1; +* @description: Checking String.prototype.lastIndexOf.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.lastIndexOf.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.lastIndexOf.hasOwnProperty("length") return true. Actual: '+String.prototype.lastIndexOf.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.lastIndexOf.length !== 1) { + $ERROR('#2: String.prototype.lastIndexOf.length === 1. Actual: '+String.prototype.lastIndexOf.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T1.js new file mode 100644 index 000000000..36b70ebd2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T1.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.5.4.8_A1_T1; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +var __instance.lastIndexOf = String.prototype.lastIndexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.lastIndexOf(true, false) !== 0) { + $ERROR('#1: __instance = new Object(true); __instance.lastIndexOf = String.prototype.lastIndexOf; __instance.lastIndexOf(true, false) === 0. Actual: '+__instance.lastIndexOf(true, false) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T10.js new file mode 100644 index 000000000..11d97a5ca --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T10.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.5.4.8_A1_T10; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with object arguments; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __obj2 = {valueOf:function(){return NaN;}} +var __str = "ABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (lastIndexOf(__obj, __obj2) !== 7) { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041B";}}; var __obj2 = {valueOf:function(){return NaN;}}; var __str = "ABB\u0041BABAB";lastIndexOf(__obj, __obj2) === 7. Actual: '+lastIndexOf(__obj, __obj2) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T11.js new file mode 100644 index 000000000..a43325666 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T11.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.5.4.8_A1_T11; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Instance is Date(0) object; +*/ + +var __instance = new Date(100000000); + +__instance.lastIndexOf = String.prototype.lastIndexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((__instance.lastIndexOf('1970')) !== 11) { + $ERROR('#1: __instance = new Date(0); __instance.lastIndexOf = String.prototype.lastIndexOf; __instance.lastIndexOf(\'1970\') === 11. Actual: '+(__instance.lastIndexOf('1970')) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T12.js new file mode 100644 index 000000000..97f5ee7e6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T12.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.5.4.8_A1_T12; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Argument is string, and instance is array of strings; +*/ + +var __instance = new Array('new','zoo','revue'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.lastIndexOf('new') !== 0) { + $ERROR('#1: __instance = new Array(\'new\',\'zoo\',\'revue\'); __instance.lastIndexOf(\'new\') === 0. Actual: '+__instance.lastIndexOf('new') ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__instance.lastIndexOf('zoo') !== 1) { + $ERROR('#2: __instance = new Array(\'new\',\'zoo\',\'revue\'); __instance.lastIndexOf(\'zoo\') === 1. Actual: '+__instance.lastIndexOf('zoo') ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T2.js new file mode 100644 index 000000000..d4f21682e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T2.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.5.4.8_A1_T2; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Arguments are boolean equation, function and null, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.lastIndexOf = String.prototype.lastIndexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.lastIndexOf("A"!=="\u0041", function(){return 0;}(),null) !== 0) { + $ERROR('#1: __instance = new Boolean; __instance.lastIndexOf = String.prototype.lastIndexOf; __instance.lastIndexOf("A"!=="\\u0041", function(){return 0;}(),null) === 0. Actual: '+__instance.lastIndexOf("A"!=="\u0041", function(){return 0;}(),null) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3.js new file mode 100644 index 000000000..7d1bb15e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3.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.5.4.8_A1_T3; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Checking by using eval; +*/ + +var lastIndexOf = String.prototype.lastIndexOf; + +var __obj__pos = {valueOf:function(){return 7;}}; + +if (typeof toString === "undefined"){ + var toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (lastIndexOf(eval("\"[\""),__obj__pos)!= 0) { + $ERROR('#1: lastIndexOf(eval("\\"[\\""),__obj__pos)== 0. Actual: '+lastIndexOf(eval("\"[\""),__obj__pos)); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T4.js new file mode 100644 index 000000000..2821d05b8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_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.5.4.8_A1_T4; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function without arguments of string; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString() evaluates to "" lastIndexOf() evaluates to lastIndexOf("",0) +if ("".lastIndexOf() !== -1) { + $ERROR('#1: "".lastIndexOf() === -1. Actual: '+("".lastIndexOf()) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T5.js new file mode 100644 index 000000000..04653e1b0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T5.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.5.4.8_A1_T5; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" lastIndexOf(null) evaluates to lastIndexOf("",0) +if (function(){return "gnullunazzgnull"}().lastIndexOf(null) !== 11) { + $ERROR('#1: function(){return "gnullunazzgnull"}().lastIndexOf(null) === 11. Actual: '+function(){return "gnullunazzgnull"}().lastIndexOf(null) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T6.js new file mode 100644 index 000000000..c61a0aa65 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T6.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.5.4.8_A1_T6; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with x argument of new String object, where x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "" lastIndexOf(undefined) evaluates to lastIndexOf("",0) +if (new String("undefined").lastIndexOf(x) !== 0) { + $ERROR('#1: var x; new String("undefined").lastIndexOf(x) === 0. Actual: '+new String("undefined").lastIndexOf(x) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T7.js new file mode 100644 index 000000000..97ff9b544 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T7.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.5.4.8_A1_T7; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with undefined argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" lastIndexOf(undefined) evaluates to lastIndexOf("undefined",0) +if (String("undefined").lastIndexOf(undefined) !== 0) { + $ERROR('#1: String("undefined").lastIndexOf(undefined) === 0. Actual: '+String("undefined").lastIndexOf(undefined) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T8.js new file mode 100644 index 000000000..512c32d4a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_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.5.4.8_A1_T8; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with void 0 argument of string object; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(void 0) evaluates to "undefined" lastIndexOf(void 0) evaluates to lastIndexOf("undefined",0) +if (String(__obj).lastIndexOf(void 0) !== 0) { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).lastIndexOf(void 0) === 0. Actual: '+String(__obj).lastIndexOf(void 0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T9.js new file mode 100644 index 000000000..c20233dc4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T9.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.5.4.8_A1_T9; +* @section: 15.5.4.8; +* @assertion: String.prototype.lastIndexOf(searchString, position); +* @description: Call lastIndexOf(searchString, position) function with function(){}() argument of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" indexOf(undefined) evaluates to indexOf("undefined") +if (new String(__obj).lastIndexOf(function(){}()) !== 0) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).lastIndexOf(function(){}()) === 0. Actual: '+new String(__obj).lastIndexOf(function(){}()) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T1.js new file mode 100644 index 000000000..100314059 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T1.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.5.4.8_A4_T1; +* @section: 15.5.4.8; +* @assertion: when String.prototype.lastIndexOf(searchString, position) is called first Call ToString, giving it the this value as its argument. +* Then Call ToString(searchString) and Call ToNumber(position); +* @description: Override toString and valueOf functions, valueOf throw exception; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __obj2 = {valueOf:function(){throw "intointeger";}} +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = lastIndexOf(__obj, __obj2); + $FAIL('#1: var x = lastIndexOf(__obj, __obj2) lead to throwing exception'); + } catch (e) { + if (e!=="intointeger") { + $ERROR('#1.1: Exception === "intointeger". Actual: '+e); + } + } + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T2.js new file mode 100644 index 000000000..bbcba9e47 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T2.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.5.4.8_A4_T2; +* @section: 15.5.4.8; +* @assertion: when String.prototype.lastIndexOf(searchString, position) is called first Call ToString, giving it the this value as its argument. +* Then Call ToString(searchString) and Call ToNumber(position); +* @description: Override toString and valueOf functions, second toString throw exception; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __obj2 = {valueOf:function(){return {};},toString:function(){throw "intointeger";}} +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = lastIndexOf(__obj, __obj2); + $FAIL('#1: var x = lastIndexOf(__obj, __obj2) lead to throwing exception'); + } catch (e) { + if (e!=="intointeger") { + $ERROR('#1.1: Exception === "intointeger". Actual: '+e); + } + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T3.js new file mode 100644 index 000000000..491ef9d47 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_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.5.4.8_A4_T3; +* @section: 15.5.4.8; +* @assertion: when String.prototype.lastIndexOf(searchString, position) is called first Call ToString, giving it the this value as its argument. +* Then Call ToString(searchString) and Call ToNumber(position); +* @description: Override toString and valueOf functions; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __obj2 = {valueOf:function(){return {};},toString:function(){}} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB".lastIndexOf(__obj, __obj2)!==7) { + $ERROR('#1: var __obj = {toString:function(){return "\u0041B";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){}}; "ABB\\u0041BABAB".lastIndexOf(__obj, __obj2)===7. Actual: '+("ABB\u0041BABAB".lastIndexOf(__obj, __obj2))); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T4.js new file mode 100644 index 000000000..86e1e4220 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T4.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.8_A4_T4; +* @section: 15.5.4.8; +* @assertion: when String.prototype.lastIndexOf(searchString, position) is called first Call ToString, giving it the this value as its argument. +* Then Call ToString(searchString) and Call ToNumber(position); +* @description: Override toString and valueOf functions, and they throw exceptions; +*/ + +var __obj = {toString:function(){throw "intostr";}}; +var __obj2 = {valueOf:function(){throw "intoint";}}; +var __instance = new Number(10001.10001); +Number.prototype.lastIndexOf=String.prototype.lastIndexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__instance){ + try { + var x = lastIndexOf(__obj, __obj2); + $FAIL('#1: var x = lastIndexOf(__obj, __obj2) lead to throwing exception'); + } catch (e) { + if (e!=="intostr") { + $ERROR('#1.1: Exception === "intostr". Actual: '+e); + } + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T5.js new file mode 100644 index 000000000..76234fd07 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A4_T5.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.8_A4_T5; +* @section: 15.5.4.8; +* @assertion: when String.prototype.lastIndexOf(searchString, position) is called first Call ToString, giving it the this value as its argument. +* Then Call ToString(searchString) and Call ToNumber(position); +* @description: Override toString and valueOf functions, first and second valueOf throw exception; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}}; + +var __obj2 = {valueOf:function(){throw "intointeger";}}; + +__FACTORY.prototype.lastIndexOf = String.prototype.lastIndexOf; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __instance.lastIndexOf(__obj, __obj2); + $FAIL('#1: var x = __instance.lastIndexOf(__obj, __obj2) lead to throwing exception'); +} catch (e) { + if (e!=="intostr") { + $ERROR('#1.1: Exception === "intostr". Actual: '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +function __FACTORY( value ) { + this.value = value; + this.toString = function() { return new Number; }; + this.valueOf=function(){return this.value+""}; +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A6.js new file mode 100644 index 000000000..43d7ffe84 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A6.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.8_A6; +* @section: 15.5.4.8, 13.2; +* @assertion: String.prototype.lastIndexOf has not prototype property; +* @description: Checking String.prototype.lastIndexOf.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.lastIndexOf.prototype !== undefined) { + $ERROR('#1: String.prototype.lastIndexOf.prototype === undefined. Actual: '+String.prototype.lastIndexOf.prototype ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A7.js new file mode 100644 index 000000000..20cd8158a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A7.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.5.4.8_A7; +* @section: 15.5.4.8, 13.2; +* @assertion: String.prototype.lastIndexOf can't be used as constructor; +* @description: Checking if creating the String.prototype.lastIndexOf object fails; +*/ + +var __FACTORY = String.prototype.lastIndexOf; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.lastIndexOf; __instance = new __FACTORY lead to throwing exception'); +} catch (e) { + $PRINT(e); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A8.js new file mode 100644 index 000000000..6bf4831bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A8.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.8_A8; +* @section: 15.5.4.8; +* @assertion: The String.prototype.lastIndexOf.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.lastIndexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.lastIndexOf.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.lastIndexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.lastIndexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.lastIndexOf.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.lastIndexOf.propertyIsEnumerable(\'length\') return false. Actual: '+String.prototype.lastIndexOf.propertyIsEnumerable('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +count=0; + +for (p in String.prototype.lastIndexOf){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.lastIndexOf){if (p==="length") count++;}; count === 0. Actual: '+count ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A9.js new file mode 100644 index 000000000..6b017ff1c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A9.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.5.4.8_A9; +* @section: 15.5.4.8; +* @assertion: The String.prototype.lastIndexOf.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.lastIndexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.lastIndexOf.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.lastIndexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.lastIndexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.lastIndexOf.length) { + $ERROR('#1: delete String.prototype.lastIndexOf.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.lastIndexOf.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.lastIndexOf.length; String.prototype.lastIndexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.lastIndexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// |