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.7_String.prototype.indexOf/S15.5.4.7_A3_T1.js')
1 files changed, 17 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.7_String.prototype.indexOf/S15.5.4.7_A3_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.7_String.prototype.indexOf/S15.5.4.7_A3_T1.js new file mode 100644 index 000000000..acd90d408 --- /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.7_String.prototype.indexOf/S15.5.4.7_A3_T1.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.7_A3_T1; +* @section: 15.5.4.7; +* @assertion: Since we deal with max(ToInteger(pos), 0) if ToInteger(pos) less than 0 indexOf(searchString,0) returns; +* @description: Call "$$abcdabcd".indexOf("ab",NaN) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("$$abcdabcd".indexOf("ab",NaN)!==2) { + $ERROR('#1: "$$abcdabcd".indexOf("ab",NaN)===2. Actual: '+("$$abcdabcd".indexOf("ab",NaN))); +} +// +////////////////////////////////////////////////////////////////////////////// |