diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects')
583 files changed, 17357 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T1.js new file mode 100644 index 000000000..98193f0c8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T1.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.1.1_A1_T1; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(function(){}()); +*/ + +var __str = String(function(){}()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(function(){}()); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "undefined") { + $ERROR('#2: __str = String(function(){}()); __str === "undefined". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T10.js new file mode 100644 index 000000000..10dd44847 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T10.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T10; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(1) and String(-1); +*/ + +var __str = String(1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(1); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "1") { + $ERROR('#2: __str = String(1); __str === "1". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(-1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(-1); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "-1") { + $ERROR('#4: __str = String(-1); __str === "-1". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T11.js new file mode 100644 index 000000000..31ec71107 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T11.js @@ -0,0 +1,117 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T11; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(1/0) and String(-1/0), and call with +/-Infinity; +*/ + +var __str = String(1/0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(1/0); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "Infinity") { + $ERROR('#2: __str = String(1/0); __str === "Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(-1/0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(-1/0); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "-Infinity") { + $ERROR('#4: __str = String(-1/0); __str === "-Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Infinity); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "string") { + $ERROR('#5: __str = String(Infinity); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !== "Infinity") { + $ERROR('#6: __str = String(Infinity); __str === "Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(-Infinity); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (typeof __str !== "string") { + $ERROR('#7: __str = String(-Infinity); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#8 +if (__str !== "-Infinity") { + $ERROR('#8: __str = String(-Infinity); __str === "-Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Number.POSITIVE_INFINITY); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#9 +if (typeof __str !== "string") { + $ERROR('#9: __str = String(Number.POSITIVE_INFINITY); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#10 +if (__str !== "Infinity") { + $ERROR('#10: __str = String(Number.POSITIVE_INFINITY); __str === "Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Number.NEGATIVE_INFINITY); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#11 +if (typeof __str !== "string") { + $ERROR('#11: __str = String(Number.NEGATIVE_INFINITY); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#12 +if (__str !== "-Infinity") { + $ERROR('#12: __str = String(Number.NEGATIVE_INFINITY); __str === "-Infinity". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T12.js new file mode 100644 index 000000000..518a502c1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T12.js @@ -0,0 +1,63 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T12; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(1/"a"), String("b"* null) and String(Number.NaN); +*/ + +var __str = String(1/"a"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(1/"a"); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "NaN") { + $ERROR('#2: __str = String(1/"a"); __str === "NaN". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String("b"*null); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String("b"*null); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "NaN") { + $ERROR('#4: __str = String("b"*null); __str === "NaN". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Number.NaN); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "string") { + $ERROR('#5: __str = String(Number.NaN); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !== "NaN") { + $ERROR('#6: __str = String(Number.NaN); __str === "NaN". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T13.js new file mode 100644 index 000000000..26212fbaf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T13.js @@ -0,0 +1,81 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T13; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(true) and String(false); +*/ + +var __str = String(true); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(true); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "true") { + $ERROR('#2: __str = String(true); __str === "true". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(false); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(false); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "false") { + $ERROR('#4: __str = String(false); __str === "false". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Boolean(true)); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "string") { + $ERROR('#5: __str = String(Boolean(true)); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !== "true") { + $ERROR('#6: __str = String(Boolean(true)); __str === "true". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(Boolean(false)); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (typeof __str !== "string") { + $ERROR('#7: __str = String(Boolean(false)); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#8 +if (__str !== "false") { + $ERROR('#8: __str = String(Boolean(false)); __str === "false". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T14.js new file mode 100644 index 000000000..425cf26b3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T14.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T14; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(0) and String(-0); +*/ + +var __str = String(0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(0); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "0") { + $ERROR('#2: __str = String(0); __str === "0". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(-0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(-0); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "0") { + $ERROR('#4: __str = String(-0); __str === "0". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T15.js new file mode 100644 index 000000000..2177bcd39 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T15.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.1.1_A1_T15; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(string_object); +*/ + +var __obj__str = "caps"; + +//__obj__str.prop=1; + +var __str = String(__obj__str); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str !== __obj__str) { + $ERROR('#1: __obj__str = "caps"; __str = String(__obj__str); __str === __obj__str. Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T16.js new file mode 100644 index 000000000..2bd59a610 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T16.js @@ -0,0 +1,81 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T16; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String() with .12345 and analogous numbers; +*/ + +var __str = String(.12345); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(.12345); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "0.12345") { + $ERROR('#2: __str = String(.12345); __str === "0.12345". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(.012345); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(.012345); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "0.012345") { + $ERROR('#4: __str = String(.012345); __str === "0.012345". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(.0012345); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "string") { + $ERROR('#5: __str = String(.0012345); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !== "0.0012345") { + $ERROR('#6: __str = String(.0012345); __str === "0.0012345". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(.00000012345); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (typeof __str !== "string") { + $ERROR('#7: __str = String(.00000012345); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#8 +if (__str !== "1.2345e-7") { + $ERROR('#8: __str = String(.00000012345); __str === "1.2345e-7". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T17.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T17.js new file mode 100644 index 000000000..e5d9328e7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T17.js @@ -0,0 +1,63 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T17; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String() with numbers that have more than 1 significant digit after point; +*/ + +var __str = String(1.2345); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(1.2345); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "1.2345") { + $ERROR('#2: __str = String(1.2345); __str === "1.2345". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(1.234567890); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(1.234567890); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "1.23456789") { + $ERROR('#4: __str = String(1.234567890); __str === "1.23456789". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(1.234500000000000000000000000); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "string") { + $ERROR('#5: __str = String(1.234500000000000000000000000); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !== "1.2345") { + $ERROR('#6: __str = String(1.234500000000000000000000000); __str === "1.2345". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T18.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T18.js new file mode 100644 index 000000000..2389cca51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T18.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T18; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String() with numbers that have more than 1 significant digit; +*/ + +__str = String(1000000000000000000000); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(1000000000000000000000); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "1e+21") { + $ERROR('#2: __str = String(1000000000000000000000); __str === "1e+21". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = String(10000000000000000000000); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "string") { + $ERROR('#3: __str = String(10000000000000000000000); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !== "1e+22") { + $ERROR('#4: __str = String(10000000000000000000000); __str === "1e+22". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T19.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T19.js new file mode 100644 index 000000000..7120ebe61 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T19.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.1.1_A1_T19; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String() with Array of numbers; +*/ + +var __str = String(new Array(1,2,3)); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(new Array(1,2,3)); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "1,2,3") { + $ERROR('#2: __str = String(new Array(1,2,3)); __str === "1,2,3". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T2.js new file mode 100644 index 000000000..632fa7588 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T2.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.1.1_A1_T2; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(null); +*/ + +var __str = String(null); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(null); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "null") { + $ERROR('#2: __str = String(null); __str === "null". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T3.js new file mode 100644 index 000000000..b551eac5f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_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.1.1_A1_T3; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(void 0); +*/ + +var __str = String(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(void 0); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "undefined") { + $ERROR('#2: __str = String(void 0); __str === "undefined". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T4.js new file mode 100644 index 000000000..506d88f2b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T4.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.1.1_A1_T4; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(undefined); +*/ + +var __str = String(undefined); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(undefined); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "undefined") { + $ERROR('#2: __str = String(undefined); __str === "undefined". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T5.js new file mode 100644 index 000000000..f48ba047f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T5.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.1.1_A1_T5; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(x), where x is undefined variable; +*/ + +var __str = String(x); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: var x; __str = String(x); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "undefined") { + $ERROR('#2: var x; __str = String(x); __str === "undefined". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T6.js new file mode 100644 index 000000000..21891c51f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_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.5.1.1_A1_T6; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Checking by using eval, Call String(eval());; +*/ + +var __str = String(eval()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(eval()); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "undefined") { + $ERROR('#2: __str = String(eval()); __str === "undefined". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T7.js new file mode 100644 index 000000000..718febdfc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T7.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.1.1_A1_T7; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String({}); +*/ + +var __str = String({}); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String({}); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "[object "+"Object"+"]") { + $ERROR('#2: __str = String({}); __str === "[object Object]". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T8.js new file mode 100644 index 000000000..89d60dafe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T8.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.1.1_A1_T8; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(new Array); +*/ + +var __old__Array__prototype__toString = Array.prototype.toString; + +Array.prototype.toString=function(){return "__ARRAY__";}; + +var __str = String(new Array); + +// restore old toString method just in case +Array.prototype.toString=__old__Array__prototype__toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(new Array); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "__ARRAY__") { + $ERROR('#2: Array.prototype.toString=function(){return "__ARRAY__";}; __str = String(new Array); __str === "__ARRAY__". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_T9.js new file mode 100644 index 000000000..b5678969a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A1_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.5.1.1_A1_T9; +* @section: 15.5.1.1; +* @assertion: When String is called as a function rather than as a constructor, it performs a type conversion; +* @description: Call String(this); +*/ + +var toString=function(){return "__THIS__";}; + +var __str = String(this); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(this); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "__THIS__") { + $ERROR('#2: toString=function(){return "__THIS__";}; __str = String(this); __str === "__THIS__". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A2_T1.js new file mode 100644 index 000000000..0b1033ca9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.1_The_String_Constructor_Called_as_a_Function/S15.5.1.1_A2_T1.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.1.1_A2_T1; +* @section: 15.5.1.1; +* @assertion: If value is not supplied, the empty string "" is returned; +* @description: Call String(); +*/ + +var __str = String(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "string") { + $ERROR('#1: __str = String(); typeof __str === "string". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !== "") { + $ERROR('#2: __str = String(); __str === "". Actual: __str ==='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T1.js new file mode 100644 index 000000000..be97738ae --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T1; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with expression "new String"; +*/ + +var __str = new String; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String; typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String; __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str != "") { + $ERROR('#2: __str = new String; __str == "". Actual: __str =='+__str); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ( __str === "") { + $ERROR('#3: __str = new String; __str !== ""'); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T10.js new file mode 100644 index 000000000..53b9f8fc8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T10.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T10; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function object)" as the function object's prototype.toString property was changed; +*/ + +function __FACTORY(){}; + +__FACTORY.prototype.toString=function(){return "tostr"}; + +var __obj = new __FACTORY; + +var __str = new String(__obj); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(__obj); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(__obj); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str != "tostr") { + $ERROR('#2: __str = new String(__obj); __str =="tostr". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T11.js new file mode 100644 index 000000000..64b25437a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T11.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T11; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function object)" after changing function object's valueOf and toString properties; +*/ + +function __obj(){}; + +__obj.valueOf=function(){return true;}; + +__obj.toString=function(){return {};}; + +var __str = new String(__obj); + + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: function __obj(){}; __str = new String(__obj); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(__obj); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="true") { + $ERROR('#2: function __obj(){}; __str = new String(__obj); __str =="true". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T12.js new file mode 100644 index 000000000..480fd2d61 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T12.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.2.1_A1_T12; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function object)", after changing the function object toString property, which causes exception throw; +*/ + +var __obj = {toString:function(){throw "intostr"}}; + +__obj.valueOf=function(){return true}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var __str = new String(__obj); + $ERROR('#1: var __obj = {toString:function(){throw "intostr"}}; __str = new String(__obj) lead throwing exception'); +} catch (e) { + if (e!=="intostr") { + $ERROR('#1.1: e==="intostr". Actual: e==='+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T13.js new file mode 100644 index 000000000..986c24bb5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T13.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.2.1_A1_T13; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function object)" after changing function object's valueOf property, which causes exception throw; +*/ + +var __obj = {toString:function(){return f; function f(){}}}; + +__obj.valueOf=function(){throw "invalueof"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var __str = new String(__obj); + $ERROR('#1: __obj.valueOf=function(){throw "invalueof"}; __str = new String(__obj) lead throwing exception'); +} catch (e) { + if (e!=="invalueof") { + $ERROR('#1.1: e==="invalueof". Actual: e==='+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T16.js new file mode 100644 index 000000000..96780715b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T16.js @@ -0,0 +1,110 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T16; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String()" initialized with .12345 and other numbers; +*/ + +__str =new String(.12345); +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str =new String(.12345); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str =new String(.12345); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="0.12345") { + $ERROR('#2: __str =new String(.12345); __str =="0.12345". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str =new String(.012345); +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "object") { + $ERROR('#3: __str =new String(.012345); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2.5 +if (__str.constructor !== String) { + $ERROR('#3.5: __str =new String(.012345); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !="0.012345") { + $ERROR('#4: __str =new String(.012345); __str =="0.012345". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str =new String(.0012345); +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "object") { + $ERROR('#5: __str =new String(.0012345); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5.5 +if (__str.constructor !== String) { + $ERROR('#5.5: __str =new String(.0012345); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !="0.0012345") { + $ERROR('#6: __str =new String(.0012345); __str =="0.0012345". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str =new String(.00000012345); +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (typeof __str !== "object") { + $ERROR('#7: __str =new String(.00000012345); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7.5 +if (__str.constructor !== String) { + $ERROR('#7.5: __str =new String(.00000012345); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#8 +if (__str !="1.2345e-7") { + $ERROR('#8: __str =new String(.00000012345); __str =="1.2345e-7". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T17.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T17.js new file mode 100644 index 000000000..444dbd5c3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T17.js @@ -0,0 +1,85 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T17; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String()" initialized with numbers that have more than 1 significant digit following the point; +*/ + +var __str = new String(1.2345); +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(1.2345); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(1.2345); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="1.2345") { + $ERROR('#2: __str = new String(1.2345); __str =="1.2345". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = new String(1.234567890); +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "object") { + $ERROR('#3: __str = new String(1.234567890); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3.5 +if (__str.constructor !== String) { + $ERROR('#3.5: __str = new String(1.234567890); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !="1.23456789") { + $ERROR('#4: __str = new String(1.234567890); __str =="1.23456789". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = new String(1.234500000000000000000000000); +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (typeof __str !== "object") { + $ERROR('#5: __str = new String(1.234500000000000000000000000); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5.5 +if (__str.constructor !== String) { + $ERROR('#5.5: __str = new String(1.234500000000000000000000000); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__str !="1.2345") { + $ERROR('#6: __str = new String(1.234500000000000000000000000); __str =="1.2345". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T18.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T18.js new file mode 100644 index 000000000..eaceca2c6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T18.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T18; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Create string object with "new String()" initialized with numbers that have more than 1 significant digit; +*/ + +var __str = new String(1000000000000000000000); +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(1000000000000000000000); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(1000000000000000000000); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="1e+21") { + $ERROR('#2: __str = new String(1000000000000000000000); __str =="1e+21". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str = new String(10000000000000000000000); +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (typeof __str !== "object") { + $ERROR('#3: __str = new String(10000000000000000000000); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3.5 +if (__str.constructor !== String) { + $ERROR('#3.5: __str = new String(10000000000000000000000); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str !="1e+22") { + $ERROR('#4: __str = new String(10000000000000000000000); __str =="1e+22". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T19.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T19.js new file mode 100644 index 000000000..1d3ac0ac3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T19.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T19; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String()" initialized with Array of numbers; +*/ + +var __str = new String(new Array(1,2,3)); +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(new Array(1,2,3)); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(new Array(1,2,3)); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="1,2,3") { + $ERROR('#2: __str = new String(new Array(1,2,3)); __str =="1,2,3". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T2.js new file mode 100644 index 000000000..33dc75bfe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T2.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T2; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String()"; +*/ + +var __str = new String(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="") { + $ERROR('#2: __str = new String(); __str =="". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ( __str === "") { + $ERROR('#3: __str = new String(); __str !== ""'); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T3.js new file mode 100644 index 000000000..2b72cf7cd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T3.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T3; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String("")"; +*/ + +var __str = new String(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(""); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(""); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="") { + $ERROR('#2: __str = new String(""); __str =="". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ( __str === "") { + $ERROR('#3: __str = new String(""); __str !== ""'); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T4.js new file mode 100644 index 000000000..1bcc7eacf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T4.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T4; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Create string object with "new String(1.0)"; +*/ + +var __str = new String(1.0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(1.0); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(1.0); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !=1.0+"") { + $ERROR('#2: __str = new String(1.0); __str ==1.0+"". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T5.js new file mode 100644 index 000000000..12565a42e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T5.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T5; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(NaN)"; +*/ + +var __str = new String(NaN); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(NaN); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(NaN); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !=(1/"s")+"") { + $ERROR('#2: __str = new String(NaN); __str ==(1/"s")+"". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T6.js new file mode 100644 index 000000000..9f261ade9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T6.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T6; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(false)"; +*/ + +var __str = new String(false); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(false); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(false); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !=false+"") { + $ERROR('#2: __str = new String(false); __str ==false+"". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T7.js new file mode 100644 index 000000000..1d7a32039 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T7.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T7; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String({})"; +*/ + +var __stored__Object__prototype__toString = Object.prototype.toString; + +Object.prototype.toString=function(){return "SHIFTED"}; + +var __str = new String({}); + +Object.prototype.toString = __stored__Object__prototype__toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String({}); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String({}); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="SHIFTED") { + $ERROR('#2: Object.prototype.toString=function(){return "SHIFTED"}; __str = new String({}); __str =="SHIFTED". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T8.js new file mode 100644 index 000000000..84b20201d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T8.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T8; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function(){})"; +*/ + +var __stored__Function__prototype__toString = Function.prototype.toString; + +Function.prototype.toString=function(){return "SHIFTED"}; + +var __str = new String(function(){}); + +Function.prototype.toString = __stored__Function__prototype__toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(function(){}); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(function(){}); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="SHIFTED") { + $ERROR('#2: Function.prototype.toString=function(){return "SHIFTED"}; __str = new String(function(){}); __str =="SHIFTED". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T9.js new file mode 100644 index 000000000..2eb4a344d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A1_T9.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A1_T9; +* @section: 15.5.2.1; +* @assertion: When "String" is called as part of a new expression, it is a constructor: it initialises the newly created object and +* The [[Value]] property of the newly constructed object is set to ToString(value), or to the empty string if value is not supplied; +* @description: Creating string object with "new String(function(){return [1,2,3]}())"; +*/ + +var __str = new String(function(){return [1,2,3]}()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __str !== "object") { + $ERROR('#1: __str = new String(function(){return [1,2,3]}()); typeof __str === "object". Actual: typeof __str ==='+typeof __str ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1.5 +if (__str.constructor !== String) { + $ERROR('#1.5: __str = new String(function(){return [1,2,3]}()); __str.constructor === String. Actual: __str.constructor ==='+__str.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str !="1,2,3") { + $ERROR('#2: __str = new String(function(){return [1,2,3]}()); __str =="1,2,3". Actual: __str =='+__str ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_T1.js new file mode 100644 index 000000000..294e779bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_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.2.1_A2_T1; +* @section: 15.5.2.1, 15.5.3.1; +* @assertion: The [[Prototype]] property of the newly constructed object is set to the original String prototype object; +* @description: Creating string object with "new String(string)" to check prototype; +*/ + +var __str__obj = new String("abba"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.isPrototypeOf(__str__obj))) { + $ERROR('#1: var __str__obj = new String("abba"); String.prototype.isPrototypeOf(__str__obj)===true'); +} +// +////////////////////////////////////////////////////////////////////////////// + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_T2.js new file mode 100644 index 000000000..13042ea65 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A2_T2.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A2_T2; +* @section: 15.5.2.1, 15.5.3.1; +* @assertion: The [[Prototype]] property of the newly constructed object is set to the original String prototype object; +* @description: Creating string object with "new String(string)" adding custom property; +*/ + + +var __str__obj = new String("shocking blue"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str__obj["__custom__prop"]!==undefined) { + $ERROR('#1: var __str__obj = new String("shocking blue"); __str__obj["__custom__prop"]===undefined. Actual: __str__obj["__custom__prop"]==='+__str__obj["__custom__prop"]); +} +// +////////////////////////////////////////////////////////////////////////////// + +String.prototype.__custom__prop = "bor"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str__obj["__custom__prop"]!=="bor") { + $ERROR('#2: var __str__obj = new String("shocking blue"); String.prototype.__custom__prop = "bor"; __str__obj["__custom__prop"]==="bor". Actual: __str__obj["__custom__prop"]==='+__str__obj["__custom__prop"]); +} +// +////////////////////////////////////////////////////////////////////////////// + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A3.js new file mode 100644 index 000000000..2bab8a990 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.2_The_String_Constructor/S15.5.2.1_A3.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.2.1_A3; +* @section: 15.5.2.1; +* @assertion: The [[Class]] property of the newly constructed object is set to "String"; +* @description: Creating string object with "new String(string)" and changing toString property to Object.prototype.toString; +*/ + +var __str__obj = new String("seamaid"); + +__str__obj.toString = Object.prototype.toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str__obj.toString() !== "[object "+"String"+"]") { + $ERROR('#1: var __str__obj = new String("seamaid"); __str__obj.toString = Object.prototype.toString; __str__obj.toString() === "[object String]". Actual: __str__obj.toString() ==='+__str__obj.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A1.js new file mode 100644 index 000000000..8af38452a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A1.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.3.1_A1; +* @section: 15.5.3.1, 15.5.4; +* @assertion: The String has property prototype; +* @description: Checking String.hasOwnProperty('prototype'); +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.hasOwnProperty('prototype'))) { + $ERROR('#1: String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A2.js new file mode 100644 index 000000000..84e035354 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A2.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.3.1_A2; +* @section: 15.5.3.1, 15.5.4; +* @assertion: The String.prototype property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.hasOwnProperty('prototype'))) { + $FAIL('#0: String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.propertyIsEnumerable('prototype')) { + $ERROR('#1: String.propertyIsEnumerable(\'prototype\') return false. Actual: '+String.propertyIsEnumerable('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String){ + if (p==="prototype") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String){ if (p==="prototype") count++;}; count === 0. Actual: count ==='+count ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A3.js new file mode 100644 index 000000000..ff33c16b1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A3.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.3.1_A3; +* @section: 15.5.3.1, 15.5.4; +* @assertion: The String.prototype property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.hasOwnProperty('prototype'))) { + $FAIL('#1: String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// + +delete String.prototype; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.hasOwnProperty('prototype'))) { + $ERROR('#2: delete String.prototype; String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A4.js new file mode 100644 index 000000000..498c52ebe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.1_A4.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.3.1_A4; +* @section: 15.5.3.1, 15.5.4; +* @assertion: The String.prototype property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.hasOwnProperty('prototype'))) { + $FAIL('#1: String.hasOwnProperty(\'prototype\') return true. Actual: '+String.hasOwnProperty('prototype')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype; + +String.prototype = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype !== __obj) { + $ERROR('#2: __obj = String.prototype; String.prototype = function(){return "shifted";}; String.prototype === __obj. Actual: String.prototype ==='+String.prototype ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A1.js new file mode 100644 index 000000000..9db600c18 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.3.2_A1; +* @section: 15.5.3.2; +* @assertion: The length property of the fromCharCode function is 1; +* @description: Checking String.fromCharCode.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof String.fromCharCode !== "function") { + $ERROR('#1: typeof String.fromCharCode === "function". Actual: typeof String.fromCharCode ==='+typeof String.fromCharCode ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.hasOwnProperty("fromCharCode"))) { + $ERROR('#2: String.hasOwnProperty("fromCharCode") return true. Actual: '+String.hasOwnProperty("fromCharCode")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (String.fromCharCode.length !== 1) { + $ERROR('#3: String.fromCharCode.length === 1. Actual: String.fromCharCode.length ==='+String.fromCharCode.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A2.js new file mode 100644 index 000000000..181bd5763 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A2.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.3.2_A2; +* @section: 15.5.3.2; +* @assertion: String.fromCharCode () returns empty string; +* @description: Call String.fromCharCode(); +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.fromCharCode() !== "") { + $ERROR('#1: String.fromCharCode () returns empty string. Actual: '+String.fromCharCode()); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_T1.js new file mode 100644 index 000000000..8bbb717ab --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_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.5.3.2_A3_T1; +* @section: 15.5.3.2; +* @assertion: String.fromCharCode ( [ char0 [ , char1 [ , ... ] ] ] ); +* @description: Call String.fromCharCode(65,66,66,65); +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.fromCharCode(65,66,66,65) !== "ABBA") { + $ERROR('#1: String.fromCharCode(65,66,66,65) === "ABBA". Actual: String.fromCharCode(65,66,66,65) ==='+String.fromCharCode(65,66,66,65) ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_T2.js new file mode 100644 index 000000000..1299cc41e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A3_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.3.2_A3_T2; +* @section: 15.5.3.2; +* @assertion: String.fromCharCode ( [ char0 [ , char1 [ , ... ] ] ] ); +* @description: Create function variable, that equal String.fromCharCode, delete original String.fromCharCode and use created variable; +*/ + +var __fcc__func = String.fromCharCode; + +delete String.fromCharCode; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__fcc__func(65,66,66,65) !== "ABBA") { + $ERROR('#1: __fcc__func = String.fromCharCode; delete String.fromCharCode; __fcc__func(65,66,66,65) === "ABBA". Actual: __fcc__func(65,66,66,65) ==='+__fcc__func(65,66,66,65) ); +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A4.js new file mode 100644 index 000000000..53dfac6ac --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3.2_A4.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.3.2_A4; +* @section: 15.5.3.2; +* @assertion: String.fromCharCode has not [[construct]] method; +* @description: Checking if creating "new String.fromCharCode" fails; +*/ + +var __fcc__func = String.fromCharCode; + +delete String.fromCharCode; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var __obj = new __fcc__func(65,66,66,65); + $FAIL('#1: __fcc__func = String.fromCharCode; var __obj = new __fcc__func(65,66,66,65) lead to throwing exception'); +} catch (e) {} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A1.js new file mode 100644 index 000000000..900b07825 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A1.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.3_A1; +* @section: 15.5.3, 15.5.4; +* @assertion: String has length property whose value is 1; +* @description: Checking String.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +// CHECK# +if (String.length !== 1) { + $ERROR('String has length property whose value is 1. Actual: String.length==='+String.length); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_T1.js new file mode 100644 index 000000000..8657ea6cf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_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.3_A2_T1; +* @section: 15.5.3, 15.5.4; +* @assertion: The value of the internal [[Prototype]] property of the String constructor is the Function prototype object; +* @description: Checking Function.prototype.isPrototypeOf(String); +*/ + +////////////////////////////////////////////////////////////////////////////// +// CHECK# +if (!(Function.prototype.isPrototypeOf(String))) { + $ERROR('#1: Function.prototype.isPrototypeOf(String) return true. Actual: '+Function.prototype.isPrototypeOf(String)); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_T2.js new file mode 100644 index 000000000..c6dc4a12a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.3_Properties_of_the_String_Constructor/S15.5.3_A2_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.5.3_A2_T2; +* @section: 15.5.3, 15.5.4; +* @assertion: The value of the internal [[Prototype]] property of the String constructor is the Function prototype object; +* @description: Add custom property to Function.prototype and check it at String; +*/ + +Function.prototype.indicator = 1; + +////////////////////////////////////////////////////////////////////////////// +// CHECK# +if (String.indicator !== 1) { + $ERROR('#1: Function.prototype.indicator = 1; String.indicator === 1. Actual: String.indicator ==='+String.indicator ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A10.js new file mode 100644 index 000000000..214070e6f --- /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.10_String.prototype.match/S15.5.4.10_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.10_A10; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.match.length; + +String.prototype.match.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.match.length !== __obj) { + $ERROR('#2: __obj = String.prototype.match.length; String.prototype.match.length = function(){return "shifted";}; String.prototype.match.length === __obj. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A11.js new file mode 100644 index 000000000..29ce3ba56 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A11; +* @section: 15.5.4.10; +* @assertion: The length property of the match method is 1; +* @description: Checking String.prototype.match.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.match.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.match.hasOwnProperty("length") return true. Actual: '+String.prototype.match.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.match.length !== 1) { + $ERROR('#2: String.prototype.match.length === 1. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T1.js new file mode 100644 index 000000000..42ea69ecc --- /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.10_String.prototype.match/S15.5.4.10_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.10_A1_T1; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.match(true)[0] !== "true") { + $ERROR('#1: __instance = new Object(true); __instance.match = String.prototype.match; __instance.match(true)[0] === "true". Actual: '+__instance.match(true)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T10.js new file mode 100644 index 000000000..e75726da3 --- /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.10_String.prototype.match/S15.5.4.10_A1_T10.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.5.4.10_A1_T10; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with object argument; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __str = "ABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (match(__obj)[0] !=="AB") { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041B";}}; var __str = "ABB\u0041BABAB"; match(__obj)[0] ==="AB". Actual: '+match(__obj)[0] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T11.js new file mode 100644 index 000000000..c6edbfac9 --- /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.10_String.prototype.match/S15.5.4.10_A1_T11.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.10_A1_T11; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString function, toString throw exception, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){throw "intostr";}} +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = match(__obj); + $FAIL('#1: "var x = match(__obj)" 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T12.js new file mode 100644 index 000000000..1fbfae4f8 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A1_T12; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString and valueOf functions, valueOf throw exception, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = match(__obj); + $FAIL('#1: "var x = match(__obj)" 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.10_String.prototype.match/S15.5.4.10_A1_T13.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.10_String.prototype.match/S15.5.4.10_A1_T13.js new file mode 100644 index 000000000..840a3645f --- /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.10_String.prototype.match/S15.5.4.10_A1_T13.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.10_A1_T13; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString and valueOf functions, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj)[0] !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; "ABB\\u0041B\\u0031ABAB\\u0031BBAA".match(__obj)[0] ==="1". Actual: '+("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj)[0]) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj).length !== 1) { + $ERROR('#3: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; "ABB\\u0041B\\u0031ABAB\\u0031BBAA".match(__obj).length === 1. Actual: '+("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj).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.10_String.prototype.match/S15.5.4.10_A1_T14.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.10_String.prototype.match/S15.5.4.10_A1_T14.js new file mode 100644 index 000000000..56c307d3a --- /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.10_String.prototype.match/S15.5.4.10_A1_T14.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.5.4.10_A1_T14; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with RegExp object as argument from string; +*/ + +var __reg = new RegExp("77"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB\u0037\u0037BBAA".match(__reg)[0] !== "77") { + $ERROR('#1: var __reg = new RegExp("77"); "ABB\\u0041BABAB\\u0037\\u0037BBAA".match(__reg)[0] === "77". Actual: '+("ABB\u0041BABAB\u0037\u0037BBAA".match(__reg)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T2.js new file mode 100644 index 000000000..4a8f3b012 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A1_T2; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Argument is function that return boolean, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.match(function(){return false;}())[0] !== "false") { + $ERROR('#1: __instance = new Boolean; __instance.match = String.prototype.match; __instance.match(function(){return false;}())[0] === "false". Actual: '+__instance.match(function(){return false;}())[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T3.js new file mode 100644 index 000000000..c059fa4b4 --- /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.10_String.prototype.match/S15.5.4.10_A1_T3.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.10_A1_T3; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Checking by using eval; +*/ + +var match = String.prototype.match; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (match(eval("\"bj\""))[0] !== "bj") { + $ERROR('#1: match = String.prototype.match; match(eval("\\"bj\\""))[0] === "bj". Actual: '+match(eval("\"bj\""))[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T4.js new file mode 100644 index 000000000..42b6f6331 --- /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.10_String.prototype.match/S15.5.4.10_A1_T4.js @@ -0,0 +1,47 @@ +// 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.10_A1_T4; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function without arguments of string; +*/ + +var __matched = "".match(); + +var __expected = RegExp().exec(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = "".match(); __expected = RegExp().exec(""); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = "".match(); __expected = RegExp().exec(""); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = "".match(); __expected = RegExp().exec(""); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = "".match(); __expected = RegExp().exec(""); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T5.js new file mode 100644 index 000000000..3a8da5dad --- /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.10_String.prototype.match/S15.5.4.10_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.10_A1_T5; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "gnulluna"}().match(null)[0] !== "null") { + $ERROR('#1: function(){return "gnulluna"}().match(null)[0] === "null". Actual: '+function(){return "gnulluna"}().match(null)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T6.js new file mode 100644 index 000000000..31a679592 --- /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.10_String.prototype.match/S15.5.4.10_A1_T6.js @@ -0,0 +1,50 @@ +// 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.10_A1_T6; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with x argument of new String object, where x is undefined variable; +*/ + +var __matched = new String("undefined").match(x); + +var __expected = RegExp(x).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T7.js new file mode 100644 index 000000000..0cd7c0a8a --- /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.10_String.prototype.match/S15.5.4.10_A1_T7.js @@ -0,0 +1,47 @@ +// 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.10_A1_T7; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with undefined argument of string object; +*/ + +var __matched = String("undefined").match(undefined); + +var __expected = RegExp(undefined).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T8.js new file mode 100644 index 000000000..7a7022b45 --- /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.10_String.prototype.match/S15.5.4.10_A1_T8.js @@ -0,0 +1,50 @@ +// 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.10_A1_T8; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with void 0 argument of string object; +* +*/ + +var __obj = {toString:function(){}}; + +var __matched = String(__obj).match(void 0); + +var __expected = RegExp(void 0).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T9.js new file mode 100644 index 000000000..f08ed7e5c --- /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.10_String.prototype.match/S15.5.4.10_A1_T9.js @@ -0,0 +1,52 @@ +// 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.10_A1_T9; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with function(){}() argument of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __matched = new String(__obj).match(function(){}()); + +var __expected = RegExp(undefined).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T1.js new file mode 100644 index 000000000..352ab972b --- /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.10_String.prototype.match/S15.5.4.10_A2_T1.js @@ -0,0 +1,43 @@ +// 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.10_A2_T1; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is 3; +*/ + +var __string = "1234567890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(3)[0]!== "3") { + $ERROR('#1: __string = "1234567890"; __string.match(3)[0]=== "3". Actual: '+__string.match(3)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(3).length !==1) { + $ERROR('#2: __string = "1234567890"; __string.match(3).length ===1. Actual: '+__string.match(3).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(3).index !==2) { + $ERROR('#3: __string = "1234567890"; __string.match(3).index ===2. Actual: '+__string.match(3).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__string.match(3).input !==__string) { + $ERROR('#4: __string = "1234567890"; __string.match(3).input ===__string. Actual: '+__string.match(3).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T10.js new file mode 100644 index 000000000..8288c459a --- /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.10_String.prototype.match/S15.5.4.10_A2_T10.js @@ -0,0 +1,44 @@ +// 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.10_A2_T10; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0"); +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.lastIndexOf("0"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T11.js new file mode 100644 index 000000000..eff45f6ad --- /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.10_String.prototype.match/S15.5.4.10_A2_T11.js @@ -0,0 +1,44 @@ +// 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.10_A2_T11; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0")+1; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.lastIndexOf("0")+1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T12.js new file mode 100644 index 000000000..3f2644904 --- /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.10_String.prototype.match/S15.5.4.10_A2_T12.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.10_A2_T12; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is variable that have value /([\d]{5})([-\ ]?[\d]{4})?$/g; +*/ + +var __matches=["02134"]; + +var __string = "Boston, MA 02134"; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#2: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T13.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.10_String.prototype.match/S15.5.4.10_A2_T13.js new file mode 100644 index 000000000..8c88fef3f --- /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.10_String.prototype.match/S15.5.4.10_A2_T13.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.10_A2_T13; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g. +* And regular expression object have property lastIndex = 0; +*/ + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; +__re.lastIndex = 0; + +var __string = "Boston, MA 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T14.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.10_String.prototype.match/S15.5.4.10_A2_T14.js new file mode 100644 index 000000000..7d35e67f8 --- /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.10_String.prototype.match/S15.5.4.10_A2_T14.js @@ -0,0 +1,34 @@ +// 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.10_A2_T14; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g. +* And regular expression object have property lastIndex = tested_string.length; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.length; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T15.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.10_String.prototype.match/S15.5.4.10_A2_T15.js new file mode 100644 index 000000000..77a25be47 --- /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.10_String.prototype.match/S15.5.4.10_A2_T15.js @@ -0,0 +1,34 @@ +// 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.10_A2_T15; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0"); +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.lastIndexOf("0"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T16.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.10_String.prototype.match/S15.5.4.10_A2_T16.js new file mode 100644 index 000000000..4a02d1f5f --- /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.10_String.prototype.match/S15.5.4.10_A2_T16.js @@ -0,0 +1,34 @@ +// 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.10_A2_T16; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0")+1; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.lastIndexOf("0")+1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T17.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.10_String.prototype.match/S15.5.4.10_A2_T17.js new file mode 100644 index 000000000..f36e6806a --- /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.10_String.prototype.match/S15.5.4.10_A2_T17.js @@ -0,0 +1,49 @@ +// 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.10_A2_T17; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /0./; +*/ + +var __re = /0./; + +var __num = 10203040506070809000; + +Number.prototype.match = String.prototype.match; + +//__matches = ["02"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.match(__re)[0]!== "02") { + $ERROR('#1: __num.match(__re)[0]=== "02". Actual: '+__num.match(__re)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__num.match(__re).length !==1) { + $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__num.match(__re).index !==1) { + $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__num.match(__re).input !==String(__num)) { + $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_T18.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.10_String.prototype.match/S15.5.4.10_A2_T18.js new file mode 100644 index 000000000..6756d3a6a --- /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.10_String.prototype.match/S15.5.4.10_A2_T18.js @@ -0,0 +1,50 @@ +// 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.10_A2_T18; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /0./. +* And regular expression object have property lastIndex = 0; +*/ + +var __re = /0./; + +__re.lastIndex = 0; + +var __num = 10203040506070809000; + +Number.prototype.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.match(__re)[0]!== "02") { + $ERROR('#1: __num.match(__re)[0]=== "02". Actual: '+__num.match(__re)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__num.match(__re).length !==1) { + $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__num.match(__re).index !==1) { + $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__num.match(__re).input !==String(__num)) { + $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T2.js new file mode 100644 index 000000000..ab9ec9a4c --- /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.10_String.prototype.match/S15.5.4.10_A2_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.5.4.10_A2_T2; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /34/g; +*/ + +var __matches=["34","34","34"]; + +var __string = "343443444"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/34/g).length!== 3) { + $ERROR('#1: __string = "343443444"; __string.match(/34/g).length=== 3. Actual: '+__string.match(/34/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/34/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["34","34","34"]; __string = "343443444"; __string.match(/34/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/34/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T3.js new file mode 100644 index 000000000..f28c5e34f --- /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.10_String.prototype.match/S15.5.4.10_A2_T3.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.10_A2_T3; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\d{1}/g; +*/ + +var __matches=["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\d{1}/g).length!== 10) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\d{1}/g).length=== 10. Actual: '+__string.match(/\d{1}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\d{1}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; __string = "123456abcde7890"; __string.match(/\\d{1}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\d{1}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T4.js new file mode 100644 index 000000000..ef622ced2 --- /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.10_String.prototype.match/S15.5.4.10_A2_T4.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.10_A2_T4; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\d{2}/g; +*/ + +var __matches=["12", "34", "56", "78", "90"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\d{2}/g).length!== 5) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\d{2}/g).length=== 5. Actual: '+__string.match(/\d{2}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\d{2}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["12", "34", "56", "78", "90"]; __string = "123456abcde7890"; __string.match(/\\d{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\d{2}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T5.js new file mode 100644 index 000000000..20ffc7c1a --- /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.10_String.prototype.match/S15.5.4.10_A2_T5.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.10_A2_T5; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\D{2}/g; +*/ + +var __matches=["ab", "cd"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\D{2}/g).length!== 2) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\D{2}/g).length=== 2. Actual: '+__string.match(/\D{2}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\D{2}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["ab", "cd"]; __string = "123456abcde7890"; __string.match(/\\D{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\D{2}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T6.js new file mode 100644 index 000000000..b309ab196 --- /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.10_String.prototype.match/S15.5.4.10_A2_T6.js @@ -0,0 +1,59 @@ +// 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.10_A2_T6; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is void 0; +*/ + +var __string = "Boston, Mass. 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[0]!== "02134") { + $ERROR('#1: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[0]=== "02134". Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[1]!== "02134") { + $ERROR('#2: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[1]=== "02134". Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[2]!== void 0) { + $ERROR('#3: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[2]=== void 0. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[2]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).length !==3) { + $ERROR('#4: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).length ===3. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).index !==14) { + $ERROR('#5: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).index ===14. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).input !==__string) { + $ERROR('#6: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).input ===__string. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T7.js new file mode 100644 index 000000000..22034f009 --- /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.10_String.prototype.match/S15.5.4.10_A2_T7.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.10_A2_T7; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g; +*/ + +var __matches=["02134"]; + +var __string = "Boston, Mass. 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g).length!== 1) { + $ERROR('#1: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g).length=== 1. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g)[0]!==__matches[0]) { + $ERROR('#2: __matches=["02134"]; __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g)[0]===__matches[0]. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g)[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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T8.js new file mode 100644 index 000000000..28d2b320b --- /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.10_String.prototype.match/S15.5.4.10_A2_T8.js @@ -0,0 +1,43 @@ +// 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.10_A2_T8; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = 0; +*/ + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; +__re.lastIndex = 0; + +var __string = "Boston, MA 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __re.lastIndex = 0; __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __matches=["02134", "02134", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T9.js new file mode 100644 index 000000000..960d0d27e --- /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.10_String.prototype.match/S15.5.4.10_A2_T9.js @@ -0,0 +1,44 @@ +// 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.10_A2_T9; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.length; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.length; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __re.lastIndex = __string.length; __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __matches=["02134", "02134", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A6.js new file mode 100644 index 000000000..20a410171 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A6; +* @section: 15.5.4.10, 13.2; +* @assertion: String.prototype.match has not prototype property; +* @description: Checking String.prototype.match.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.match.prototype !== undefined) { + $ERROR('#1: String.prototype.match.prototype === undefined. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A7.js new file mode 100644 index 000000000..14ffcecfd --- /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.10_String.prototype.match/S15.5.4.10_A7.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.5.4.10_A7; +* @section: 15.5.4.10, 13.2; +* @assertion: String.prototype.match can't be used as constructor; +* @description: Checking if creating "String.prototype.match object" fails; +*/ + +var __FACTORY = String.prototype.match; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.match; __FACTORY = String.prototype.match; __instance = new __FACTORY lead to throwing exception'); +} catch (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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A8.js new file mode 100644 index 000000000..955a0f61b --- /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.10_String.prototype.match/S15.5.4.10_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.10_A8; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.match.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.match.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.match){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.match){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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A9.js new file mode 100644 index 000000000..5e5ebb1fe --- /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.10_String.prototype.match/S15.5.4.10_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.10_A9; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.match.length) { + $ERROR('#1: delete String.prototype.match.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.match.length; String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A10.js new file mode 100644 index 000000000..b91cb055c --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A10; +* @section: 15.5.4.11; +* @assertion: The String.prototype.replace.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.replace.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.replace.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.replace.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.replace.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.replace.length; + +String.prototype.replace.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.replace.length !== __obj) { + $ERROR('#2: __obj = String.prototype.replace.length; String.prototype.replace.length = function(){return "shifted";}; String.prototype.replace.length === __obj. Actual: '+String.prototype.replace.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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A11.js new file mode 100644 index 000000000..5cd122c25 --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A11; +* @section: 15.5.4.11; +* @assertion: The length property of the replace method is 2; +* @description: Checking String.prototype.replace.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.replace.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.replace.hasOwnProperty("length") return true. Actual: '+String.prototype.replace.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.replace.length !== 2) { + $ERROR('#2: String.prototype.replace.length === 2. Actual: '+String.prototype.replace.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.11_String.prototype.replace/S15.5.4.11_A12.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.11_String.prototype.replace/S15.5.4.11_A12.js new file mode 100644 index 000000000..bfc32db70 --- /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.11_String.prototype.replace/S15.5.4.11_A12.js @@ -0,0 +1,23 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.11_A12; +* @section: 15.5.4.11; +* @assertion: Call replaceValue passing undefined as the this value; +* @description: replaceValue tests that its this value is undefined; +*/ + +var global = this; +'x'.replace(/x/, function() { + "use strict"; + + if (this === global) { + $FAIL('#1: String replace leaks global'); + } + if (this !== undefined) { + $FAIL('#2: replaceValue should be called with this===undefined. ' + + 'Actual: ' + this); + } + return 'y'; +}); 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T1.js new file mode 100644 index 000000000..99a910b5c --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A1_T1; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Arguments are true and 1, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.replace = String.prototype.replace; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.replace(true, 1) !== "1") { + $ERROR('#1: __instance = new Object(true); __instance.replace = String.prototype.replace; __instance.replace(true, 1) === "1". Actual: '+__instance.replace(true, 1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T10.js new file mode 100644 index 000000000..124efe72c --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A1_T10; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with object and function arguments of string. Object have overrided toString function; +*/ + +var __obj = {toString:function(){return "\u0041B";}}; + +var __str = "ABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (replace(__obj, function(){return x;}) !== "undefinedBABABAB") { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041B";}}; var __str = "ABB\u0041BABAB"; replace(__obj, function(){return x;}) === "undefinedBABABAB". Actual: '+replace(__obj, function(){return 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T11.js new file mode 100644 index 000000000..1520b02fb --- /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.11_String.prototype.replace/S15.5.4.11_A1_T11.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.11_A1_T11; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with objects arguments of string object. Objects have overrided toString function, that throw exception; +*/ + +var __obj = {toString:function(){throw "insearchValue";}}; +var __obj2 = {toString:function(){throw "inreplaceValue";}}; +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = replace(__obj,__obj2); + $FAIL('#1: "var x = replace(__obj,__obj2)" lead to throwing exception'); + } catch (e) { + if (e!=="insearchValue") { + $ERROR('#1.1: Exception === "insearchValue". 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T12.js new file mode 100644 index 000000000..3e40f0658 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T12.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.11_A1_T12; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with objects arguments of String object. +* First objects have overrided toString and valueOf functions, valueOf throw exception. +* Second objects have overrided toString function, that throw exception; +*/ + +var __obj = {toString:function(){return {};}, valueOf:function(){throw "insearchValue";}}; +var __obj2 = {toString:function(){throw "inreplaceValue";}}; +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = replace(__obj, __obj2); + $FAIL('#1: "var x = replace(__obj,__obj2)" lead to throwing exception'); + } catch (e) { + if (e!=="insearchValue") { + $ERROR('#1.1: Exception === "insearchValue". 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.11_String.prototype.replace/S15.5.4.11_A1_T13.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.11_String.prototype.replace/S15.5.4.11_A1_T13.js new file mode 100644 index 000000000..4b754716f --- /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.11_String.prototype.replace/S15.5.4.11_A1_T13.js @@ -0,0 +1,28 @@ +// 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.11_A1_T13; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with objects arguments of string. +* First objects have overrided toString and valueOf functions. +* Second objects have overrided toString function, that throw exception; +*/ + +var __obj = {toString:function(){return {};}, valueOf:function(){return 1;}}; +var __obj2 = {toString:function(){throw "inreplaceValue";}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = "ABB\u0041BABAB\u0031BBAA".replace(__obj, __obj2); + $FAIL('#1: var x = "ABB\\u0041BABAB\\u0031BBAA".replace(__obj,__obj2) lead to throwing exception'); +} catch (e) { + if (e!=="inreplaceValue") { + $ERROR('#1.1: Exception === "inreplaceValue". 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.11_String.prototype.replace/S15.5.4.11_A1_T14.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.11_String.prototype.replace/S15.5.4.11_A1_T14.js new file mode 100644 index 000000000..6d72d1b7e --- /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.11_String.prototype.replace/S15.5.4.11_A1_T14.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.5.4.11_A1_T14; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Instance is string, searchValue is regular expression; +*/ + +var __reg = new RegExp("77"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB\u0037\u0037BBAA".replace(__reg, 1) !== "ABBABABAB\u0031BBAA") { + $ERROR('#1: var __reg = new RegExp("77"); "ABB\\u0041BABAB\\u0037\\u0037BBAA".replace(__reg, 1) === "ABBABABAB\\u0031BBAA". Actual: '+("ABB\u0041BABAB\u0037\u0037BBAA".replace(__reg, 1)) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A1_T15.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.11_String.prototype.replace/S15.5.4.11_A1_T15.js new file mode 100644 index 000000000..c8ed48dd4 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T15.js @@ -0,0 +1,28 @@ +// 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.11_A1_T15; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Instance is Object, searchValue is regular expression; +*/ + +var __obj = {toString:function(){return /77/}}; + +var __instance = new Object(1100.00777001); + +Object.prototype.replace = String.prototype.replace; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __instance.replace(__obj, 1) === "1100.0017001"; + $FAIL('#1.0: x = __instance.replace(__obj, 1) === "1100.0017001" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. 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.11_String.prototype.replace/S15.5.4.11_A1_T16.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.11_String.prototype.replace/S15.5.4.11_A1_T16.js new file mode 100644 index 000000000..8f90dac94 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T16.js @@ -0,0 +1,32 @@ +// 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.11_A1_T16; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Instance is Number, searchValue is regular expression; +*/ + +var __re = /77/; + +var __instance = new Number(1100.00777001); + +Number.prototype.replace = String.prototype.replace; + +var __obj = {toString:function(){return function(a1,a2,a3){return a2+"z"};}} +//__obj = function(a1,a2,a3){return a2+"z"}; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __instance.replace(__re, __obj) === "1100.007z7001"; + $FAIL('#1.0: x = __instance.replace(__obj, 1) === "1100.007z7001" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. 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.11_String.prototype.replace/S15.5.4.11_A1_T17.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.11_String.prototype.replace/S15.5.4.11_A1_T17.js new file mode 100644 index 000000000..f7c9b5001 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T17.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.5.4.11_A1_T17; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Instance is String object, searchValue is regular expression; +*/ + +var __re = new RegExp(x,"g"); + +var __instance = String("asdf"); + +var __str = "1"; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.replace(__re, __str) !== "1a1s1d1f1") { + $ERROR('#1: var x; var __re = new RegExp(x,"g"); __instance = String("asdf"); __str = "1"; __instance.replace(__re, __str) === "1a1s1d1f1". Actual: '+__instance.replace(__re, __str) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T2.js new file mode 100644 index 000000000..b9ef31f9c --- /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.11_String.prototype.replace/S15.5.4.11_A1_T2.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.11_A1_T2; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Argument is function that return boolean, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.replace = String.prototype.replace; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.replace(function(){return false;}(),x) !== "undefined") { + $ERROR('#1: var x; __instance = new Boolean; __instance.replace = String.prototype.replace; __instance.replace(function(){return false;}(),x) === "undefined". Actual: '+__instance.replace(function(){return false;}(),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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T3.js new file mode 100644 index 000000000..eac4a9a7b --- /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.11_String.prototype.replace/S15.5.4.11_A1_T3.js @@ -0,0 +1,38 @@ +// 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.11_A1_T3; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Checking by using eval; +*/ + +replace = String.prototype.replace; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +__class__ = toString(); +__toggle = 1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +__replaced = replace(eval("\"b\""),"^"); + +__golden = ""; +for(var i=0; i<__class__.length; i++) { + if ((__class__.charAt(i)==="b")&&(__toggle)) { + __golden+="^"; + __toggle = 0; + } else { + __golden+=__class__.charAt(i); + } + +} +if (__replaced !==__golden) { + $ERROR('#1: __replaced ===__golden. Actual: '+__replaced ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T4.js new file mode 100644 index 000000000..a7af1977f --- /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.11_String.prototype.replace/S15.5.4.11_A1_T4.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.11_A1_T4; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with null and function(a1,a2,a3){return a2+"";} arguments of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (function(){return "gnulluna"}().replace(null,function(a1,a2,a3){return a2+"";}) !== "g1una") { + $ERROR('#1: function(){return "gnulluna"}().replace(null,function(a1,a2,a3){return a2+"";}) === "g1una". Actual: '+function(){return "gnulluna"}().replace(null,function(a1,a2,a3){return a2+"";}) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T5.js new file mode 100644 index 000000000..7ea29d2d9 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T5.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.11_A1_T5; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with null and Function() arguments of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (function(){return "gnulluna"}().replace(null, Function()) !== "gundefineduna") { + $ERROR('#1: function(){return "gnulluna"}().replace(null, Function()) === "gundefineduna". Actual: '+function(){return "gnulluna"}().replace(null, 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T6.js new file mode 100644 index 000000000..747a66511 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T6.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.5.4.11_A1_T6; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with x and Function("return arguments[1]+42;") arguments of new String object. x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String("undefined").replace(x,Function("return arguments[1]+42;")) !== "42") { + $ERROR('#1: var x; new String("undefined").replace(x,Function("return arguments[1]+42;")) === "42". Actual: '+new String("undefined").replace(x,Function("return arguments[1]+42;")) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T7.js new file mode 100644 index 000000000..661a6807c --- /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.11_String.prototype.replace/S15.5.4.11_A1_T7.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.11_A1_T7; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with string and undefined arguments of String object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(void 0).replace("e",undefined) !== "undundefinedfined") { + $ERROR('#1: String(void 0).replace("e",undefined) === "undundefinedfined". Actual: '+String(void 0).replace("e",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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T8.js new file mode 100644 index 000000000..435788834 --- /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.11_String.prototype.replace/S15.5.4.11_A1_T8.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.5.4.11_A1_T8; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with regular expression and void 0 arguments of String object; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(__obj).replace(/e/g,void 0) !== "undundefinedfinundefinedd") { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).replace(/e/g,void 0) === "undundefinedfinundefinedd". Actual: '+String(__obj).replace(/e/g,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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A1_T9.js new file mode 100644 index 000000000..68eec34ed --- /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.11_String.prototype.replace/S15.5.4.11_A1_T9.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.5.4.11_A1_T9; +* @section: 15.5.4.11; +* @assertion: String.prototype.replace (searchValue, replaceValue); +* @description: Call replace (searchValue, replaceValue) function with functions arguments of new String object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String(__obj).replace(function(){}(),__func) !== "undefined0undefined") { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; function __func(a1,a2,a3){return a1+a2+a3;}; new String(__obj).replace(function(){}(),__func) === "undefined0undefined". Actual: '+new String(__obj).replace(function(){}(),__func) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __func(a1,a2,a3){return a1+a2+a3;}; 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T1.js new file mode 100644 index 000000000..ab38fed47 --- /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.11_String.prototype.replace/S15.5.4.11_A2_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.11_A2_T1; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Don`t use $ in replaceValue, searchValue is regular expression /sh/g; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re,'sch')!=='She sells seaschells by the seaschore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/g; __str.replace(__re,\'sch\')===\'She sells seaschells by the seaschore.\'. Actual: '+__str.replace(__re,'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T10.js new file mode 100644 index 000000000..602748fb9 --- /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.11_String.prototype.replace/S15.5.4.11_A2_T10.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.11_A2_T10; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $' in replaceValue, searchValue is regular expression /sh/; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$'" + 'sch')!=='She sells seaells by the seashore.schells by the seashore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/; __str.replace(__re, "$\'" + \'sch\')===\'She sells seaells by the seashore.schells by the seashore.\'. Actual: '+__str.replace(__re, "$'" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T2.js new file mode 100644 index 000000000..dca68679d --- /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.11_String.prototype.replace/S15.5.4.11_A2_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.11_A2_T2; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $$ in replaceValue, searchValue is regular expression /sh/g; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re,"$$" + 'sch')!=='She sells sea$schells by the sea$schore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/g; __str.replace(__re,"$$" + \'sch\')===\'She sells sea$schells by the sea$schore.\'. Actual: '+__str.replace(__re,"$$" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T3.js new file mode 100644 index 000000000..3cfe15612 --- /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.11_String.prototype.replace/S15.5.4.11_A2_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.11_A2_T3; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $& in replaceValue, searchValue is regular expression /sh/g; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re,"$&" + 'sch')!=='She sells seashschells by the seashschore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/g; __str.replace(__re,"$&" + \'sch\')===\'She sells seashschells by the seashschore.\'. Actual: '+__str.replace(__re,"$&" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T4.js new file mode 100644 index 000000000..fbcf4df7f --- /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.11_String.prototype.replace/S15.5.4.11_A2_T4.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.11_A2_T4; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $` in replaceValue, searchValue is regular expression /sh/g; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$`" + 'sch')!=='She sells seaShe sells seaschells by the seaShe sells seashells by the seaschore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/g; __str.replace(__re, "$`" + \'sch\')===\'She sells seaShe sells seaschells by the seaShe sells seashells by the seaschore.\'. Actual: '+__str.replace(__re, "$`" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T5.js new file mode 100644 index 000000000..69cd76e44 --- /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.11_String.prototype.replace/S15.5.4.11_A2_T5.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.11_A2_T5; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $' in replaceValue, searchValue is regular expression /sh/g; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$'" + 'sch')!=='She sells seaells by the seashore.schells by the seaore.schore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/g; __str.replace(__re, "$\'" + \'sch\')===\'She sells seaells by the seashore.schells by the seaore.schore.\'. Actual: '+__str.replace(__re, "$'" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T6.js new file mode 100644 index 000000000..2132951be --- /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.11_String.prototype.replace/S15.5.4.11_A2_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.5.4.11_A2_T6; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Don`t use $ in replaceValue, searchValue is regular expression /sh/; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, 'sch')!=='She sells seaschells by the seashore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/; __str.replace(__re, \'sch\')===\'She sells seaschells by the seashore.\'. Actual: '+__str.replace(__re, 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T7.js new file mode 100644 index 000000000..c77d0a05c --- /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.11_String.prototype.replace/S15.5.4.11_A2_T7.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.11_A2_T7; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $$ in replaceValue, searchValue is regular expression /sh/; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$$" + 'sch')!=='She sells sea$schells by the seashore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/; __str.replace(__re, "$$" + \'sch\')===\'She sells sea$schells by the seashore.\'. Actual: '+__str.replace(__re, "$$" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T8.js new file mode 100644 index 000000000..3192caa4e --- /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.11_String.prototype.replace/S15.5.4.11_A2_T8.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.11_A2_T8; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $& in replaceValue, searchValue is regular expression /sh/; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$&" + 'sch')!=='She sells seashschells by the seashore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/; __str.replace(__re, "$&" + \'sch\')===\'She sells seashschells by the seashore.\'. Actual: '+__str.replace(__re, "$&" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A2_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.11_String.prototype.replace/S15.5.4.11_A2_T9.js new file mode 100644 index 000000000..95b51f9e2 --- /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.11_String.prototype.replace/S15.5.4.11_A2_T9.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.11_A2_T9; +* @section: 15.5.4.11; +* @assertion: The $ replacements are done left-to-right, and, once such are placement is performed, the new +* replacement text is not subject to further replacements; +* @description: Use $` in replaceValue, searchValue is regular expression /sh/; +*/ + +var __str = 'She sells seashells by the seashore.'; +var __re = /sh/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$`" + 'sch')!=='She sells seaShe sells seaschells by the seashore.') { + $ERROR('#1: var __str = \'She sells seashells by the seashore.\'; var __re = /sh/; __str.replace(__re, "$`" + \'sch\')===\'She sells seaShe sells seaschells by the seashore.\'. Actual: '+__str.replace(__re, "$`" + 'sch')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A3_T1.js new file mode 100644 index 000000000..dc15597dd --- /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.11_String.prototype.replace/S15.5.4.11_A3_T1.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.11_A3_T1; +* @section: 15.5.4.11; +* @assertion: replace with regexp /(uid=)(\d+)/ returns; +* @description: replaceValue is "$11" + 15; +*/ + +var __str = 'uid=31'; +var __re = /(uid=)(\d+)/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$11" + 15)!=='uid=115') { + $ERROR('#1: var __str = \'uid=31\'; var __re = /(uid=)(\d+)/; __str.replace(__re, "$11" + 15)===\'uid=115\'. Actual: '+__str.replace(__re, "$11" + 15)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A3_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.11_String.prototype.replace/S15.5.4.11_A3_T2.js new file mode 100644 index 000000000..f2a39b287 --- /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.11_String.prototype.replace/S15.5.4.11_A3_T2.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.11_A3_T2; +* @section: 15.5.4.11; +* @assertion: replace with regexp /(uid=)(\d+)/ returns; +* @description: replaceValue is "$11" + '15'; +*/ + +var __str = 'uid=31'; +var __re = /(uid=)(\d+)/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$11" + '15')!=='uid=115') { + $ERROR('#1: var __str = \'uid=31\'; var __re = /(uid=)(\d+)/; __str.replace(__re, "$11" + \'15\')===\'uid=115\'. Actual: '+__str.replace(__re, "$11" + '15')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_A3_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.11_String.prototype.replace/S15.5.4.11_A3_T3.js new file mode 100644 index 000000000..8d61d571d --- /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.11_String.prototype.replace/S15.5.4.11_A3_T3.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.11_A3_T3; +* @section: 15.5.4.11; +* @assertion: replace with regexp /(uid=)(\d+)/ returns; +* @description: replaceValue is "$11" + 'A15'; +*/ + +var __str = 'uid=31'; +var __re = /(uid=)(\d+)/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__re, "$11" + 'A15')!=='uid=1A15' ) { + $ERROR('#1: var __str = \'uid=31\'; var __re = /(uid=)(\d+)/; __str.replace(__re, "$11" + \'A15\')===\'uid=1A15\' . Actual: '+__str.replace(__re, "$11" + 'A15')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A4_T1.js new file mode 100644 index 000000000..e8f5c85e3 --- /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.11_String.prototype.replace/S15.5.4.11_A4_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.5.4.11_A4_T1; +* @section: 15.5.4.11; +* @assertion: replace with regexp /([a-z]+)([0-9]+)/ and replace function returns ; +* @description: searchValue is /([a-z]+)([0-9]+)/; +*/ + +var __str = "abc12 def34"; +var __pattern = /([a-z]+)([0-9]+)/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__pattern, __replFN)!=='12abc def34') { + $ERROR('#1: var __str = "abc12 def34"; var __pattern = /([a-z]+)([0-9]+)/; function __replFN() {return arguments[2] + arguments[1];}; __str.replace(__pattern, __replFN)===\'12abc def34\'. Actual: '+__str.replace(__pattern, __replFN)); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __replFN() { + return arguments[2] + arguments[1]; +} 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A4_T2.js new file mode 100644 index 000000000..25ccb596a --- /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.11_String.prototype.replace/S15.5.4.11_A4_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.5.4.11_A4_T2; +* @section: 15.5.4.11; +* @assertion: replace with regexp /([a-z]+)([0-9]+)/ and replace function returns ; +* @description: searchValue is /([a-z]+)([0-9]+)/g; +*/ + +var __str = "abc12 def34"; +var __pattern = /([a-z]+)([0-9]+)/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__pattern, __replFN)!=='12abc 34def') { + $ERROR('#1: var __str = "abc12 def34"; var __pattern = /([a-z]+)([0-9]+)/g; function __replFN() {return arguments[2] + arguments[1];}; __str.replace(__pattern, __replFN)===\'12abc 34def\'. Actual: '+__str.replace(__pattern, __replFN)); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __replFN() { + return arguments[2] + arguments[1]; +} 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A4_T3.js new file mode 100644 index 000000000..e73d38246 --- /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.11_String.prototype.replace/S15.5.4.11_A4_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.5.4.11_A4_T3; +* @section: 15.5.4.11; +* @assertion: replace with regexp /([a-z]+)([0-9]+)/ and replace function returns ; +* @description: searchValue is /([a-z]+)([0-9]+)/i; +*/ + +var __str = "aBc12 def34"; +var __pattern = /([a-z]+)([0-9]+)/i; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__pattern, __replFN)!=='12aBc def34') { + $ERROR('#1: var __str = "aBc12 def34"; var __pattern = /([a-z]+)([0-9]+)/i; function __replFN() {return arguments[2] + arguments[1];}; __str.replace(__pattern, __replFN)===\'12aBc def34\'. Actual: '+__str.replace(__pattern, __replFN)); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __replFN() { + return arguments[2] + arguments[1]; +} 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A4_T4.js new file mode 100644 index 000000000..1f30e2bfe --- /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.11_String.prototype.replace/S15.5.4.11_A4_T4.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.5.4.11_A4_T4; +* @section: 15.5.4.11; +* @assertion: replace with regexp /([a-z]+)([0-9]+)/ and replace function returns ; +* @description: searchValue is /([a-z]+)([0-9]+)/ig; +*/ + +var __str = "aBc12 dEf34"; +var __pattern = /([a-z]+)([0-9]+)/ig; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__pattern, __replFN)!=='12aBc 34dEf') { + $ERROR('#1: var __str = "aBc12 dEf34"; var __pattern = /([a-z]+)([0-9]+)/ig; function __replFN() {return arguments[2] + arguments[1];}; __str.replace(__pattern, __replFN)===\'12aBc 34dEf\'. Actual: '+__str.replace(__pattern, __replFN)); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __replFN() { + return arguments[2] + arguments[1]; +} 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.11_String.prototype.replace/S15.5.4.11_A5_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.11_String.prototype.replace/S15.5.4.11_A5_T1.js new file mode 100644 index 000000000..1184863cb --- /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.11_String.prototype.replace/S15.5.4.11_A5_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.11_A5_T1; +* @section: 15.5.4.11; +* @assertion: Use replace with regexp as searchValue and use $ in replaceValue; +* @description: searchValue is regexp /^(a+)\1*,\1+$/ and replaceValue is "$1"; +*/ + +var __str = "aaaaaaaaaa,aaaaaaaaaaaaaaa"; +var __pattern = /^(a+)\1*,\1+$/; +var __repl = "$1"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str.replace(__pattern, __repl)!=='aaaaa') { + $ERROR('#1: var __str = "aaaaaaaaaa,aaaaaaaaaaaaaaa"; var __pattern = /^(a+)\1*,\1+$/; var __repl = "$1"; __str.replace(__pattern, __repl)===\'aaaaa\'. Actual: '+__str.replace(__pattern, __repl)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A6.js new file mode 100644 index 000000000..61270a45a --- /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.11_String.prototype.replace/S15.5.4.11_A6.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.11_A6; +* @section: 15.5.4.11, 13.2; +* @assertion: String.prototype.replace has not prototype property; +* @description: Checking String.prototype.replace.prototype; +* +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.replace.prototype !== undefined) { + $ERROR('#1: String.prototype.replace.prototype === undefined. Actual: '+String.prototype.replace.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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A7.js new file mode 100644 index 000000000..d8fc135e9 --- /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.11_String.prototype.replace/S15.5.4.11_A7.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.5.4.11_A7; +* @section: 15.5.4.11, 13.2; +* @assertion: String.prototype.replace can't be used as constructor; +* @description: Checking if creating the String.prototype.replace object fails; +*/ + +var __FACTORY = String.prototype.replace; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.replace; "__instance = new __FACTORY" lead to throwing exception'); +} catch (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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A8.js new file mode 100644 index 000000000..5e633f017 --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A8; +* @section: 15.5.4.11; +* @assertion: The String.prototype.replace.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.replace.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.replace.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.replace.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.replace.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.replace.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.replace.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +count=0; + +for (p in String.prototype.replace){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.replace){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.11_String.prototype.replace/S15.5.4.11_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.11_String.prototype.replace/S15.5.4.11_A9.js new file mode 100644 index 000000000..7398575d5 --- /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.11_String.prototype.replace/S15.5.4.11_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.11_A9; +* @section: 15.5.4.11; +* @assertion: The String.prototype.replace.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.replace.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.replace.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.replace.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.replace.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.replace.length) { + $ERROR('#1: delete String.prototype.replace.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.replace.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.replace.length; String.prototype.replace.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.replace.hasOwnProperty('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.12_String.prototype.search/S15.5.4.12_A1.1_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.12_String.prototype.search/S15.5.4.12_A1.1_T1.js new file mode 100644 index 000000000..57e8374d8 --- /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.12_String.prototype.search/S15.5.4.12_A1.1_T1.js @@ -0,0 +1,15 @@ +// 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.12_A1.1_T1; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) without arguments behaves like with argument "undefined"; +* @description: Call search() is the same search(undefined); +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +var x = "".search(); +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A10.js new file mode 100644 index 000000000..917dca86b --- /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.12_String.prototype.search/S15.5.4.12_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.12_A10; +* @section: 15.5.4.12; +* @assertion: The String.prototype.search.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.search.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.search.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.search.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.search.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.search.length; + +String.prototype.search.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.search.length !== __obj) { + $ERROR('#2: __obj = String.prototype.search.length; String.prototype.search.length = function(){return "shifted";}; String.prototype.search.length === __obj. Actual: '+String.prototype.search.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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A11.js new file mode 100644 index 000000000..4b55a900a --- /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.12_String.prototype.search/S15.5.4.12_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.12_A11; +* @section: 15.5.4.12; +* @assertion: The length property of the search method is 1; +* @description: Checking String.prototype.search.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.search.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.search.hasOwnProperty("length") return true. Actual: '+String.prototype.search.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.search.length !== 1) { + $ERROR('#2: String.prototype.search.length === 1. Actual: '+String.prototype.search.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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T1.js new file mode 100644 index 000000000..88c7ca3d7 --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T1; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.search = String.prototype.search; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.search(true) !== 0) { + $ERROR('#1: __instance = new Object(true); __instance.search = String.prototype.search; __instance.search(true) === 0. Actual: '+__instance.search(true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T10.js new file mode 100644 index 000000000..40d29a11f --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T10; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is object, and instance is string. +* Object with overrided toString function; +*/ + +var __obj = {toString:function(){return "\u0041B";}}; +var __str = "ssABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (search(__obj) !==2) { + $ERROR('#1: var __obj = {toString:function(){return "\u0041B";}}; var __str = "ssABB\u0041BABAB"; search(__obj) ===2. Actual: '+search(__obj) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T11.js new file mode 100644 index 000000000..fedf124ad --- /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.12_String.prototype.search/S15.5.4.12_A1_T11.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.12_A1_T11; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is object, and instance is string. +* Object with overrided toString function, that throw exception; +*/ + +var __obj = {toString:function(){throw "intostr";}} +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = search(__obj); + $FAIL('#1: var x = search(__obj) 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T12.js new file mode 100644 index 000000000..5c94d89f7 --- /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.12_String.prototype.search/S15.5.4.12_A1_T12.js @@ -0,0 +1,28 @@ +// 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.12_A1_T12; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is object, and instance is string. +* Object with overrided toString and valueOf functions, valueOf throw exception; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = search(__obj); + $FAIL('#1: var x = search(__obj) 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.12_String.prototype.search/S15.5.4.12_A1_T13.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.12_String.prototype.search/S15.5.4.12_A1_T13.js new file mode 100644 index 000000000..aa96b1d16 --- /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.12_String.prototype.search/S15.5.4.12_A1_T13.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.12_A1_T13; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is object, and instance is string. +* Object with overrided toString and valueOf functions; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041B\u0031ABAB\u0031BBAA".search(__obj) !==5) { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; "ABB\\u0041B\\u0031ABAB\\u0031BBAA".search(__obj) ===5. Actual: '+("ABB\u0041B\u0031ABAB\u0031BBAA".search(__obj)) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A1_T14.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.12_String.prototype.search/S15.5.4.12_A1_T14.js new file mode 100644 index 000000000..19d187f3c --- /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.12_String.prototype.search/S15.5.4.12_A1_T14.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.5.4.12_A1_T14; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Instance is string, argument is regular expression; +*/ + +var __reg = new RegExp("77"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB\u0037\u0037BBAA".search(__reg) !== 9) { + $ERROR('#1: var __reg = new RegExp("77"); "ABB\\u0041BABAB\\u0037\\u0037BBAA".search(__reg) === 9. Actual: '+("ABB\u0041BABAB\u0037\u0037BBAA".search(__reg)) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T2.js new file mode 100644 index 000000000..ff9eeb38d --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T2; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is function call, and instance is Boolean; +*/ + +var __instance = new Boolean; + +__instance.search = String.prototype.search; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.search(function(){return false;}()) !== 0) { + $ERROR('#1: __instance = new Boolean; __instance.search = String.prototype.search; __instance.search(function(){return false;}()) === 0. Actual: '+__instance.search(function(){return 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T3.js new file mode 100644 index 000000000..56cb76648 --- /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.12_String.prototype.search/S15.5.4.12_A1_T3.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.12_A1_T3; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Checking by using eval; +*/ + +var search = String.prototype.search; + +if (typeof toString === "undefined"){ + var toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (search(eval("\"bj\"")) !== 2) { + $ERROR('#1: search = String.prototype.search; search(eval("\\"bj\\"")) === 2. Actual: '+search(eval("\"bj\"")) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T4.js new file mode 100644 index 000000000..8e54bcb94 --- /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.12_String.prototype.search/S15.5.4.12_A1_T4.js @@ -0,0 +1,22 @@ +// 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.12_A1_T4; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Call search (regexp) without arguments; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString() evaluates to "" search() evaluates to search("") +if ("".search() !== 0) { + $ERROR('#1: "".search() === 0. Actual: '+("".search()) ); +} + +if ("--undefined--".search() != 0) { + $ERROR('#1: "--undefined--".search() === 0. Actual: '+("--undefined--".search()) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T5.js new file mode 100644 index 000000000..27dd7d294 --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T5; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is null, and instance is function call, that return string; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" search(null) evaluates to search("null") +if (function(){return "gnulluna"}().search(null) !== 1) { + $ERROR('#1: function(){return "gnulluna"}().search(null) === 1. Actual: '+function(){return "gnulluna"}().search(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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T6.js new file mode 100644 index 000000000..6e75174dd --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T6; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is x, and instance is new String, x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" search(undefined) evaluates to search("undefined") +if (new String("undefined").search(x) !== 0) { + $ERROR('#1: var x; new String("undefined").search(x) === 0. Actual: '+new String("undefined").search(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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T7.js new file mode 100644 index 000000000..84aef0e1d --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T7; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is undefined, and instance is new String; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" search(undefined) evaluates to search("undefined") +if (String("undefined").search(undefined) !== 0) { + $ERROR('#1: String("undefined").search(undefined) === 0. Actual: '+String("undefined").search(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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T8.js new file mode 100644 index 000000000..1bbc091ed --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T8; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is void 0, and instance is String object with overrided toString function; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(void 0) evaluates to "undefined" search(void 0) evaluates to search("undefined") +if (String(__obj).search(void 0) !== 0) { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).search(void 0) === 0. Actual: '+String(__obj).search(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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A1_T9.js new file mode 100644 index 000000000..db199230b --- /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.12_String.prototype.search/S15.5.4.12_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.12_A1_T9; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp); +* @description: Argument is function call, and instance is String object with overrided toString and valueOf functions; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" search(undefined) evaluates to search("undefined") +if (new String(__obj).search(function(){}()) !== 0) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).search(function(){}()) === 0. Actual: '+new String(__obj).search(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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T1.js new file mode 100644 index 000000000..58c06f3b0 --- /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.12_String.prototype.search/S15.5.4.12_A2_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.5.4.12_A2_T1; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Simple search substring inside string; +*/ + +var aString = new String("test string"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search("string")!== 5) { + $ERROR('#1: var aString = new String("test string"); aString.search("string")=== 5. Actual: '+aString.search("string")); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T2.js new file mode 100644 index 000000000..0af5e37cb --- /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.12_String.prototype.search/S15.5.4.12_A2_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.5.4.12_A2_T2; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Checking case sensitive of search, argument is string; +*/ + +var aString = new String("test string"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search("String")!== -1) { + $ERROR('#1: var aString = new String("test string"); aString.search("String")=== -1. Actual: '+aString.search("String")); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T3.js new file mode 100644 index 000000000..771b4d335 --- /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.12_String.prototype.search/S15.5.4.12_A2_T3.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.5.4.12_A2_T3; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Checking disabling of case sensitive of search, argument is RegExp; +*/ + +var aString = new String("test string"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search(/String/i)!== 5) { + $ERROR('#1: var aString = new String("test string"); aString.search(/String/i)=== 5. Actual: '+aString.search(/String/i)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T4.js new file mode 100644 index 000000000..2d93e3a99 --- /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.12_String.prototype.search/S15.5.4.12_A2_T4.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.12_A2_T4; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Checking case sensitive of search, argument is RegExp with uppercase symbols; +*/ + +var bString = new String("one two three four five"); +var regExp = /Four/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (bString.search(regExp)!== -1) { + $ERROR('#1: var bString = new String("one two three four five"); var regExp = /Four/; bString.search(regExp)=== -1. Actual: '+bString.search(regExp)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T5.js new file mode 100644 index 000000000..bcb90fce9 --- /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.12_String.prototype.search/S15.5.4.12_A2_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.5.4.12_A2_T5; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Checking case sensitive of search, argument is RegExp without uppercase symbols; +*/ + +var bString = new String("one two three four five"); +var regExp = /four/; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (bString.search(regExp)!== 14) { + $ERROR('#1: var bString = new String("one two three four five"); var regExp = /four/; bString.search(regExp)=== 14. Actual: '+bString.search(regExp)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T6.js new file mode 100644 index 000000000..2aba1ce03 --- /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.12_String.prototype.search/S15.5.4.12_A2_T6.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.5.4.12_A2_T6; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Searching the non-existent "notexist" substring; +*/ + +var aString = new String("test string"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search("notexist")!== -1) { + $ERROR('#1: var aString = new String("test string"); aString.search("notexist")=== -1. Actual: '+aString.search("notexist")); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A2_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.12_String.prototype.search/S15.5.4.12_A2_T7.js new file mode 100644 index 000000000..60630f874 --- /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.12_String.prototype.search/S15.5.4.12_A2_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.5.4.12_A2_T7; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) returns ...; +* @description: Simple search sentence inside string; +*/ + +var aString = new String("test string probe"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search("string pro")!== 5) { + $ERROR('#1: var aString = new String("test string probe"); aString.search("string pro")=== 5. Actual: '+aString.search("string pro")); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A3_T1.js new file mode 100644 index 000000000..52ac1cc2f --- /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.12_String.prototype.search/S15.5.4.12_A3_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.5.4.12_A3_T1; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) ignores global properties of regexp; +* @description: Checking results of search regexp with and without global properties; +*/ + +var aString = new String("power of the power of the power of the power of the power of the power of the great sword"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search(/the/)!== aString.search(/the/g)) { + $ERROR('#1: var aString = new String("power of the power of the power of the power of the power of the power of the great sword"); aString.search(/the/)=== aString.search(/the/g). Actual: '+aString.search(/the/)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_A3_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.12_String.prototype.search/S15.5.4.12_A3_T2.js new file mode 100644 index 000000000..3a1da2d4e --- /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.12_String.prototype.search/S15.5.4.12_A3_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.5.4.12_A3_T2; +* @section: 15.5.4.12; +* @assertion: String.prototype.search (regexp) ignores global properties of regexp; +* @description: Checking results of search regexp with and without global properties. Unicode symbols used; +*/ + +var aString = new String("power \u006F\u0066 the power of the power \u006F\u0066 the power of the power \u006F\u0066 the power of the great sword"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (aString.search(/of/)!== aString.search(/of/g)) { + $ERROR('#1: var aString = new String("power \\u006F\\u0066 the power of the power \\u006F\\u0066 the power of the power \\u006F\\u0066 the power of the great sword"); aString.search(/of/)=== aString.search(/of/g). Actual: '+aString.search(/of/)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A6.js new file mode 100644 index 000000000..dff58815e --- /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.12_String.prototype.search/S15.5.4.12_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.12_A6; +* @section: 15.5.4.12, 13.2; +* @assertion: String.prototype.search has not prototype property; +* @description: Checking String.prototype.search.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.search.prototype !== undefined) { + $ERROR('#1: String.prototype.search.prototype === undefined. Actual: '+String.prototype.search.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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A7.js new file mode 100644 index 000000000..7519d946f --- /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.12_String.prototype.search/S15.5.4.12_A7.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.12_A7; +* @section: 15.5.4.12, 13.2; +* @assertion: String.prototype.search can't be used as constructor; +* @description: Checking if creating the String.prototype.search object fails; +*/ + +var __FACTORY = String.prototype.search; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.search; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.1: __FACTORY = String.prototype.search; "__instance = new __FACTORY" throw a TypeError. Actual: ' + (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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A8.js new file mode 100644 index 000000000..a2516696a --- /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.12_String.prototype.search/S15.5.4.12_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.12_A8; +* @section: 15.5.4.12; +* @assertion: The String.prototype.search.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.search.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.search.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.search.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.search.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.search.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.search.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.search){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.search){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.12_String.prototype.search/S15.5.4.12_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.12_String.prototype.search/S15.5.4.12_A9.js new file mode 100644 index 000000000..30c3245af --- /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.12_String.prototype.search/S15.5.4.12_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.12_A9; +* @section: 15.5.4.12; +* @assertion: The String.prototype.search.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.search.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.search.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.search.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.search.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.search.length) { + $ERROR('#1: delete String.prototype.search.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.search.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.search.length; String.prototype.search.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.search.hasOwnProperty('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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A10.js new file mode 100644 index 000000000..72a17a3ab --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A10; +* @section: 15.5.4.13; +* @assertion: The String.prototype.slice.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.slice.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.slice.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.slice.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.slice.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.slice.length; + +String.prototype.slice.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.slice.length !== __obj) { + $ERROR('#2: __obj = String.prototype.slice.length; String.prototype.slice.length = function(){return "shifted";}; String.prototype.slice.length === __obj. Actual: '+String.prototype.slice.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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A11.js new file mode 100644 index 000000000..5253c22e7 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A11; +* @section: 15.5.4.13; +* @assertion: The length property of the slice method is 2; +* @description: Checking String.prototype.slice.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.slice.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.slice.hasOwnProperty("length") return true. Actual: '+String.prototype.slice.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.slice.length !== 2) { + $ERROR('#2: String.prototype.slice.length === 2. Actual: '+String.prototype.slice.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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T1.js new file mode 100644 index 000000000..b84d3cb6f --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T1; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.slice = String.prototype.slice; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(false, true) !== "t") { + $ERROR('#1: __instance = new Object(true); __instance.slice = String.prototype.slice; __instance.slice(false, true) === "t". Actual: '+__instance.slice(false, true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T10.js new file mode 100644 index 000000000..07e6ff530 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T10; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are object and function call, and instance is String, object have overrided valueOf function; +*/ + +var __obj = {valueOf:function(){return 2;}}; + +var __str = "\u0035ABBBABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (slice(__obj, function(){return slice(0,1);}()) !== "BBB") { + $ERROR('#1: var x; var __obj = {valueOf:function(){return 2;}}; var __str = "\u0035ABBBABAB"; slice(__obj, function(){return slice(0,1);}()) === "BBB". Actual: '+slice(__obj, function(){return slice(0,1);}()) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T11.js new file mode 100644 index 000000000..107417e2b --- /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.13_String.prototype.slice/S15.5.4.13_A1_T11.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.13_A1_T11; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are objects, and instance is string, objects have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = slice(__obj,__obj2); + $FAIL('#1: "var x = slice(__obj,__obj2)" lead to throwing exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception === "instart". 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T12.js new file mode 100644 index 000000000..24f8dd936 --- /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.13_String.prototype.slice/S15.5.4.13_A1_T12.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.13_A1_T12; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf function and toString function, that return exception. +* Second object have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = slice(__obj, __obj2); + $FAIL('#1: "var x = slice(__obj,__obj2)" lead to throwing exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception === "instart". 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.13_String.prototype.slice/S15.5.4.13_A1_T13.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.13_String.prototype.slice/S15.5.4.13_A1_T13.js new file mode 100644 index 000000000..ebee3d455 --- /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.13_String.prototype.slice/S15.5.4.13_A1_T13.js @@ -0,0 +1,28 @@ +// 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.13_A1_T13; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf and toString functions. +* Second object have overrided toString function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){return 1;}}; +var __obj2 = {toString:function(){throw "inend";}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = "ABB\u0041BABAB\u0031BBAA".slice(__obj, __obj2); + $FAIL('#1: "var x = slice(__obj,__obj2)" lead to throwing exception'); +} catch (e) { + if (e!=="inend") { + $ERROR('#1.1: Exception === "inend". 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.13_String.prototype.slice/S15.5.4.13_A1_T14.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.13_String.prototype.slice/S15.5.4.13_A1_T14.js new file mode 100644 index 000000000..2bdc40b19 --- /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.13_String.prototype.slice/S15.5.4.13_A1_T14.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.13_A1_T14; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Used one argument, that is function(){}(). Instance is string; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("report".slice(function(){}()) !== "report") { + $ERROR('#1: "report".slice(function(){}()) === "report". Actual: '+"report".slice(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.13_String.prototype.slice/S15.5.4.13_A1_T15.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.13_String.prototype.slice/S15.5.4.13_A1_T15.js new file mode 100644 index 000000000..03351633e --- /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.13_String.prototype.slice/S15.5.4.13_A1_T15.js @@ -0,0 +1,22 @@ +// 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.13_A1_T15; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Call slice without arguments. Instance is Number with prototype.slice = String.prototype.slice; +*/ + +var __num = 11.001002; + +Number.prototype.slice = String.prototype.slice; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.slice()!=="11.001002") { + $ERROR('#1: var __num = 11.001002; Number.prototype.slice = String.prototype.slice; __num.slice()==="11.001002". Actual: '+__num.slice()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T2.js new file mode 100644 index 000000000..f4d6caeb8 --- /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.13_String.prototype.slice/S15.5.4.13_A1_T2.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.13_A1_T2; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are function call and x, and instance is Boolean. x is undefined variable; +*/ + +var __instance = new Boolean; + +__instance.slice = String.prototype.slice; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(function(){return true;}(),x) !== "alse") { + $ERROR('#1: var x; __instance = new Boolean; __instance.slice = String.prototype.slice; __instance.slice(function(){return true;}(),x) === "alse". Actual: '+__instance.slice(function(){return true;}(),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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T3.js new file mode 100644 index 000000000..90ec8481c --- /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.13_String.prototype.slice/S15.5.4.13_A1_T3.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.5.4.13_A1_T3; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Checking by using eval; +*/ + +var slice = String.prototype.slice; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); +var __toggle = 1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (slice(eval("\"1\""),{valueOf:function(){return "0x0007"}})!=="object") { + $ERROR('#1: slice = String.prototype.slice; slice(eval("\\"1\\""),{valueOf:function(){return "0x0007"}})==="object". Actual: '+slice(eval("\"1\""),{valueOf:function(){return "0x0007"}})); +}; +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T4.js new file mode 100644 index 000000000..44ba58625 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T4; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are null and number, and instance is function call, that returned string; +*/ + +//since ToInteger(null) yelds 0 +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (function(){return "gnulluna"}().slice(null, -3) !== "gnull") { + $ERROR('#1: function(){return "gnulluna"}().slice(null, -3) === "gnull". Actual: '+function(){return "gnulluna"}().slice(null, -3) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T5.js new file mode 100644 index 000000000..23a2db408 --- /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.13_String.prototype.slice/S15.5.4.13_A1_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.5.4.13_A1_T5; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are null and call other slice(start, end), and instance is function object, that have overrided valueOf and toString functions; +*/ + +__func.valueOf=function(){return "gnulluna"}; +__func.toString=function(){return __func;}; + +Function.prototype.slice=String.prototype.slice; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__func.slice(null, Function().slice(__func,5).length) !== "gnull") { + $ERROR('#1: __func.slice(null, Function().slice(__func,5).length) === "gnull". Actual: '+__func.slice(null, Function().slice(__func,5).length) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __func(){}; 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T6.js new file mode 100644 index 000000000..d2bb25886 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T6; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are x and number, and instance is new String, x is undefined variable; +*/ + +//since ToInteger(undefined yelds 0) +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String("undefined").slice(x,3) !== "und") { + $ERROR('#1: var x; new String("undefined").slice(x,3) === "und". Actual: '+new String("undefined").slice(x,3) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T7.js new file mode 100644 index 000000000..313158932 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T7; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are symbol and undefined, and instance is String; +*/ + +//since ToInteger("e") yelds 0 +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(void 0).slice("e",undefined) !== "undefined") { + $ERROR('#1: String(void 0).slice("e",undefined) === "undefined". Actual: '+String(void 0).slice("e",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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T8.js new file mode 100644 index 000000000..040090f31 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T8; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are negative number and void 0, and instance is String(object), object have overrided toString function; +*/ + +__obj = {toString:function(){}}; + +//since void 0 yelds 0 +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(__obj).slice(-4,void 0) !== "ined") { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).slice(-4,void 0) === "ined". Actual: '+String(__obj).slice(-4,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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A1_T9.js new file mode 100644 index 000000000..5d6011ec1 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A1_T9; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end); +* @description: Arguments are undefined and object, and instance is String(object), object have overrided valueOf and toString functions; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +//since ToInteger(undefined) yelds 0 +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String(__obj).slice(/*(function(){})()*/undefined,__obj) !== "") { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).slice(//*(function(){})()*//undefined,__obj) === "". Actual: '+new String(__obj).slice(/*(function(){})()*/undefined,__obj) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T1.js new file mode 100644 index 000000000..71d823582 --- /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.13_String.prototype.slice/S15.5.4.13_A2_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.5.4.13_A2_T1; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: Checking type of slice(); +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __string.slice() !== "string") { + $ERROR('#1: __string = new String("this is a string object"); typeof __string.slice() === "string". Actual: '+typeof __string.slice() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T2.js new file mode 100644 index 000000000..a75078877 --- /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.13_String.prototype.slice/S15.5.4.13_A2_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.5.4.13_A2_T2; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is NaN, end is Infinity; +*/ + +var __string = new String('this is a string object'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(NaN, Infinity) !== "this is a string object") { + $ERROR('#1: __string = new String(\'this is a string object\'); __string.slice(NaN, Infinity) === "this is a string object". Actual: '+__string.slice(NaN, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T3.js new file mode 100644 index 000000000..dd58c257b --- /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.13_String.prototype.slice/S15.5.4.13_A2_T3.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.5.4.13_A2_T3; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: Call slice from empty String object; +*/ + +var __string = new String(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(1,0) !== "") { + $ERROR('#1: __string = new String(""); __string.slice(1,0) === "". Actual: '+__string.slice(1,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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T4.js new file mode 100644 index 000000000..7939f0fa5 --- /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.13_String.prototype.slice/S15.5.4.13_A2_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.5.4.13_A2_T4; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is Infinity, end is NaN; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(Infinity, NaN) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(Infinity, NaN) === "". Actual: '+__string.slice(Infinity, NaN) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T5.js new file mode 100644 index 000000000..da3016cd6 --- /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.13_String.prototype.slice/S15.5.4.13_A2_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.5.4.13_A2_T5; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is Infinity, end is Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(Infinity, Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(Infinity, Infinity) === "". Actual: '+__string.slice(Infinity, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T6.js new file mode 100644 index 000000000..bcc6a41aa --- /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.13_String.prototype.slice/S15.5.4.13_A2_T6.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.5.4.13_A2_T6; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is negative float number, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(-0.01,0) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(-0.01,0) === "". Actual: '+__string.slice(-0.01,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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T7.js new file mode 100644 index 000000000..29364f704 --- /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.13_String.prototype.slice/S15.5.4.13_A2_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.5.4.13_A2_T7; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is tested_string.length, end is tested_string.length; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(__string.length, __string.length) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(__string.length, __string.length) === "". Actual: '+__string.slice(__string.length, __string.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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T8.js new file mode 100644 index 000000000..03a17a298 --- /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.13_String.prototype.slice/S15.5.4.13_A2_T8.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.5.4.13_A2_T8; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is tested_string.length+1, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(__string.length+1, 0) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(__string.length+1, 0) === "". Actual: '+__string.slice(__string.length+1, 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.13_String.prototype.slice/S15.5.4.13_A2_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.13_String.prototype.slice/S15.5.4.13_A2_T9.js new file mode 100644 index 000000000..36c5e99c8 --- /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.13_String.prototype.slice/S15.5.4.13_A2_T9.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.5.4.13_A2_T9; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) returns a string value(not object); +* @description: start is -Infinity, end is -Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.slice(-Infinity, -Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.slice(-Infinity, -Infinity) === "". Actual: '+__string.slice(-Infinity, -Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A3_T1.js new file mode 100644 index 000000000..403ed2552 --- /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.13_String.prototype.slice/S15.5.4.13_A3_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.13_A3_T1; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) can be applied to object instances; +* @description: Apply String.prototype.slice to Object instance; +*/ + +var __instance = new Object(); + +__instance.slice = String.prototype.slice; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(0,8) !== "[object ") { + $ERROR('#1: __instance = new Object(); __instance.slice = String.prototype.slice; __instance.slice(0,8) === "[object ". Actual: '+__instance.slice(0,8) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A3_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.13_String.prototype.slice/S15.5.4.13_A3_T2.js new file mode 100644 index 000000000..4976e94b4 --- /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.13_String.prototype.slice/S15.5.4.13_A3_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.13_A3_T2; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) can be applied to object instances; +* @description: Apply String.prototype.slice to Object instance, use other value for start and end values; +*/ + +var __instance = new Object(); + +__instance.slice = String.prototype.slice; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(8,__instance.toString().length) !== "Object]") { + $ERROR('#1: __instance = new Object(); __instance.slice = String.prototype.slice; __instance.slice(8,__instance.toString().length) === "Object]". Actual: '+__instance.slice(8,__instance.toString().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.13_String.prototype.slice/S15.5.4.13_A3_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.13_String.prototype.slice/S15.5.4.13_A3_T3.js new file mode 100644 index 000000000..ba8b90a57 --- /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.13_String.prototype.slice/S15.5.4.13_A3_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.13_A3_T3; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) can be applied to object instances; +* @description: Apply String.prototype.slice to Object instance, and call instance.slice(...).slice(...); +*/ + +var __instance = function(){}; + +__instance.slice = String.prototype.slice; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(-Infinity,8).slice(1,Infinity) !== "unction") { + $ERROR('#1: __instance = function(){}; __instance.slice = String.prototype.slice; __instance.slice(-Infinity,8).slice(1,Infinity) === "unction". Actual: '+__instance.slice(-Infinity,8).slice(1,Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.13_String.prototype.slice/S15.5.4.13_A3_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.13_String.prototype.slice/S15.5.4.13_A3_T4.js new file mode 100644 index 000000000..073f735d6 --- /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.13_String.prototype.slice/S15.5.4.13_A3_T4.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.13_A3_T4; +* @section: 15.5.4.13; +* @assertion: String.prototype.slice (start, end) can be applied to object instances; +* @description: Checknig if applying String.prototype.slice to Function object instance passes; +*/ + +__FACTORY.prototype.toString = function() { return this.value+''; }; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.slice(0,100) !== "undefined") { + $ERROR('#1: __instance.slice(0,100) === "undefined". Actual: '+__instance.slice(0,100) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __FACTORY( value ) { + this.value = value, + this.slice= String.prototype.slice; + //this.substring = String.prototype.substring; +} 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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A6.js new file mode 100644 index 000000000..5c7df2ffc --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A6; +* @section: 15.5.4.13, 13.2; +* @assertion: String.prototype.slice has not prototype property; +* @description: Checking String.prototype.slice.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.slice.prototype !== undefined) { + $ERROR('#1: String.prototype.slice.prototype === undefined. Actual: '+String.prototype.slice.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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A7.js new file mode 100644 index 000000000..9d5b0d167 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A7; +* @section: 15.5.4.13, 13.2; +* @assertion: String.prototype.slice can't be used as constructor; +* @description: Checking if creating the String.prototype.slice object fails; +*/ + +var __FACTORY = String.prototype.slice; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.slice; "__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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A8.js new file mode 100644 index 000000000..34a710b33 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A8; +* @section: 15.5.4.13; +* @assertion: The String.prototype.slice.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.slice.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.slice.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.slice.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.slice.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.slice.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.slice.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.slice){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.slice){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.13_String.prototype.slice/S15.5.4.13_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.13_String.prototype.slice/S15.5.4.13_A9.js new file mode 100644 index 000000000..717cf9b66 --- /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.13_String.prototype.slice/S15.5.4.13_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.13_A9; +* @section: 15.5.4.13; +* @assertion: The String.prototype.slice.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.slice.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.slice.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.slice.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.slice.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.slice.length) { + $ERROR('#1: delete String.prototype.slice.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.slice.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.slice.length; String.prototype.slice.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.slice.hasOwnProperty('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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A10.js new file mode 100644 index 000000000..836bbb633 --- /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.14_String.prototype.split/S15.5.4.14_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.14_A10; +* @section: 15.5.4.14; +* @assertion: The String.prototype.split.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.split.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.split.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.split.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.split.length; + +String.prototype.split.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.split.length !== __obj) { + $ERROR('#2: __obj = String.prototype.split.length; String.prototype.split.length = function(){return "shifted";}; String.prototype.split.length === __obj. Actual: '+String.prototype.split.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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A11.js new file mode 100644 index 000000000..0e229893d --- /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.14_String.prototype.split/S15.5.4.14_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.14_A11; +* @section: 15.5.4.14; +* @assertion: The length property of the split method is 2; +* @description: Checking String.prototype.split.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.split.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.split.hasOwnProperty("length") return true. Actual: '+String.prototype.split.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.split.length !== 2) { + $ERROR('#2: String.prototype.split.length === 2. Actual: '+String.prototype.split.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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T1.js new file mode 100644 index 000000000..03d4858ac --- /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.14_String.prototype.split/S15.5.4.14_A1_T1.js @@ -0,0 +1,43 @@ +// 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.14_A1_T1; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.split = String.prototype.split; + +var __split = __instance.split(true, false); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 0) { + $ERROR('#3: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); __split.length === 0. Actual: '+__split.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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T10.js new file mode 100644 index 000000000..9931eb47b --- /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.14_String.prototype.split/S15.5.4.14_A1_T10.js @@ -0,0 +1,55 @@ +// 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.14_A1_T10; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function. +* Second object have overrided valueOf function; +*/ + +var __obj = {toString:function(){return "\u0042B";}} +var __obj2 = {valueOf:function(){return true;}} +var __str = "ABB\u0041BABAB"; + +with(__str){ + __split = split(__obj, __obj2); +} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; with(__str){__split = split(__obj, __obj2);}; typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; with(__str){__split = split(__obj, __obj2);}; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 1) { + $ERROR('#3: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; with(__str){__split = split(__obj, __obj2);}; __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "A") { + $ERROR('#4: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; with(__str){__split = split(__obj, __obj2);}; __split[0] === "A". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T11.js new file mode 100644 index 000000000..017e09945 --- /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.14_String.prototype.split/S15.5.4.14_A1_T11.js @@ -0,0 +1,36 @@ +// 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.14_A1_T11; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function. +* Second object have overrided valueOf function, that 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 = split(__obj, __obj2); + $FAIL('#1: "var x = split(__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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T12.js new file mode 100644 index 000000000..dab04cc63 --- /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.14_String.prototype.split/S15.5.4.14_A1_T12.js @@ -0,0 +1,34 @@ +// 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.14_A1_T12; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function. +* Second object have overrided valueOf function and toString function, that 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 = split(__obj, __obj2); + $FAIL('#1: "var x = split(__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.14_String.prototype.split/S15.5.4.14_A1_T13.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.14_String.prototype.split/S15.5.4.14_A1_T13.js new file mode 100644 index 000000000..b0a3db9ec --- /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.14_String.prototype.split/S15.5.4.14_A1_T13.js @@ -0,0 +1,60 @@ +// 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.14_A1_T13; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function. +* Second object have overrided valueOf and toString functions; +*/ + +var __obj = {toString:function(){return "\u0042\u0042";}} +var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}} + +var __split = "ABB\u0041BABAB\u0042cc^^\u0042Bvv%%B\u0042xxx".split(__obj, __obj2); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "A") { + $ERROR('#4: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split[0] === "A". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "ABABA") { + $ERROR('#5: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split[1] === "ABABA". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A1_T14.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.14_String.prototype.split/S15.5.4.14_A1_T14.js new file mode 100644 index 000000000..561a1f222 --- /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.14_String.prototype.split/S15.5.4.14_A1_T14.js @@ -0,0 +1,35 @@ +// 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.14_A1_T14; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function, that throw exception. +* Second object have overrided valueOf function, that throw exception; +*/ + +var __obj = {toString:function(){throw "intostr";}}; +var __obj2 = {valueOf:function(){throw "intoint";}}; +var __instance = new Number(10001.10001); +Number.prototype.split=String.prototype.split; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__instance){ + try { + var x = split(__obj, __obj2); + $FAIL('#1: "var x = split(__obj, __obj2)" lead to throwing exception'); + } catch (e) { + if (e!=="intoint") { + $ERROR('#1.1: Exception === "intoint". 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.14_String.prototype.split/S15.5.4.14_A1_T15.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.14_String.prototype.split/S15.5.4.14_A1_T15.js new file mode 100644 index 000000000..dd4be3267 --- /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.14_String.prototype.split/S15.5.4.14_A1_T15.js @@ -0,0 +1,42 @@ +// 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.14_A1_T15; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are objects, and instance is string. +* First object have overrided toString function and valueOf function, that throw exception. +* Second object have overrided valueOf function, that throw exception; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}}; + +var __obj2 = {valueOf:function(){throw "intointeger";}}; + +__FACTORY.prototype.split = String.prototype.split; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __instance.split(__obj, __obj2); + $FAIL('#1: "var x = __instance.split(__obj, __obj2)" lead to throwing exception'); +} catch (e) { + if (e!=="intointeger") { + $ERROR('#1.1: Exception === "intointeger". 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.14_String.prototype.split/S15.5.4.14_A1_T16.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.14_String.prototype.split/S15.5.4.14_A1_T16.js new file mode 100644 index 000000000..75e386747 --- /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.14_String.prototype.split/S15.5.4.14_A1_T16.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.14_A1_T16; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is object, and instance is Number. +* Object have overrided toString function, that return regexp; +*/ + +var __obj = {toString:function(){return /\u0037\u0037/g;}}; + +Number.prototype.split=String.prototype.split; + +try { + var __split = 6776767677.006771122677555.split(__obj); + $FAIL('#1: "__split = 6776767677.006771122677555.split(__obj)" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. 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.14_String.prototype.split/S15.5.4.14_A1_T17.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.14_String.prototype.split/S15.5.4.14_A1_T17.js new file mode 100644 index 000000000..34c81b8b5 --- /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.14_String.prototype.split/S15.5.4.14_A1_T17.js @@ -0,0 +1,75 @@ +// 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.14_A1_T17; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is regexp, and instance is Number; +*/ + +var __re = /\u0037\u0037/g; + +Number.prototype.split=String.prototype.split; + +__split = 6776767677.006771122677555.split(__re); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 4) { + $ERROR('#3: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split.length === 4. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "6") { + $ERROR('#4: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[0] === "6". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "67676") { + $ERROR('#5: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[1] === "67676". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__split[2] !== ".006") { + $ERROR('#6: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[2] === ".006". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (__split[3] !== "1") { + $ERROR('#7: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[3] === "1". Actual: '+__split[3] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A1_T18.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.14_String.prototype.split/S15.5.4.14_A1_T18.js new file mode 100644 index 000000000..1a64e9b0d --- /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.14_String.prototype.split/S15.5.4.14_A1_T18.js @@ -0,0 +1,51 @@ +// 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.14_A1_T18; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Checking by using eval; +*/ + +var __re = new RegExp("00"); + +Number.prototype.split=String.prototype.split; + +var __split = 6776767677.006771122677555.split(__re, eval("\"1\"")); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 1) { + $ERROR('#3: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "6776767677.") { + $ERROR('#3: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split[0] === "6776767677.". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T2.js new file mode 100644 index 000000000..9a2a4cd08 --- /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.14_String.prototype.split/S15.5.4.14_A1_T2.js @@ -0,0 +1,44 @@ +// 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.14_A1_T2; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Arguments are boolean expression, function call and null, and instance is Boolean; +*/ + + +var __instance = new Boolean; + +__instance.split = String.prototype.split; + +var __split = __instance.split("A"!=="\u0041", function(){return 0;}(),null); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 0) { + $ERROR('#3: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); __split.length === 0. Actual: '+__split.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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T3.js new file mode 100644 index 000000000..d034cea21 --- /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.14_String.prototype.split/S15.5.4.14_A1_T3.js @@ -0,0 +1,57 @@ +// 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.14_A1_T3; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Checking by using eval; +*/ + +var split = String.prototype.split; + +var __obj__lim = {valueOf:function(){return 5;}}; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); + +var __split = split(eval("\"[\""),__obj__lim); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[1].substring(0,6) !== "object") { + $ERROR('#4: __split[1].substring(0,6) === "object". Actual: '+__split[1].substring(0,6) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T4.js new file mode 100644 index 000000000..c7fcc3cb0 --- /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.14_String.prototype.split/S15.5.4.14_A1_T4.js @@ -0,0 +1,48 @@ +// 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.14_A1_T4; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Call split without arguments, and instance is empty string; +*/ + +//since ToString() evaluates to "" split() evaluates to split("",0) +var __split = "".split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __split = "".split(); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __split = "".split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 1) { + $ERROR('#3: __split = "".split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "") { + $ERROR('#4: __split = "".split(); __split[0] === "". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T5.js new file mode 100644 index 000000000..6df6fa77f --- /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.14_String.prototype.split/S15.5.4.14_A1_T5.js @@ -0,0 +1,56 @@ +// 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.14_A1_T5; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is null, and instance is function call that returned string; +*/ + +//since ToString(null) evaluates to "null" split(null) evaluates to split("null",0) +var __split = function(){return "gnulluna"}().split(null); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __split = function(){return "gnulluna"}().split(null); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __split = function(){return "gnulluna"}().split(null); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: __split = function(){return "gnulluna"}().split(null); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "g") { + $ERROR('#4: __split = function(){return "gnulluna"}().split(null); __split[0] === "g". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "una") { + $ERROR('#5: __split = function(){return "gnulluna"}().split(null); __split[1] === "una". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T6.js new file mode 100644 index 000000000..10f39ff7a --- /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.14_String.prototype.split/S15.5.4.14_A1_T6.js @@ -0,0 +1,58 @@ +// 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.14_A1_T6; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is x, and instance is new String. x is undefined variable; +*/ + +//since ToString(undefined) evaluates to "" split(undefined) evaluates to split("",0) +var __split = new String("1undefined").split(x); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: var x; __split = new String("1undefined").split(x); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: var x; __split = new String("1undefined").split(x); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: var x; __split = new String("1undefined").split(x); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "1") { + $ERROR('#4: var x; __split = new String("1undefined").split(x); __split[0] === "1". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "") { + $ERROR('#5: var x; __split = new String("1undefined").split(x); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T7.js new file mode 100644 index 000000000..ca92e15fd --- /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.14_String.prototype.split/S15.5.4.14_A1_T7.js @@ -0,0 +1,56 @@ +// 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.14_A1_T7; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is undefined, and instance is String; +*/ + +//since ToString(undefined) evaluates to "undefined" split(undefined) evaluates to split("undefined",0) +var __split = String("undefinedd").split(undefined); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __split = String("undefinedd").split(undefined); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __split = String("undefinedd").split(undefined); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: __split = String("undefinedd").split(undefined); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "") { + $ERROR('#4: __split = String("undefinedd").split(undefined); __split[0] === "". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "d") { + $ERROR('#5: __split = String("undefinedd").split(undefined); __split[1] === "d". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T8.js new file mode 100644 index 000000000..235dce215 --- /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.14_String.prototype.split/S15.5.4.14_A1_T8.js @@ -0,0 +1,58 @@ +// 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.14_A1_T8; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is void 0, and instance is String(object), object have overrided toString function; +*/ + +var __obj = {toString:function(){}}; + +//since ToString(void 0) evaluates to "undefined" split(void 0) evaluates to split("undefined") +var __split = String(__obj).split(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "") { + $ERROR('#4: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[0] !== "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "") { + $ERROR('#5: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A1_T9.js new file mode 100644 index 000000000..90f6d0b81 --- /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.14_String.prototype.split/S15.5.4.14_A1_T9.js @@ -0,0 +1,61 @@ +// 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.14_A1_T9; +* @section: 15.5.4.14; +* @assertion: String.prototype.split(separator, limit): +* i) can be transferred to other kinds of objects for use as a method. +* separator and limit can be any kinds of object since: +* ii) if separator is not RegExp ToString(separator) performs and +* iii) ToInteger(limit) performs; +* @description: Argument is function(){}(), and instance is String(object), object have overrided toString and valueOf functions; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +//since ToString(undefined) evaluates to "undefined" split(undefined) evaluates to split("undefined") +var __split = new String(__obj).split(function(){}()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __split !== "object") { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); typeof __split === "object". Actual: '+typeof __split ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.constructor !== Array) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split.length !== 2) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[0] !== "") { + $ERROR('#4: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[0] !== "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[1] !== "") { + $ERROR('#5: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T1.js new file mode 100644 index 000000000..43bb01fc6 --- /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.14_String.prototype.split/S15.5.4.14_A2_T1.js @@ -0,0 +1,72 @@ +// 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.14_A2_T1; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(","), instance is String("one,two,three,four,five"); +*/ + +var __string = new String("one,two,three,four,five"); + +var __split = __string.split(","); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 5) { + $ERROR('#2: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split.length === 5. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one") { + $ERROR('#3: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[0] === "one". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "two") { + $ERROR('#4: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[1] === "two". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "three") { + $ERROR('#5: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[2] === "three". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__split[3] !== "four") { + $ERROR('#6: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[3] === "four". Actual: '+__split[3] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (__split[4] !== "five") { + $ERROR('#7: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[4] === "five". Actual: '+__split[4] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T10.js new file mode 100644 index 000000000..c9e474c76 --- /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.14_String.prototype.split/S15.5.4.14_A2_T10.js @@ -0,0 +1,44 @@ +// 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.14_A2_T10; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(123), instance is "this123is123a123string123object"; +*/ + +var __string = "this123is123a123string123object"; +var __expected = ["this", "is", "a", "string", "object"]; + +var __split = __string.split(123); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __expected.length; i++ ) { + if (__expected[i]!==__split[i]) { + $ERROR('#3.'+i+': var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __expected['+i+']===__split['+i+']. Actual: '+__expected[i]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T11.js new file mode 100644 index 000000000..2ab661dc7 --- /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.14_String.prototype.split/S15.5.4.14_A2_T11.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.14_A2_T11; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(":"), instance is String("one-1,two-2,four-4"); +*/ + +var __string = new String("one-1,two-2,four-4"); + +var __split = __string.split(":"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one-1,two-2,four-4") { + $ERROR('#3: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split[0] === "one-1,two-2,four-4". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T12.js new file mode 100644 index 000000000..db061ae74 --- /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.14_String.prototype.split/S15.5.4.14_A2_T12.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.14_A2_T12; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("r-42"), instance is String("one-1 two-2 four-4"); +*/ + +var __string = new String("one-1 two-2 four-4"); + +var __split = __string.split("r-42"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one-1 two-2 four-4") { + $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split[0] === "one-1 two-2 four-4". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T13.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.14_String.prototype.split/S15.5.4.14_A2_T13.js new file mode 100644 index 000000000..495432f00 --- /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.14_String.prototype.split/S15.5.4.14_A2_T13.js @@ -0,0 +1,48 @@ +// 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.14_A2_T13; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("-4"), instance is String("one-1 two-2 four-4"); +*/ + +var __string = new String("one-1 two-2 four-4"); + +var __split = __string.split("-4"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one-1 two-2 four") { + $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split[0] === "one-1 two-2 four". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T14.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.14_String.prototype.split/S15.5.4.14_A2_T14.js new file mode 100644 index 000000000..ad96c465d --- /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.14_String.prototype.split/S15.5.4.14_A2_T14.js @@ -0,0 +1,48 @@ +// 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.14_A2_T14; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("on"), instance is String("one-1 two-2 four-4"); +*/ + +var __string = new String("one-1 two-2 four-4"); + +var __split = __string.split("on"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split[0] === "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "e-1 two-2 four-4") { + $ERROR('#4: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split[1] === "e-1 two-2 four-4". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T15.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.14_String.prototype.split/S15.5.4.14_A2_T15.js new file mode 100644 index 000000000..739d92c43 --- /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.14_String.prototype.split/S15.5.4.14_A2_T15.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.14_A2_T15; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(""), instance is empty String object; +*/ + +var __string = new String(); + +var __split = __string.split(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String(); __split = __string.split(""); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 0) { + $ERROR('#2: var __string = new String(); __split = __string.split(""); __split.length === 0. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== undefined) { + $ERROR('#3: var __string = new String(); __split = __string.split(""); __split[0] === undefined. Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T16.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.14_String.prototype.split/S15.5.4.14_A2_T16.js new file mode 100644 index 000000000..02ec94abe --- /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.14_String.prototype.split/S15.5.4.14_A2_T16.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.14_A2_T16; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(" "), instance is empty String object; +*/ + +var __string = new String(); + +var __split = __string.split(" "); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String(); __split = __string.split(" "); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String(); __split = __string.split(" "); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String(); __split = __string.split(" "); __split[0] === "". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T17.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.14_String.prototype.split/S15.5.4.14_A2_T17.js new file mode 100644 index 000000000..41c22b77e --- /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.14_String.prototype.split/S15.5.4.14_A2_T17.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.14_A2_T17; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(""), instance is String(" "); +*/ + +var __string = new String(" "); + +var __split = __string.split(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String(" "); __split = __string.split(""); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String(" "); __split = __string.split(""); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== " ") { + $ERROR('#3: var __string = new String(" "); __split = __string.split(""); __split[0] === " ". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T18.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.14_String.prototype.split/S15.5.4.14_A2_T18.js new file mode 100644 index 000000000..fba0a3c8f --- /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.14_String.prototype.split/S15.5.4.14_A2_T18.js @@ -0,0 +1,48 @@ +// 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.14_A2_T18; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(" "), instance is String(" "); +*/ + +var __string = new String(" "); + +var __split = __string.split(" "); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String(" "); __split = __string.split(" "); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String(" "); __split = __string.split(" "); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String(" "); __split = __string.split(" "); __split[0] === "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String(" "); __split = __string.split(" "); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T19.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.14_String.prototype.split/S15.5.4.14_A2_T19.js new file mode 100644 index 000000000..b3494c220 --- /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.14_String.prototype.split/S15.5.4.14_A2_T19.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.14_A2_T19; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("x"), instance is empty string; +*/ + +var __string = ""; + +var __split = __string.split("x"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = ""; __split = __string.split("x"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = ""; __split = __string.split("x"); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = ""; __split = __string.split("x"); __split[0] === "". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T2.js new file mode 100644 index 000000000..623b03802 --- /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.14_String.prototype.split/S15.5.4.14_A2_T2.js @@ -0,0 +1,72 @@ +// 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.14_A2_T2; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(" "), instance is String("one two three four five"); +*/ + +var __string = new String("one two three four five"); + +var __split = __string.split(" "); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one two three four five"); __split = __string.split(" "); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 5) { + $ERROR('#2: var __string = new String("one two three four five"); __split = __string.split(" "); __split.length === 5. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one") { + $ERROR('#3: var __string = new String("one two three four five"); __split = __string.split(" "); __split[0] === "one". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "two") { + $ERROR('#4: var __string = new String("one two three four five"); __split = __string.split(" "); __split[1] === "two". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "three") { + $ERROR('#5: var __string = new String("one two three four five"); __split = __string.split(" "); __split[2] === "three". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__split[3] !== "four") { + $ERROR('#6: var __string = new String("one two three four five"); __split = __string.split(" "); __split[3] === "four". Actual: '+__split[3] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#7 +if (__split[4] !== "five") { + $ERROR('#7: var __string = new String("one two three four five"); __split = __string.split(" "); __split[4] === "five". Actual: '+__split[4] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T20.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.14_String.prototype.split/S15.5.4.14_A2_T20.js new file mode 100644 index 000000000..f42dd4a80 --- /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.14_String.prototype.split/S15.5.4.14_A2_T20.js @@ -0,0 +1,43 @@ +// 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.14_A2_T20; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(new RegExp); +*/ + +var __string = new String("one-1 two-2 three-3"); + +var __split = __string.split(new RegExp); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __string.length) { + $ERROR('#2: var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __split.length === __string.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __string.length; i++ ) { + if (__string.charAt(i)!==__split[i]) { + $ERROR('#3.'+i+': var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __string.charAt('+i+')===__split['+i+']. Actual: '+__string.charAt(i)); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T21.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.14_String.prototype.split/S15.5.4.14_A2_T21.js new file mode 100644 index 000000000..bc87072c9 --- /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.14_String.prototype.split/S15.5.4.14_A2_T21.js @@ -0,0 +1,49 @@ +// 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.14_A2_T21; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("ll"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("ll"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("ll"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("ll"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("ll"); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "o") { + $ERROR('#4: var __string = new String("hello"); __split = __string.split("ll"); __split[1] === "o". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T22.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.14_String.prototype.split/S15.5.4.14_A2_T22.js new file mode 100644 index 000000000..7aeb39a20 --- /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.14_String.prototype.split/S15.5.4.14_A2_T22.js @@ -0,0 +1,57 @@ +// 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.14_A2_T22; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("l"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("l"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("l"); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("l"); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); __split = __string.split("l"); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); __split = __string.split("l"); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T23.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.14_String.prototype.split/S15.5.4.14_A2_T23.js new file mode 100644 index 000000000..6421779cf --- /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.14_String.prototype.split/S15.5.4.14_A2_T23.js @@ -0,0 +1,41 @@ +// 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.14_A2_T23; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("x"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("x"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("x"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("x"); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "hello") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("x"); __split[0] === "hello". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T24.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.14_String.prototype.split/S15.5.4.14_A2_T24.js new file mode 100644 index 000000000..92f4239c6 --- /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.14_String.prototype.split/S15.5.4.14_A2_T24.js @@ -0,0 +1,49 @@ +// 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.14_A2_T24; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("h"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("h"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("h"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("h"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("h"); __split[0] === "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "ello") { + $ERROR('#4: var __string = new String("hello"); __split = __string.split("h"); __split[1] === "ello". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T25.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.14_String.prototype.split/S15.5.4.14_A2_T25.js new file mode 100644 index 000000000..c26aa13af --- /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.14_String.prototype.split/S15.5.4.14_A2_T25.js @@ -0,0 +1,48 @@ +// 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.14_A2_T25; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("o"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("o"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("o"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("o"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "hell") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("o"); __split[0] === "hell". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); __split = __string.split("o"); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T26.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.14_String.prototype.split/S15.5.4.14_A2_T26.js new file mode 100644 index 000000000..4cfcf1b1c --- /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.14_String.prototype.split/S15.5.4.14_A2_T26.js @@ -0,0 +1,48 @@ +// 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.14_A2_T26; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("hello"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("hello"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("hello"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("hello"); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("hello"); __split[0] === "". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); __split = __string.split("hello"); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T27.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.14_String.prototype.split/S15.5.4.14_A2_T27.js new file mode 100644 index 000000000..ad39737a5 --- /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.14_String.prototype.split/S15.5.4.14_A2_T27.js @@ -0,0 +1,41 @@ +// 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.14_A2_T27; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(undefined), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split(undefined); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split(undefined); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split(undefined); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "hello") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split(undefined); __split[0] === "hello". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T28.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.14_String.prototype.split/S15.5.4.14_A2_T28.js new file mode 100644 index 000000000..4c3bc009a --- /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.14_String.prototype.split/S15.5.4.14_A2_T28.js @@ -0,0 +1,41 @@ +// 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.14_A2_T28; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("hellothere"), instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __split = __string.split("hellothere"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); __split = __string.split("hellothere"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("hello"); __split = __string.split("hellothere"); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "hello") { + $ERROR('#3: var __string = new String("hello"); __split = __string.split("hellothere"); __split[0] === "hello". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A2_T29.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.14_String.prototype.split/S15.5.4.14_A2_T29.js new file mode 100644 index 000000000..ea3ac42ab --- /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.14_String.prototype.split/S15.5.4.14_A2_T29.js @@ -0,0 +1,47 @@ +// 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.14_A2_T29; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1); + +var __expected = ["","00","","","","22","33","44","60"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T3.js new file mode 100644 index 000000000..654e0d4dd --- /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.14_String.prototype.split/S15.5.4.14_A2_T3.js @@ -0,0 +1,48 @@ +// 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.14_A2_T3; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(/ /,2), instance is String("one two three four five"); +*/ + +var __string = new String("one two three four five"); + +var __split = __string.split(/ /,2); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one") { + $ERROR('#3: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split[0] === "one". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "two") { + $ERROR('#4: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split[1] === "two". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T30.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.14_String.prototype.split/S15.5.4.14_A2_T30.js new file mode 100644 index 000000000..032f178d3 --- /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.14_String.prototype.split/S15.5.4.14_A2_T30.js @@ -0,0 +1,45 @@ +// 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.14_A2_T30; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,1), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1,1); + +var __expected = [""]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T31.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.14_String.prototype.split/S15.5.4.14_A2_T31.js new file mode 100644 index 000000000..827c78e11 --- /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.14_String.prototype.split/S15.5.4.14_A2_T31.js @@ -0,0 +1,47 @@ +// 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.14_A2_T31; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,2), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1,2); + +var __expected = ["","00"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T32.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.14_String.prototype.split/S15.5.4.14_A2_T32.js new file mode 100644 index 000000000..ace056b61 --- /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.14_String.prototype.split/S15.5.4.14_A2_T32.js @@ -0,0 +1,45 @@ +// 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.14_A2_T32; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,0), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1,0); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T33.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.14_String.prototype.split/S15.5.4.14_A2_T33.js new file mode 100644 index 000000000..24e5afa4d --- /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.14_String.prototype.split/S15.5.4.14_A2_T33.js @@ -0,0 +1,47 @@ +// 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.14_A2_T33; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,100), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1,100); + +var __expected = ["","00","","","","22","33","44","60"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T34.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.14_String.prototype.split/S15.5.4.14_A2_T34.js new file mode 100644 index 000000000..d0c402f4e --- /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.14_String.prototype.split/S15.5.4.14_A2_T34.js @@ -0,0 +1,47 @@ +// 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.14_A2_T34; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,void 0), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1,void 0); + +var __expected = ["","00","","","","22","33","44","60"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3: __split[index] === __expected[index]. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T35.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.14_String.prototype.split/S15.5.4.14_A2_T35.js new file mode 100644 index 000000000..eb1122093 --- /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.14_String.prototype.split/S15.5.4.14_A2_T35.js @@ -0,0 +1,47 @@ +// 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.14_A2_T35; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1, Math.pow(2,32)-1), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1, Math.pow(2,32)-1); + +var __expected = ["","00","","","","22","33","44","60"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T36.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.14_String.prototype.split/S15.5.4.14_A2_T36.js new file mode 100644 index 000000000..c0fce4ab9 --- /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.14_String.prototype.split/S15.5.4.14_A2_T36.js @@ -0,0 +1,45 @@ +// 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.14_A2_T36; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,"boo"), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1, "boo"); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T37.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.14_String.prototype.split/S15.5.4.14_A2_T37.js new file mode 100644 index 000000000..460fb14a8 --- /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.14_String.prototype.split/S15.5.4.14_A2_T37.js @@ -0,0 +1,45 @@ +// 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.14_A2_T37; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(1,-Math.pow(2,32)+1), instance is Number; +*/ + +var __instance = new Number(100111122133144155); + +Number.prototype.split = String.prototype.split; + +var __split = __instance.split(1, -Math.pow(2,32)+1); + +var __expected = [""]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T38.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.14_String.prototype.split/S15.5.4.14_A2_T38.js new file mode 100644 index 000000000..fb97068a5 --- /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.14_String.prototype.split/S15.5.4.14_A2_T38.js @@ -0,0 +1,41 @@ +// 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.14_A2_T38; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",NaN), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", NaN); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// 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.14_String.prototype.split/S15.5.4.14_A2_T39.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.14_String.prototype.split/S15.5.4.14_A2_T39.js new file mode 100644 index 000000000..900170d75 --- /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.14_String.prototype.split/S15.5.4.14_A2_T39.js @@ -0,0 +1,41 @@ +// 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.14_A2_T39; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",0), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", 0); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T4.js new file mode 100644 index 000000000..3ab7f6d01 --- /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.14_String.prototype.split/S15.5.4.14_A2_T4.js @@ -0,0 +1,64 @@ +// 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.14_A2_T4; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(""), instance is String("one two three"); +*/ + +var __string = new String("one two three"); + +var __split = __string.split(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one two three"); __split = __string.split(""); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __string.length) { + $ERROR('#2: var __string = new String("one two three"); __split = __string.split(""); __split.length === __string.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "o") { + $ERROR('#3: var __string = new String("one two three"); __split = __string.split(""); __split[0] === "o". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "n") { + $ERROR('#4: var __string = new String("one two three"); __split = __string.split(""); __split[1] === "n". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[11] !== "e") { + $ERROR('#5: var __string = new String("one two three"); __split = __string.split(""); __split[11] === "e". Actual: '+__split[11] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__split[12] !== "e") { + $ERROR('#6: var __string = new String("one two three"); __split = __string.split(""); __split[12] === "e". Actual: '+__split[12] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_T40.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.14_String.prototype.split/S15.5.4.14_A2_T40.js new file mode 100644 index 000000000..c80306b77 --- /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.14_String.prototype.split/S15.5.4.14_A2_T40.js @@ -0,0 +1,41 @@ +// 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.14_A2_T40; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",1), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", 1); + +var __expected = ["he"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// 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.14_String.prototype.split/S15.5.4.14_A2_T41.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.14_String.prototype.split/S15.5.4.14_A2_T41.js new file mode 100644 index 000000000..9e2debf94 --- /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.14_String.prototype.split/S15.5.4.14_A2_T41.js @@ -0,0 +1,45 @@ +// 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.14_A2_T41; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",2), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", 2); + +var __expected = ["he",""]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T42.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.14_String.prototype.split/S15.5.4.14_A2_T42.js new file mode 100644 index 000000000..0b769d92d --- /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.14_String.prototype.split/S15.5.4.14_A2_T42.js @@ -0,0 +1,45 @@ +// 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.14_A2_T42; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",3), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", 3); + +var __expected = ["he","","o"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_T43.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.14_String.prototype.split/S15.5.4.14_A2_T43.js new file mode 100644 index 000000000..23b4e78ff --- /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.14_String.prototype.split/S15.5.4.14_A2_T43.js @@ -0,0 +1,45 @@ +// 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.14_A2_T43; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split("l",4), instance is String("hello"); +*/ + +var __instance = new String("hello"); + +var __split = __instance.split("l", 4); + +var __expected = ["he","","o"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split[index] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T5.js new file mode 100644 index 000000000..4df7e15b0 --- /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.14_String.prototype.split/S15.5.4.14_A2_T5.js @@ -0,0 +1,56 @@ +// 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.14_A2_T5; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(/,/), instance is String("one-1,two-2,four-4"); +*/ + +var __string = new String("one-1,two-2,four-4"); + +var __split = __string.split(/,/); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one-1") { + $ERROR('#3: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[0] === "one-1". Actual: '+__split[0] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "two-2") { + $ERROR('#4: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[1] === "two-2". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "four-4") { + $ERROR('#5: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[2] === "four-4". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T6.js new file mode 100644 index 000000000..e8eb0ee2d --- /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.14_String.prototype.split/S15.5.4.14_A2_T6.js @@ -0,0 +1,43 @@ +// 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.14_A2_T6; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(''), instance is String("one-1 two-2 four-4"); +*/ + +var __string = new String("one-1 two-2 three-3"); + +var __split = __string.split(''); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __string.length) { + $ERROR('#2: var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split.length === __string.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __string.length; i++ ) { + if (__split[i]!==__string.charAt(i)) { + $ERROR('#3.'+i+': var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split['+i+']===__string.charAt('+i+'). Actual: '+__split[i]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T7.js new file mode 100644 index 000000000..97b32a8e2 --- /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.14_String.prototype.split/S15.5.4.14_A2_T7.js @@ -0,0 +1,44 @@ +// 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.14_A2_T7; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(void 0), instance is "thisundefinedisundefinedaundefinedstringundefinedobject"; +*/ + +var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; +var __expected = ["this", "is", "a", "string", "object"]; + +var __split = __string.split(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __expected.length; i++ ) { + if (__expected[i]!==__split[i]) { + $ERROR('#3.'+i+': var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __expected['+i+']==='+__split[i]+'. Actual: '+__expected[i]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T8.js new file mode 100644 index 000000000..16ad42b16 --- /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.14_String.prototype.split/S15.5.4.14_A2_T8.js @@ -0,0 +1,44 @@ +// 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.14_A2_T8; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(null), instance is "thisnullisnullanullstringnullobject"; +*/ + +var __string = "thisnullisnullanullstringnullobject"; +var __expected = ["this", "is", "a", "string", "object"]; + +var __split = __string.split(null); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __expected.length; i++ ) { + if (__expected[i]!==__split[i]) { + $ERROR('#3.'+i+': var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __expected['+i+']==='+__split[i]+'. Actual: '+__expected[i]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_A2_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.14_String.prototype.split/S15.5.4.14_A2_T9.js new file mode 100644 index 000000000..3b46f9dc0 --- /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.14_String.prototype.split/S15.5.4.14_A2_T9.js @@ -0,0 +1,44 @@ +// 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.14_A2_T9; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. The substrings are determined by searching from left to right for occurrences of +* separator; these occurrences are not part of any substring in the returned array, but serve to divide up +* the string value. The value of separator may be a string of any length or it may be a RegExp object; +* @description: Call split(true), instance is "thistrueistrueatruestringtrueobject"; +*/ + +var __string = "thistrueistrueatruestringtrueobject"; +var __expected = ["this", "is", "a", "string", "object"]; + +var __split = __string.split(true); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for ( var i = 0; i < __expected.length; i++ ) { + if (__expected[i]!==__split[i]) { + $ERROR('#3.'+i+': var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __expected['+i+']==='+__split[i]+'. Actual: '+__expected[i]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A3_T1.js new file mode 100644 index 000000000..f003915a3 --- /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.14_String.prototype.split/S15.5.4.14_A3_T1.js @@ -0,0 +1,39 @@ +// 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.14_A3_T1; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is String("one,two,three,four,five"); +*/ + +var __string = new String("one,two,three,four,five"); + +var __split = __string.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "one,two,three,four,five") { + $ERROR('#3: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split[0] === "one,two,three,four,five". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T10.js new file mode 100644 index 000000000..ef85b7972 --- /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.14_String.prototype.split/S15.5.4.14_A3_T10.js @@ -0,0 +1,39 @@ +// 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.14_A3_T10; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is new String; +*/ + +var __string = new String; + +var __split = __string.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String; __split = __string.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String; __split = __string.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "") { + $ERROR('#3: var __string = new String; __split = __string.split(); __split[0] === "". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T11.js new file mode 100644 index 000000000..b6cc282c5 --- /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.14_String.prototype.split/S15.5.4.14_A3_T11.js @@ -0,0 +1,39 @@ +// 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.14_A3_T11; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is String(" "); +*/ + +var __string = new String(" "); + +var __split = __string.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String(" "); __split = __string.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String(" "); __split = __string.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== " ") { + $ERROR('#3: var __string = new String(" "); __split = __string.split(); __split[0] === " ". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T2.js new file mode 100644 index 000000000..99a2c0bd2 --- /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.14_String.prototype.split/S15.5.4.14_A3_T2.js @@ -0,0 +1,41 @@ +// 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.14_A3_T2; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Object(); +*/ + +var __instance = new Object(); + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "[object Object]") { + $ERROR('#3: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "[object Object]". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T3.js new file mode 100644 index 000000000..ba33ba871 --- /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.14_String.prototype.split/S15.5.4.14_A3_T3.js @@ -0,0 +1,41 @@ +// 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.14_A3_T3; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is function(){}; +*/ + +var __instance = function(){}; + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0].substring(0,8) !== "function") { + $ERROR('#3: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split[0].substring(0,8) === "function". Actual: '+__split[0].substring(0,8) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T4.js new file mode 100644 index 000000000..a8845dd50 --- /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.14_String.prototype.split/S15.5.4.14_A3_T4.js @@ -0,0 +1,41 @@ +// 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.14_A3_T4; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Number(NaN); +*/ + +var __instance = new Number(NaN); + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "NaN") { + $ERROR('#3: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "NaN". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T5.js new file mode 100644 index 000000000..1656b9af7 --- /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.14_String.prototype.split/S15.5.4.14_A3_T5.js @@ -0,0 +1,41 @@ +// 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.14_A3_T5; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Number(-1234567890); +*/ + +var __instance = new Number(-1234567890); + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "-1234567890") { + $ERROR('#3: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "-1234567890". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T6.js new file mode 100644 index 000000000..533762630 --- /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.14_String.prototype.split/S15.5.4.14_A3_T6.js @@ -0,0 +1,41 @@ +// 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.14_A3_T6; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Number(-1e21); +*/ + +var __instance = new Number(-1e21); + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __instance.toString()) { + $ERROR('#3: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === __instance.toString(). Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T7.js new file mode 100644 index 000000000..358fdd09d --- /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.14_String.prototype.split/S15.5.4.14_A3_T7.js @@ -0,0 +1,41 @@ +// 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.14_A3_T7; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Math; +*/ + +var __instance = Math; + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "[object Math]") { + $ERROR('#3: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "[object Math]". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T8.js new file mode 100644 index 000000000..b872a70ed --- /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.14_String.prototype.split/S15.5.4.14_A3_T8.js @@ -0,0 +1,41 @@ +// 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.14_A3_T8; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Array(1,2,3,4,5); +*/ + +var __instance = new Array(1,2,3,4,5); + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "1,2,3,4,5") { + $ERROR('#3: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "1,2,3,4,5". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A3_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.14_String.prototype.split/S15.5.4.14_A3_T9.js new file mode 100644 index 000000000..79f79e0b5 --- /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.14_String.prototype.split/S15.5.4.14_A3_T9.js @@ -0,0 +1,41 @@ +// 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.14_A3_T9; +* @section: 15.5.4.14; +* @assertion: String.prototype.split() returns an Array object with: +* i) length equaled to 1, +* ii) [[Get]](0) equaled to the result of converting this object to a string; +* @description: Instance is Boolean; +*/ + +var __instance = new Boolean; + +__instance.split = String.prototype.split; + +var __split = __instance.split(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "false") { + $ERROR('#3: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "false". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A4_T1.js new file mode 100644 index 000000000..c446c07e9 --- /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.14_String.prototype.split/S15.5.4.14_A4_T1.js @@ -0,0 +1,57 @@ +// 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.14_A4_T1; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp /l/, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T10.js new file mode 100644 index 000000000..e4b280bae --- /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.14_String.prototype.split/S15.5.4.14_A4_T10.js @@ -0,0 +1,45 @@ +// 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.14_A4_T10; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is new RegExp, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re); + +var __expected = ["h","e","l","l","o"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T11.js new file mode 100644 index 000000000..bd1aa1c92 --- /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.14_String.prototype.split/S15.5.4.14_A4_T11.js @@ -0,0 +1,43 @@ +// 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.14_A4_T11; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and 0, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, 0); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T12.js new file mode 100644 index 000000000..87f5388cb --- /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.14_String.prototype.split/S15.5.4.14_A4_T12.js @@ -0,0 +1,43 @@ +// 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.14_A4_T12; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and 1, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, 1); + +var __expected = ["h"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_A4_T13.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.14_String.prototype.split/S15.5.4.14_A4_T13.js new file mode 100644 index 000000000..a130b2562 --- /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.14_String.prototype.split/S15.5.4.14_A4_T13.js @@ -0,0 +1,45 @@ +// 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.14_A4_T13; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and 2, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, 2); + +var __expected = ["h", "e"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T14.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.14_String.prototype.split/S15.5.4.14_A4_T14.js new file mode 100644 index 000000000..63a83298c --- /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.14_String.prototype.split/S15.5.4.14_A4_T14.js @@ -0,0 +1,45 @@ +// 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.14_A4_T14; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and 3, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, 3); + +var __expected = ["h", "e", "l"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T15.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.14_String.prototype.split/S15.5.4.14_A4_T15.js new file mode 100644 index 000000000..10d913086 --- /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.14_String.prototype.split/S15.5.4.14_A4_T15.js @@ -0,0 +1,45 @@ +// 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.14_A4_T15; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and 4, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, 4); + +var __expected = ["h", "e", "l" ,"l"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T16.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.14_String.prototype.split/S15.5.4.14_A4_T16.js new file mode 100644 index 000000000..24411d810 --- /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.14_String.prototype.split/S15.5.4.14_A4_T16.js @@ -0,0 +1,45 @@ +// 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.14_A4_T16; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and void 0, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, void 0); + +var __expected = ["h", "e", "l", "l", "o"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T17.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.14_String.prototype.split/S15.5.4.14_A4_T17.js new file mode 100644 index 000000000..fb35ef934 --- /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.14_String.prototype.split/S15.5.4.14_A4_T17.js @@ -0,0 +1,45 @@ +// 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.14_A4_T17; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and undefined, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, undefined); + +var __expected = ["h", "e", "l", "l", "o"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T18.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.14_String.prototype.split/S15.5.4.14_A4_T18.js new file mode 100644 index 000000000..91712a262 --- /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.14_String.prototype.split/S15.5.4.14_A4_T18.js @@ -0,0 +1,45 @@ +// 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.14_A4_T18; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are new RegExp and "hi", and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = new RegExp; + +var __split = __string.split(__re, "hi"); + +var __expected = []; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T19.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.14_String.prototype.split/S15.5.4.14_A4_T19.js new file mode 100644 index 000000000..dac70cb96 --- /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.14_String.prototype.split/S15.5.4.14_A4_T19.js @@ -0,0 +1,45 @@ +// 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.14_A4_T19; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp /\s/, and instance is String("a b c de f"); +*/ + +var __string = new String("a b c de f"); + +var __re = /\s/; + +var __split = __string.split(__re); + +var __expected = ["a","b","c","de","f"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A4_T2.js new file mode 100644 index 000000000..9cea98034 --- /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.14_String.prototype.split/S15.5.4.14_A4_T2.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.14_A4_T2; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and 0, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re,0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,0); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 0) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,0); __split.length === 0. Actual: '+__split.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.14_String.prototype.split/S15.5.4.14_A4_T20.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.14_String.prototype.split/S15.5.4.14_A4_T20.js new file mode 100644 index 000000000..3057cfd33 --- /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.14_String.prototype.split/S15.5.4.14_A4_T20.js @@ -0,0 +1,45 @@ +// 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.14_A4_T20; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /\s/ and 3, and instance is String("a b c de f"); +*/ + +var __string = new String("a b c de f"); + +var __re = /\s/; + +var __split = __string.split(__re,3); + +var __expected = ["a","b","c"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T21.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.14_String.prototype.split/S15.5.4.14_A4_T21.js new file mode 100644 index 000000000..8c0e8609c --- /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.14_String.prototype.split/S15.5.4.14_A4_T21.js @@ -0,0 +1,43 @@ +// 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.14_A4_T21; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp /\X/, and instance is String("a b c de f"); +*/ + +var __string = new String("a b c de f"); + +var __re = /X/; + +var __split = __string.split(__re); + +var __expected = ["a b c de f"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== __expected[0]) { + $ERROR('#3: __split[0] === '+__expected[0]+'. Actual: '+__split[index] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T22.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.14_String.prototype.split/S15.5.4.14_A4_T22.js new file mode 100644 index 000000000..ff82875a4 --- /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.14_String.prototype.split/S15.5.4.14_A4_T22.js @@ -0,0 +1,45 @@ +// 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.14_A4_T22; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp /\d+/, and instance is String("dfe23iu 34 =+65--"); +*/ + +var __string = new String("dfe23iu 34 =+65--"); + +var __re = /\d+/; + +var __split = __string.split(__re); + +var __expected = ["dfe","iu "," =+","--"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T23.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.14_String.prototype.split/S15.5.4.14_A4_T23.js new file mode 100644 index 000000000..4a9cdce76 --- /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.14_String.prototype.split/S15.5.4.14_A4_T23.js @@ -0,0 +1,45 @@ +// 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.14_A4_T23; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp RegExp('\\d+'), and instance is String("dfe23iu 34 =+65--"); +*/ + +var __string = new String("dfe23iu 34 =+65--"); + +var __re = new RegExp('\\d+'); + +var __split = __string.split(__re); + +var __expected = ["dfe","iu "," =+","--"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T24.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.14_String.prototype.split/S15.5.4.14_A4_T24.js new file mode 100644 index 000000000..3c08f5b92 --- /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.14_String.prototype.split/S15.5.4.14_A4_T24.js @@ -0,0 +1,45 @@ +// 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.14_A4_T24; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is regexp /[a-z]/, and instance is String("abc"); +*/ + +var __string = new String("abc"); + +var __re = /[a-z]/; + +var __split = __string.split(__re); + +var __expected = ["","","",""]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_T25.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.14_String.prototype.split/S15.5.4.14_A4_T25.js new file mode 100644 index 000000000..c16129ba3 --- /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.14_String.prototype.split/S15.5.4.14_A4_T25.js @@ -0,0 +1,45 @@ +// 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.14_A4_T25; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Argument is RegExp('[a-z]'), and instance is String("abc"); +*/ + +var __string = new String("abc"); + +var __re = new RegExp('[a-z]'); + +var __split = __string.split(__re); + +var __expected = ["","","",""]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== __expected.length) { + $ERROR('#2: __split.length === __expected.length. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var index=0; index<__expected.length; index++) { + if (__split[index] !== __expected[index]) { + $ERROR('#3.'+index+': __split['+index+'] === '+__expected[index]+'. Actual: '+__split[index] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A4_T3.js new file mode 100644 index 000000000..501b1a7be --- /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.14_String.prototype.split/S15.5.4.14_A4_T3.js @@ -0,0 +1,41 @@ +// 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.14_A4_T3; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and 1, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re,1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 1) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split.length === 1. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split[0] === "he". Actual: '+__split[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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A4_T4.js new file mode 100644 index 000000000..8ec0ede8a --- /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.14_String.prototype.split/S15.5.4.14_A4_T4.js @@ -0,0 +1,49 @@ +// 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.14_A4_T4; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and 2, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re,2); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 2) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split.length === 2. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split[1] === "". Actual: '+__split[1] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A4_T5.js new file mode 100644 index 000000000..75708e755 --- /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.14_String.prototype.split/S15.5.4.14_A4_T5.js @@ -0,0 +1,57 @@ +// 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.14_A4_T5; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and 3, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re,3); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T6.js new file mode 100644 index 000000000..6e006abbf --- /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.14_String.prototype.split/S15.5.4.14_A4_T6.js @@ -0,0 +1,57 @@ +// 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.14_A4_T6; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and 4, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re,4); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T7.js new file mode 100644 index 000000000..2a4e2a22d --- /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.14_String.prototype.split/S15.5.4.14_A4_T7.js @@ -0,0 +1,57 @@ +// 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.14_A4_T7; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and void 0, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re, void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T8.js new file mode 100644 index 000000000..20423c03b --- /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.14_String.prototype.split/S15.5.4.14_A4_T8.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.14_A4_T8; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and "hi", and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re, "hi"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, "hi"); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 0) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, "hi"); __split.length === 0. Actual: '+__split.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.14_String.prototype.split/S15.5.4.14_A4_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.14_String.prototype.split/S15.5.4.14_A4_T9.js new file mode 100644 index 000000000..306a0b10b --- /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.14_String.prototype.split/S15.5.4.14_A4_T9.js @@ -0,0 +1,57 @@ +// 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.14_A4_T9; +* @section: 15.5.4.14; +* @assertion: String.prototype.split (separator, limit) returns an Array object into which substrings of the result of converting this object to a string have +* been stored. If separator is a regular expression then +* inside of SplitMatch helper the [[Match]] method of R is called giving it the arguments corresponding; +* @description: Arguments are regexp /l/ and undefined, and instance is String("hello"); +*/ + +var __string = new String("hello"); + +var __re = /l/; + +var __split = __string.split(__re, undefined); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__split.constructor !== Array) { + $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split.constructor === Array. Actual: '+__split.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__split.length !== 3) { + $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split.length === 3. Actual: '+__split.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__split[0] !== "he") { + $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[0] === "he". Actual: '+__split[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__split[1] !== "") { + $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[1] === "". Actual: '+__split[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__split[2] !== "o") { + $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[2] === "o". Actual: '+__split[2] ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A6.js new file mode 100644 index 000000000..b3d374fa2 --- /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.14_String.prototype.split/S15.5.4.14_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.14_A6; +* @section: 15.5.4.14, 13.2; +* @assertion: String.prototype.split has not prototype property; +* @description: Checking String.prototype.split.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.split.prototype !== undefined) { + $ERROR('#1: String.prototype.split.prototype === undefined. Actual: '+String.prototype.split.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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A7.js new file mode 100644 index 000000000..bab94bbd5 --- /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.14_String.prototype.split/S15.5.4.14_A7.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.5.4.14_A7; +* @section: 15.5.4.14, 13.2; +* @assertion: String.prototype.split can't be used as constructor; +* @description: Checking if creating the String.prototype.split object fails; +*/ + +var __FACTORY = String.prototype.split; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.split; "__instance = new __FACTORY" lead to throwing exception'); +} catch (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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A8.js new file mode 100644 index 000000000..bd2c7e4ce --- /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.14_String.prototype.split/S15.5.4.14_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.14_A8; +* @section: 15.5.4.14; +* @assertion: The String.prototype.split.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.split.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.split.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.split.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.split.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.split.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.split){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.split){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.14_String.prototype.split/S15.5.4.14_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.14_String.prototype.split/S15.5.4.14_A9.js new file mode 100644 index 000000000..a70debfe0 --- /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.14_String.prototype.split/S15.5.4.14_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.14_A9; +* @section: 15.5.4.14; +* @assertion: The String.prototype.split.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.split.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.split.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.split.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.split.length) { + $ERROR('#1: delete String.prototype.split.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.split.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.split.length; String.prototype.split.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.split.hasOwnProperty('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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A10.js new file mode 100644 index 000000000..ec221879b --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A10; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.substring.length; + +String.prototype.substring.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.substring.length !== __obj) { + $ERROR('#2: __obj = String.prototype.substring.length; String.prototype.substring.length = function(){return "shifted";}; String.prototype.substring.length === __obj. Actual: '+String.prototype.substring.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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A11.js new file mode 100644 index 000000000..55d957b51 --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A11; +* @section: 15.5.4.15; +* @assertion: The length property of the substring method is 2; +* @description: Checking String.prototype.substring.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.substring.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.substring.hasOwnProperty("length") return true. Actual: '+String.prototype.substring.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.substring.length !== 2) { + $ERROR('#2: String.prototype.substring.length === 2. Actual: '+String.prototype.substring.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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T1.js new file mode 100644 index 000000000..e1cb20248 --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A1_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(false, true) !== "t") { + $ERROR('#1: __instance = new Object(true); __instance.substring = String.prototype.substring; __instance.substring(false, true) === "t". Actual: '+__instance.substring(false, true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T10.js new file mode 100644 index 000000000..03dd87388 --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A1_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are object and function call, and instance is String, object have overrided valueOf function; +*/ + +var __obj = {valueOf:function(){return 2;}}; + +var __str = "\u0035ABBBABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (substring(__obj, function(){return substring(0,1);}()) !== "BBB") { + $ERROR('#1: var __obj = {valueOf:function(){return 2;}}; var __str = "\u0035ABBBABAB"; substring(__obj, function(){return substring(0,1);}()) === "BBB". Actual: '+substring(__obj, function(){return substring(0,1);}()) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T11.js new file mode 100644 index 000000000..b4389b0d2 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T11.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.15_A1_T11; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string, objects have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = substring(__obj,__obj2); + $FAIL('#1: "var x = substring(__obj,__obj2)" lead to throw exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception === "instart". 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T12.js new file mode 100644 index 000000000..124e74863 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T12.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.15_A1_T12; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf function and toString function, that return exception. +* Second object have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = substring(__obj, __obj2); + $FAIL('#1: "var x = substring(__obj,__obj2)" lead to throw exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception ==="instart". 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.15_String.prototype.substring/S15.5.4.15_A1_T13.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.15_String.prototype.substring/S15.5.4.15_A1_T13.js new file mode 100644 index 000000000..00996cbf3 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T13.js @@ -0,0 +1,28 @@ +// 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.15_A1_T13; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf and toString functions. +* Second object have overrided toString function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){return 1;}}; +var __obj2 = {toString:function(){throw "inend";}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = "ABB\u0041BABAB\u0031BBAA".substring(__obj, __obj2); + $FAIL('#1: var x = "ABB\\u0041BABAB\\u0031BBAA".substring(__obj,__obj2) lead to throw exception'); +} catch (e) { + if (e!=="inend") { + $ERROR('#1.1: Exception === "inend". 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.15_String.prototype.substring/S15.5.4.15_A1_T14.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.15_String.prototype.substring/S15.5.4.15_A1_T14.js new file mode 100644 index 000000000..28d45bf99 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T14.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.15_A1_T14; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Used one argument, that is function(){}(). Instance is string; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("report".substring(function(){}()) !== "report") { + $ERROR('#1: "report".substring(function(){}()) === "report". Actual: '+"report".substring(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.15_String.prototype.substring/S15.5.4.15_A1_T15.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.15_String.prototype.substring/S15.5.4.15_A1_T15.js new file mode 100644 index 000000000..3b8434714 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T15.js @@ -0,0 +1,22 @@ +// 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.15_A1_T15; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Call substring without arguments. Instance is Number with prototype.substring = String.prototype.substring; +*/ + +var __num = 11.001002; + +Number.prototype.substring = String.prototype.substring; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.substring()!=="11.001002") { + $ERROR('#1: var __num = 11.001002; Number.prototype.substring = String.prototype.substring; __num.substring()==="11.001002". Actual: '+__num.substring()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T2.js new file mode 100644 index 000000000..b8a034fc6 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T2.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.15_A1_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are function call and x, and instance is Boolean. x is undefined variable; +*/ + +var __instance = new Boolean; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(function(){return true;}(),x) !== "alse") { + $ERROR('#1: var x; __instance = new Boolean; __instance.substring = String.prototype.substring; __instance.substring(function(){return true;}(),x) === "alse". Actual: '+__instance.substring(function(){return true;}(),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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T3.js new file mode 100644 index 000000000..8122cc79e --- /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.15_String.prototype.substring/S15.5.4.15_A1_T3.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.5.4.15_A1_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Checking by using eval; +*/ + +var substring = String.prototype.substring; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); +var __toggle = 1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (substring(eval("\"1\""),{valueOf:function(){return "0x0007"}})!=="object") { + $ERROR('#1: substring(eval("\\"1\\""),{valueOf:function(){return "0x0007"}})==="object". Actual: '+substring(eval("\"1\""),{valueOf:function(){return "0x0007"}})); +}; +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T4.js new file mode 100644 index 000000000..5fec6a2b6 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T4.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.15_A1_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are null and number, and instance is function call, that returned string; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (function(){return "gnulluna"}().substring(null, -3) !== "") { + $ERROR('#1: function(){return "gnulluna"}().substring(null, -3) === "". Actual: '+function(){return "gnulluna"}().substring(null, -3) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T5.js new file mode 100644 index 000000000..a717af019 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T5.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.5.4.15_A1_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are null and Function(), and instance is function object, that have overrided valueOf function; +*/ + +__func.valueOf=function(){return "gnulluna"}; + +Function.prototype.substring=String.prototype.substring; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__func.substring(null, Function()) !== "") { + $ERROR('#1: __func.valueOf=function(){return "gnulluna"}; Function.prototype.substring=String.prototype.substring; function __func(){}; __func.substring(null, Function()) === "". Actual: '+__func.substring(null, Function()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __func(){}; 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T6.js new file mode 100644 index 000000000..2e2fa7b71 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T6.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.5.4.15_A1_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are x and number, and instance is new String, x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String("undefined").substring(x,3) !== "und") { + $ERROR('#1: var x; new String("undefined").substring(x,3) === "und". Actual: '+new String("undefined").substring(x,3) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T7.js new file mode 100644 index 000000000..90c65cf2b --- /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.15_String.prototype.substring/S15.5.4.15_A1_T7.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.15_A1_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are symbol and undefined, and instance is String; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(void 0).substring("e",undefined) !== "undefined") { + $ERROR('#1: String(void 0).substring("e",undefined) === "undefined". Actual: '+String(void 0).substring("e",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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T8.js new file mode 100644 index 000000000..d806867b6 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T8.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.5.4.15_A1_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are negative number and void 0, and instance is String(object), object have overrided toString function; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(__obj).substring(-4,void 0) !== "undefined") { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).substring(-4,void 0) === "undefined". Actual: '+String(__obj).substring(-4,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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A1_T9.js new file mode 100644 index 000000000..b5debd1c4 --- /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.15_String.prototype.substring/S15.5.4.15_A1_T9.js @@ -0,0 +1,22 @@ +// 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.15_A1_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are undefined and object, and instance is new String(object), object have overrided valueOf and toString functions; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String(__obj).substring(/*(function(){})()*/undefined,undefined) !== "undefined") { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).substring(/*(function(){})()*/undefined,undefined) === "undefined". Actual: '+new String(__obj).substring(/*(function(){})()*/undefined,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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T1.js new file mode 100644 index 000000000..e9cfad4ea --- /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.15_String.prototype.substring/S15.5.4.15_A2_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.5.4.15_A2_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: Checking type of substring(); +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __string.substring() !== "string") { + $ERROR('#1: __string = new String("this is a string object"); typeof __string.substring() === "string". Actual: '+typeof __string.substring() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T10.js new file mode 100644 index 000000000..8049952da --- /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.15_String.prototype.substring/S15.5.4.15_A2_T10.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.5.4.15_A2_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is 0, end is 8; +*/ + +var __string = new String("this_is_a_string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(0,8) !== "this_is_") { + $ERROR('#1: __string = new String("this_is_a_string object"); __string.substring(0,8) === "this_is_". Actual: '+__string.substring(0,8) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T2.js new file mode 100644 index 000000000..a8e5f4523 --- /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.15_String.prototype.substring/S15.5.4.15_A2_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.5.4.15_A2_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is NaN, end is Infinity; +*/ + +var __string = new String('this is a string object'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(NaN, Infinity) !== "this is a string object") { + $ERROR('#1: __string = new String(\'this is a string object\'); __string.substring(NaN, Infinity) === "this is a string object". Actual: '+__string.substring(NaN, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T3.js new file mode 100644 index 000000000..99f3e12b6 --- /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.15_String.prototype.substring/S15.5.4.15_A2_T3.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.5.4.15_A2_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: Call substring from empty String object; +*/ + +var __string = new String(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(1,0) !== "") { + $ERROR('#1: __string = new String(""); __string.substring(1,0) === "". Actual: '+__string.substring(1,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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T4.js new file mode 100644 index 000000000..93a464173 --- /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.15_String.prototype.substring/S15.5.4.15_A2_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.5.4.15_A2_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is Infinity, end is NaN; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(Infinity, NaN) !== "this is a string object") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(Infinity, NaN) === "this is a string object". Actual: '+__string.substring(Infinity, NaN) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T5.js new file mode 100644 index 000000000..17c1253ad --- /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.15_String.prototype.substring/S15.5.4.15_A2_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.5.4.15_A2_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is Infinity, end is Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(Infinity, Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(Infinity, Infinity) === "". Actual: '+__string.substring(Infinity, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T6.js new file mode 100644 index 000000000..85b568386 --- /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.15_String.prototype.substring/S15.5.4.15_A2_T6.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.5.4.15_A2_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is negative float number, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(-0.01,0) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(-0.01,0) === "". Actual: '+__string.substring(-0.01,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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T7.js new file mode 100644 index 000000000..286adb720 --- /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.15_String.prototype.substring/S15.5.4.15_A2_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.5.4.15_A2_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is tested_string.length, end is tested_string.length; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(__string.length, __string.length) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(__string.length, __string.length) === "". Actual: '+__string.substring(__string.length, __string.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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T8.js new file mode 100644 index 000000000..cc1638439 --- /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.15_String.prototype.substring/S15.5.4.15_A2_T8.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.5.4.15_A2_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is tested_string.length+1, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(__string.length+1, 0) !== "this is a string object") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(__string.length+1, 0) === "this is a string object". Actual: '+__string.substring(__string.length+1, 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.15_String.prototype.substring/S15.5.4.15_A2_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.15_String.prototype.substring/S15.5.4.15_A2_T9.js new file mode 100644 index 000000000..a28f052a9 --- /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.15_String.prototype.substring/S15.5.4.15_A2_T9.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.5.4.15_A2_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is -Infinity, end is -Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(-Infinity, -Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(-Infinity, -Infinity) === "". Actual: '+__string.substring(-Infinity, -Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A3_T1.js new file mode 100644 index 000000000..51ebb337c --- /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.15_String.prototype.substring/S15.5.4.15_A3_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.15_A3_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is Infinity, end is -Infinity; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Infinity,-Infinity) !== "1,2,3,4,5") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(Infinity,-Infinity) === "1,2,3,4,5". Actual: '+__instance.substring(Infinity,-Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T10.js new file mode 100644 index 000000000..d457e3769 --- /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.15_String.prototype.substring/S15.5.4.15_A3_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.5.4.15_A3_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Checknig if applying String.prototype.substring to Function object instance passes; +*/ + +__FACTORY.prototype.substring = String.prototype.substring; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(0, 100) !== "undefined") { + $ERROR('#1: __instance.substring(0, 100) === "undefined". Actual: '+__instance.substring(0, 100) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __FACTORY( value ) { + this.value = value; + this.toString = 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T11.js new file mode 100644 index 000000000..f991069c2 --- /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.15_String.prototype.substring/S15.5.4.15_A3_T11.js @@ -0,0 +1,22 @@ +// 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.15_A3_T11; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Boolean instance. Start is new Array(), end is new Boolean(1); +*/ + +var __instance = new Boolean(); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(new Array(), new Boolean(1)) !== "f") { + $ERROR('#1: __instance = new Boolean(); __instance.substring = String.prototype.substring; __instance.substring(new Array(), new Boolean(1)) === "f". Actual: '+__instance.substring(new Array(), new Boolean(1)) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T2.js new file mode 100644 index 000000000..f80f3f645 --- /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.15_String.prototype.substring/S15.5.4.15_A3_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.15_A3_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is 9, end is -Infinity; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(9,-Infinity) !== "1,2,3,4,5") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(9,-Infinity) === "1,2,3,4,5". Actual: '+__instance.substring(9,-Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T3.js new file mode 100644 index 000000000..ab9f7f6c8 --- /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.15_String.prototype.substring/S15.5.4.15_A3_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.15_A3_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is true, end is false; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(true, false) !== "1") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(true, false) === "1". Actual: '+__instance.substring(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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T4.js new file mode 100644 index 000000000..a4983fa84 --- /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.15_String.prototype.substring/S15.5.4.15_A3_T4.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.15_A3_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is '4', end is '5'; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring('4', '5') !== "3") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(\'4\', \'5\') === "3". Actual: '+__instance.substring('4', '5') ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T5.js new file mode 100644 index 000000000..12b8722d1 --- /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.15_String.prototype.substring/S15.5.4.15_A3_T5.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.15_A3_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Start is 8, end is 0; +*/ + +var __instance = new Object(); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(8,0) !== "[object ") { + $ERROR('#1: __instance = new Object(); __instance.substring = String.prototype.substring; __instance.substring(8,0) === "[object ". Actual: '+__instance.substring(8,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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T6.js new file mode 100644 index 000000000..4b5a40c59 --- /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.15_String.prototype.substring/S15.5.4.15_A3_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.5.4.15_A3_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Start is 8, end is length of object.toString; +*/ + +var __instance = new Object(); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(8, __instance.toString().length) !== "Object]") { + $ERROR('#1: __instance = new Object(); __instance.substring = String.prototype.substring; __instance.substring(8, __instance.toString().length) === "Object]". Actual: '+__instance.substring(8, __instance.toString().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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T7.js new file mode 100644 index 000000000..a8696c579 --- /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.15_String.prototype.substring/S15.5.4.15_A3_T7.js @@ -0,0 +1,22 @@ +// 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.15_A3_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Call instance.substring(...).substring(...); +*/ + +var __instance = function(){}; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(-Infinity,8) !== "function") { + $ERROR('#1: __instance = function(){}; __instance.substring = String.prototype.substring; __instance.substring(-Infinity,8) === "function". Actual: '+__instance.substring(8,Infinity).substring(-Infinity,1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T8.js new file mode 100644 index 000000000..0e5fcc1bf --- /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.15_String.prototype.substring/S15.5.4.15_A3_T8.js @@ -0,0 +1,22 @@ +// 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.15_A3_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Number instance. Start is Infinity, end is NaN; +*/ + +var __instance = new Number(NaN); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Infinity, NaN) !== "NaN") { + $ERROR('#1: __instance = new Number(NaN); __instance.substring = String.prototype.substring; __instance.substring(Infinity, NaN) === "NaN". Actual: '+__instance.substring(Infinity, NaN) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_A3_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.15_String.prototype.substring/S15.5.4.15_A3_T9.js new file mode 100644 index 000000000..2bfef21a9 --- /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.15_String.prototype.substring/S15.5.4.15_A3_T9.js @@ -0,0 +1,22 @@ +// 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.15_A3_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Math instance. Start is Math.PI, end is -10; +*/ + +var __instance = Math; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Math.PI, -10) !== "[ob") { + $ERROR('#1: __instance = Math; __instance.substring = String.prototype.substring; __instance.substring(Math.PI, -10) === "[ob". Actual: '+__instance.substring(Math.PI, -10) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A6.js new file mode 100644 index 000000000..4f1e52ead --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A6; +* @section: 15.5.4.15, 13.2; +* @assertion: String.prototype.substring has not prototype property; +* @description: Checking String.prototype.substring.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.substring.prototype !== undefined) { + $ERROR('#1: String.prototype.substring.prototype === undefined. Actual: '+String.prototype.substring.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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A7.js new file mode 100644 index 000000000..78a791d3b --- /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.15_String.prototype.substring/S15.5.4.15_A7.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.15_A7; +* @section: 15.5.4.15, 13.2; +* @assertion: String.prototype.substring can't be used as constructor; +* @description: Checking if creating the String.prototype.substring object fails; +*/ + +var __FACTORY = String.prototype.substring; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.substring; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: undefined = 1 throw a TypeError. Actual: ' + (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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A8.js new file mode 100644 index 000000000..1ce7cd13f --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A8; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.substring.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.substring.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (var p in String.prototype.substring){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.substring){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.15_String.prototype.substring/S15.5.4.15_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.15_String.prototype.substring/S15.5.4.15_A9.js new file mode 100644 index 000000000..4a947b2e2 --- /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.15_String.prototype.substring/S15.5.4.15_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.15_A9; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.substring.length) { + $ERROR('#1: delete String.prototype.substring.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.substring.length; String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A10.js new file mode 100644 index 000000000..1ed990ff2 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A10; +* @section: 15.5.4.16; +* @assertion: The String.prototype.toLowerCase.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.toLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.toLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.toLowerCase.length; + +String.prototype.toLowerCase.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLowerCase.length !== __obj) { + $ERROR('#2: __obj = String.prototype.toLowerCase.length; String.prototype.toLowerCase.length = function(){return "shifted";}; String.prototype.toLowerCase.length === __obj. Actual: '+String.prototype.toLowerCase.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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A11.js new file mode 100644 index 000000000..b1f970c70 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A11; +* @section: 15.5.4.16; +* @assertion: The length property of the toLowerCase method is 0; +* @description: Checking String.prototype.toLowerCase.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLowerCase.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.toLowerCase.hasOwnProperty("length") return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLowerCase.length !== 0) { + $ERROR('#2: String.prototype.toLowerCase.length === 0. Actual: '+String.prototype.toLowerCase.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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T1.js new file mode 100644 index 000000000..6cee6a91d --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A1_T1; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLowerCase() !== "true") { + $ERROR('#1: __instance = new Object(true); __instance.toLowerCase = String.prototype.toLowerCase; __instance.toLowerCase() === "true". Actual: '+__instance.toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T10.js new file mode 100644 index 000000000..0bc9811e8 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T10.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.16_A1_T10; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function of object with overrode toString function; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +__obj.toLowerCase = String.prototype.toLowerCase; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLowerCase() !=="ab") { + $ERROR('#1: var __obj = {toString:function(){return "\u0041B";}}; __obj.toLowerCase = String.prototype.toLowerCase; __obj.toLowerCase() ==="ab". Actual: '+__obj.toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T11.js new file mode 100644 index 000000000..d4df594d7 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T11.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.16_A1_T11; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Override toString function, toString throw exception, then call toLowerCase() function for this object; +*/ + +var __obj = {toString:function(){throw "intostr";}} +__obj.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLowerCase(); + $FAIL('#1: "var x = __obj.toLowerCase()" 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T12.js new file mode 100644 index 000000000..4ab84d5e7 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T12.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.16_A1_T12; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Override toString and valueOf functions, valueOf throw exception, then call toLowerCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +__obj.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLowerCase(); + $FAIL('#1: "var x = __obj.toLowerCase()" 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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T13.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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T13.js new file mode 100644 index 000000000..dfd8c2f97 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T13.js @@ -0,0 +1,28 @@ +// 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.16_A1_T13; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Override toString and valueOf functions, then call toLowerCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} +__obj.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLowerCase() !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLowerCase = String.prototype.toLowerCase; __obj.toLowerCase() ==="1". Actual: '+__obj.toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj.toLowerCase().length !== 1) { + $ERROR('#2: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLowerCase = String.prototype.toLowerCase; __obj.toLowerCase().length === 1. Actual: '+__obj.toLowerCase().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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T14.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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T14.js new file mode 100644 index 000000000..096942c8e --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T14.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.16_A1_T14; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function for RegExp object; +*/ + +var __reg = new RegExp("ABC"); +__reg.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__reg.toLowerCase() !== "/abc/") { + $ERROR('#1: var __reg = new RegExp("ABC"); __reg.toLowerCase = String.prototype.toLowerCase; __reg.toLowerCase() === "/abc/". Actual: '+__reg.toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T2.js new file mode 100644 index 000000000..dabf5dc92 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A1_T2; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Instance is Boolean object; +*/ + +__instance = new Boolean; + +__instance.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLowerCase() !== "false") { + $ERROR('#1: __instance = new Boolean; __instance.toLowerCase = String.prototype.toLowerCase; __instance.toLowerCase() === "false". Actual: '+__instance.toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T3.js new file mode 100644 index 000000000..a7f8bbeb3 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T3.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.16_A1_T3; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Checking by using eval; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (eval("\"BJ\"").toLowerCase() !== "bj") { + $ERROR('#1: eval("\\"BJ\\"").toLowerCase() === "bj". Actual: '+eval("\"BJ\"").toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T4.js new file mode 100644 index 000000000..2c24dd45b --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T4.js @@ -0,0 +1,45 @@ +// 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.16_A1_T4; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function without arguments of string and from empty string; +*/ + +var __lowerCase = "".toLowerCase(); + +var __expected = ""; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __lowerCase = "".toLowerCase(); __expected = ""; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __lowerCase = "".toLowerCase(); __expected = ""; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __lowerCase = "".toLowerCase(); __expected = ""; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__lowerCase[0]!==__expected[0]) { + $ERROR('#4: __lowerCase = "".toLowerCase(); __expected = ""; __lowerCase[0]==='+__expected[0]+'. Actual: '+__lowerCase[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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T5.js new file mode 100644 index 000000000..7a1c12180 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A1_T5; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function for function call; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "GnulLuNa"}().toLowerCase() !== "gnulluna") { + $ERROR('#1: function(){return "GnulLuNa"}().toLowerCase() === "gnulluna". Actual: '+function(){return "GnulLuNa"}().toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T6.js new file mode 100644 index 000000000..2db519b9b --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_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.5.4.16_A1_T6; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function of Number.NEGATIVE_INFINITY; +*/ + +Number.prototype.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((Number.NEGATIVE_INFINITY).toLowerCase() !== "-infinity") { + $ERROR('#1: Number.prototype.toLowerCase = String.prototype.toLowerCase; (Number.NEGATIVE_INFINITY).toLowerCase() === "-infinity". Actual: '+(Number.NEGATIVE_INFINITY).toLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + + 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T7.js new file mode 100644 index 000000000..776db5b30 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_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.5.4.16_A1_T7; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function of NaN; +*/ + +Number.prototype.toLowerCase = String.prototype.toLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (NaN.toLowerCase()!== "nan") { + $ERROR('#1: Number.prototype.toLowerCase = String.prototype.toLowerCase; NaN.toLowerCase()=== "nan". Actual: '+NaN.toLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T8.js new file mode 100644 index 000000000..8a29ffb71 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T8.js @@ -0,0 +1,15 @@ +// 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.16_A1_T8; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function of Infinity; +*/ + +Number.prototype.toLowerCase = String.prototype.toLowerCase; + +if (Infinity.toLowerCase()!== "infinity") { + $ERROR('#1: Number.prototype.toLowerCase = String.prototype.toLowerCase; Infinity.toLowerCase()=== "infinity". Actual: '+Infinity.toLowerCase()); +} 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T9.js new file mode 100644 index 000000000..2d574c0fa --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A1_T9.js @@ -0,0 +1,52 @@ +// 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.16_A1_T9; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase(); +* @description: Call toLowerCase() function of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __lowerCase = new String(__obj).toLowerCase(); + +var __expected ="undefined"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLowerCase(); __expected ="undefined"; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLowerCase(); __expected ="undefined"; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLowerCase(); __expected ="undefined"; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__lowerCase[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLowerCase(); __expected ="undefined"; __lowerCase['+index+']==='+__expected[index]+'. Actual: '+__lowerCase[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_A2_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.16_String.prototype.toLowerCase/S15.5.4.16_A2_T1.js new file mode 100644 index 000000000..c7a793d3d --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A2_T1.js @@ -0,0 +1,34 @@ +// 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.16_A2_T1; +* @section: 15.5.4.16; +* @assertion: String.prototype.toLowerCase() return a string, but not a String object; +* @description: Checking returned result; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("Hello, WoRlD!".toLowerCase() !== "hello, world!") { + $ERROR('#1: "Hello, WoRlD!".toLowerCase() === "hello, world!". Actual: '+("Hello, WoRlD!".toLowerCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if ("Hello, WoRlD!".toLowerCase() !== String("hello, world!")) { + $ERROR('#2: "Hello, WoRlD!".toLowerCase() === String("hello, world!"). Actual: '+("Hello, WoRlD!".toLowerCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("Hello, WoRlD!".toLowerCase() ===new String("hello, world!")) { + $ERROR('#3: "Hello, WoRlD!".toLowerCase() !== new String("hello, world!")'); +} +// +////////////////////////////////////////////////////////////////////////////// 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A6.js new file mode 100644 index 000000000..0630b4e6e --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A6; +* @section: 15.5.4.16, 13.2; +* @assertion: String.prototype.toLowerCase has not prototype property; +* @description: Checking String.prototype.toLowerCase.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toLowerCase.prototype !== undefined) { + $ERROR('#1: String.prototype.toLowerCase.prototype === undefined. Actual: '+String.prototype.toLowerCase.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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A7.js new file mode 100644 index 000000000..7a834e9c8 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_A7.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.16_A7; +* @section: 15.5.4.16, 13.2; +* @assertion: String.prototype.toLowerCase can't be used as constructor; +* @description: Checking if creating the String.prototype.toLowerCase object fails; +*/ + +var __FACTORY = String.prototype.toLowerCase; + +try { + var __instance = new __FACTORY; + $FAIL('#1: var __FACTORY = String.prototype.toLowerCase; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.1: var __FACTORY = String.prototype.toLowerCase; "__instance = new __FACTORY" throws a TypeError. 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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A8.js new file mode 100644 index 000000000..6e841fd07 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A8; +* @section: 15.5.4.16; +* @assertion: The String.prototype.toLowerCase.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.toLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.toLowerCase.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.toLowerCase.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.toLowerCase){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.toLowerCase){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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_String.prototype.toLowerCase/S15.5.4.16_A9.js new file mode 100644 index 000000000..28706c099 --- /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.16_String.prototype.toLowerCase/S15.5.4.16_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.16_A9; +* @section: 15.5.4.16; +* @assertion: The String.prototype.toLowerCase.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.toLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.toLowerCase.length) { + $ERROR('#1: delete String.prototype.toLowerCase.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty('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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A10.js new file mode 100644 index 000000000..bb762f5b4 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A10; +* @section: 15.5.4.17; +* @assertion: The String.prototype.toLocaleLowerCase.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.toLocaleLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +__obj = String.prototype.toLocaleLowerCase.length; + +String.prototype.toLocaleLowerCase.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleLowerCase.length !== __obj) { + $ERROR('#2: __obj = String.prototype.toLocaleLowerCase.length; String.prototype.toLocaleLowerCase.length = function(){return "shifted";}; String.prototype.toLocaleLowerCase.length === __obj. Actual: '+String.prototype.toLocaleLowerCase.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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A11.js new file mode 100644 index 000000000..6ad7e5266 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A11; +* @section: 15.5.4.17; +* @assertion: The length property of the toLocaleLowerCase method is 0; +* @description: Checking String.prototype.toLocaleLowerCase.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.toLocaleLowerCase.hasOwnProperty("length") return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleLowerCase.length !== 0) { + $ERROR('#2: String.prototype.toLocaleLowerCase.length === 0. Actual: '+String.prototype.toLocaleLowerCase.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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T1.js new file mode 100644 index 000000000..981c3cd8d --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A1_T1; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleLowerCase() !== "true") { + $ERROR('#1: __instance = new Object(true); __instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __instance.toLocaleLowerCase() === "true". Actual: '+__instance.toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T10.js new file mode 100644 index 000000000..53fad3e0d --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T10.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.17_A1_T10; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function of object with overrode toString function; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleLowerCase() !=="ab") { + $ERROR('#1: var __obj = {toString:function(){return "\u0041B";}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase() ==="ab". Actual: '+__obj.toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T11.js new file mode 100644 index 000000000..fddcf72a2 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T11.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.17_A1_T11; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Override toString function, toString throw exception, then call toLocaleLowerCase() function for this object; +*/ + +var __obj = {toString:function(){throw "intostr";}} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleLowerCase(); + $FAIL('#1: "var x = __obj.toLocaleLowerCase()" 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T12.js new file mode 100644 index 000000000..24bebb2c0 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T12.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.17_A1_T12; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Override toString and valueOf functions, valueOf throw exception, then call toLocaleLowerCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleLowerCase(); + $FAIL('#1: "var x = __obj.toLocaleLowerCase()" 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T13.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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T13.js new file mode 100644 index 000000000..f799baa54 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T13.js @@ -0,0 +1,28 @@ +// 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.17_A1_T13; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Override toString and valueOf functions, then call toLocaleLowerCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleLowerCase() !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase() ==="1". Actual: '+__obj.toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj.toLocaleLowerCase().length !== 1) { + $ERROR('#2: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase().length === 1. Actual: '+__obj.toLocaleLowerCase().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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T14.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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T14.js new file mode 100644 index 000000000..b565c9f27 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T14.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.17_A1_T14; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function for RegExp object; +*/ + +var __reg = new RegExp("ABC"); +__reg.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__reg.toLocaleLowerCase() !== "/abc/") { + $ERROR('#1: var __reg = new RegExp("ABC"); __reg.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __reg.toLocaleLowerCase() === "/abc/". Actual: '+__reg.toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T2.js new file mode 100644 index 000000000..af33165a2 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A1_T2; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleLowerCase() !== "false") { + $ERROR('#1: __instance = new Boolean; __instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __instance.toLocaleLowerCase() === "false". Actual: '+__instance.toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T3.js new file mode 100644 index 000000000..1f93dea59 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T3.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.17_A1_T3; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Checking by using eval; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (eval("\"BJ\"").toLocaleLowerCase() !== "bj") { + $ERROR('#1: eval("\\"BJ\\"").toLocaleLowerCase() === "bj". Actual: '+eval("\"BJ\"").toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T4.js new file mode 100644 index 000000000..35f3c8c69 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T4.js @@ -0,0 +1,45 @@ +// 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.17_A1_T4; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function without arguments of string and from empty string; +*/ + +var __lowerCase = "".toLocaleLowerCase(); + +var __expected = ""; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__lowerCase[0]!==__expected[0]) { + $ERROR('#4: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase[0]===__expected[0]. Actual: '+__lowerCase[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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T5.js new file mode 100644 index 000000000..fd261b430 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A1_T5; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function for function call; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "GnulLuNa"}().toLocaleLowerCase() !== "gnulluna") { + $ERROR('#1: function(){return "GnulLuNa"}().toLocaleLowerCase() === "gnulluna". Actual: '+function(){return "GnulLuNa"}().toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T6.js new file mode 100644 index 000000000..a65ad9182 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T6.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.5.4.17_A1_T6; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function of Number.NEGATIVE_INFINITY; +*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((Number.NEGATIVE_INFINITY).toLocaleLowerCase() !== "-infinity") { + $ERROR('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; (Number.NEGATIVE_INFINITY).toLocaleLowerCase() === "-infinity". Actual: '+(Number.NEGATIVE_INFINITY).toLocaleLowerCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T7.js new file mode 100644 index 000000000..d01922e24 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_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.5.4.17_A1_T7; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function of NaN; +*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (NaN.toLocaleLowerCase()!== "nan") { + $ERROR('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; NaN.toLocaleLowerCase()=== "nan". Actual: '+NaN.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T8.js new file mode 100644 index 000000000..7b884b849 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T8.js @@ -0,0 +1,15 @@ +// 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.17_A1_T8; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function of Infinity; +*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +if (Infinity.toLocaleLowerCase()!== "infinity") { + $ERROR('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; Infinity.toLocaleLowerCase()=== "infinity". Actual: '+Infinity.toLocaleLowerCase()); +} 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T9.js new file mode 100644 index 000000000..b3941eaf6 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A1_T9.js @@ -0,0 +1,53 @@ +// 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.17_A1_T9; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase(); +* @description: Call toLocaleLowerCase() function of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __lowerCase = new String(__obj).toLocaleLowerCase(); + + +var __expected ="undefined"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__lowerCase[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase['+index+']=== '+__expected[index]+'. Actual: '+__lowerCase[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A2_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A2_T1.js new file mode 100644 index 000000000..b26679e34 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A2_T1.js @@ -0,0 +1,34 @@ +// 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.17_A2_T1; +* @section: 15.5.4.17; +* @assertion: String.prototype.toLocaleLowerCase() return a string, but not a String object; +* @description: Checking returned result; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("Hello, WoRlD!".toLocaleLowerCase() !== "hello, world!") { + $ERROR('#1: "Hello, WoRlD!".toLocaleLowerCase() === "hello, world!". Actual: '+("Hello, WoRlD!".toLocaleLowerCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if ("Hello, WoRlD!".toLocaleLowerCase() !== String("hello, world!")) { + $ERROR('#2: "Hello, WoRlD!".toLocaleLowerCase() === String("hello, world!"). Actual: '+("Hello, WoRlD!".toLocaleLowerCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("Hello, WoRlD!".toLocaleLowerCase() === new String("hello, world!")) { + $ERROR('#3: "Hello, WoRlD!".toLocaleLowerCase() !== new String("hello, world!")'); +} +// +////////////////////////////////////////////////////////////////////////////// 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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A6.js new file mode 100644 index 000000000..49329b5be --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A6; +* @section: 15.5.4.17, 13.2; +* @assertion: String.prototype.toLocaleLowerCase has not prototype property; +* @description: Checking String.prototype.toLocaleLowerCase.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toLocaleLowerCase.prototype !== undefined) { + $ERROR('#1: String.prototype.toLocaleLowerCase.prototype === undefined. Actual: '+String.prototype.toLocaleLowerCase.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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A7.js new file mode 100644 index 000000000..ca4fbba8d --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A7.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.17_A7; +* @section: 15.5.4.17, 13.2; +* @assertion: String.prototype.toLocaleLowerCase can't be used as constructor; +* @description: Checking if creating the String.prototype.toLocaleLowerCase object fails; +*/ + +var __FACTORY = String.prototype.toLocaleLowerCase; + +try { + var __instance = new __FACTORY; + $FAIL('#1: var __FACTORY = String.prototype.toLocaleLowerCase; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.1: var __FACTORY = String.prototype.toLocaleLowerCase; "var __instance = new __FACTORY" throw a TypeError. Actual: ' + (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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A8.js new file mode 100644 index 000000000..96b2eda47 --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A8; +* @section: 15.5.4.17; +* @assertion: The String.prototype.toLocaleLowerCase.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.toLocaleLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.toLocaleLowerCase.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.toLocaleLowerCase.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (var p in String.prototype.toLocaleLowerCase){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.toLocaleLowerCase){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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A9.js new file mode 100644 index 000000000..24c16625a --- /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.17_String.prototype.toLocaleLowerCase/S15.5.4.17_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.17_A9; +* @section: 15.5.4.17; +* @assertion: The String.prototype.toLocaleLowerCase.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.toLocaleLowerCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.toLocaleLowerCase.length) { + $ERROR('#1: delete String.prototype.toLocaleLowerCase.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.toLocaleLowerCase.length; String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty('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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A10.js new file mode 100644 index 000000000..babee0f74 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A10; +* @section: 15.5.4.18; +* @assertion: The String.prototype.toUpperCase.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.toUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toUpperCase.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.toUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.toUpperCase.length; + +String.prototype.toUpperCase.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toUpperCase.length !== __obj) { + $ERROR('#2: __obj = String.prototype.toUpperCase.length; String.prototype.toUpperCase.length = function(){return "shifted";}; String.prototype.toUpperCase.length === __obj. Actual: '+String.prototype.toUpperCase.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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A11.js new file mode 100644 index 000000000..3b1bbf2e9 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A11; +* @section: 15.5.4.18; +* @assertion: The length property of the toUpperCase method is 0; +* @description: Checking String.prototype.toUpperCase.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toUpperCase.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.toUpperCase.hasOwnProperty("length") return true. Actual: '+String.prototype.toUpperCase.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toUpperCase.length !== 0) { + $ERROR('#2: String.prototype.toUpperCase.length === 0. Actual: '+String.prototype.toUpperCase.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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T1.js new file mode 100644 index 000000000..ae56c021d --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A1_T1; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toUpperCase() !== "TRUE") { + $ERROR('#1: __instance = new Object(true); __instance.toUpperCase = String.prototype.toUpperCase; __instance.toUpperCase() === "TRUE". Actual: '+__instance.toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T10.js new file mode 100644 index 000000000..58004833a --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T10.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.18_A1_T10; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of object with overrode toString function; +*/ + +var __obj = {toString:function(){return "\u0041b";}} +__obj.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toUpperCase() !=="AB") { + $ERROR('#1: var __obj = {toString:function(){return "\u0041b";}}; __obj.toUpperCase = String.prototype.toUpperCase; __obj.toUpperCase() ==="AB". Actual: '+__obj.toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T11.js new file mode 100644 index 000000000..e4e09df11 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T11.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.5.4.18_A1_T11; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Override toString function, toString throw exception, then call toUpperCase() function for this object; +*/ + +var __obj = {toString:function(){throw "intostr";}} +__obj.toUpperCase = String.prototype.toUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toUpperCase(); + $FAIL('#1: "var x = __obj.toUpperCase()" 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T12.js new file mode 100644 index 000000000..7f569f52f --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T12.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.5.4.18_A1_T12; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Override toString and valueOf functions, valueOf throw exception, then call toUpperCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +__obj.toUpperCase = String.prototype.toUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toUpperCase(); + $FAIL('#1: "var x = __obj.toUpperCase()" 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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T13.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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T13.js new file mode 100644 index 000000000..cec4782ca --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T13.js @@ -0,0 +1,28 @@ +// 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.18_A1_T13; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Override toString and valueOf functions, then call toUpperCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} +__obj.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toUpperCase() !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toUpperCase = String.prototype.toUpperCase; __obj.toUpperCase() ==="1". Actual: '+__obj.toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj.toUpperCase().length !== 1) { + $ERROR('#2: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toUpperCase = String.prototype.toUpperCase; __obj.toUpperCase().length === 1. Actual: '+__obj.toUpperCase().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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T14.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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T14.js new file mode 100644 index 000000000..91d259a7f --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T14.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.5.4.18_A1_T14; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of RegExp object; +*/ + +var __reg = new RegExp("abc"); +__reg.toUpperCase = String.prototype.toUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__reg.toUpperCase() !== "/ABC/") { + $ERROR('#1: var __reg = new RegExp("abc"); __reg.toUpperCase = String.prototype.toUpperCase; __reg.toUpperCase() === "/ABC/". Actual: '+__reg.toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T2.js new file mode 100644 index 000000000..a189cb320 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A1_T2; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toUpperCase() !== "FALSE") { + $ERROR('#1: __instance = new Boolean; __instance.toUpperCase = String.prototype.toUpperCase; __instance.toUpperCase() === "FALSE". Actual: '+__instance.toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T3.js new file mode 100644 index 000000000..48c1d1242 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T3.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.18_A1_T3; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Checking by using eval; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (eval("\"bj\"").toUpperCase() !== "BJ") { + $ERROR('#1: eval("\\"bj\\"").toUpperCase() === "BJ". Actual: '+eval("\"bj\"").toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T4.js new file mode 100644 index 000000000..788c9705c --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T4.js @@ -0,0 +1,45 @@ +// 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.18_A1_T4; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function without arguments of string and from empty string; +*/ + +var __lowerCase = "".toUpperCase(); + +var __expected = ""; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __lowerCase = "".toUpperCase(); __expected = ""; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __lowerCase = "".toUpperCase(); __expected = ""; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __lowerCase = "".toUpperCase(); __expected = ""; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__lowerCase[0]!==__expected[0]) { + $ERROR('#4: __lowerCase = "".toUpperCase(); __expected = ""; __lowerCase[0]==='+__expected[0]+'. Actual: '+__lowerCase[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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T5.js new file mode 100644 index 000000000..9689a2c2e --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A1_T5; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of function call; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "GnulLuNa"}().toUpperCase() !== "GNULLUNA") { + $ERROR('#1: function(){return "GnulLuNa"}().toUpperCase() === "GNULLUNA". Actual: '+function(){return "GnulLuNa"}().toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T6.js new file mode 100644 index 000000000..28d8a0212 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T6.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.5.4.18_A1_T6; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of Number.NEGATIVE_INFINITY; +*/ + +Number.prototype.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((Number.NEGATIVE_INFINITY).toUpperCase() !== "-INFINITY") { + $ERROR('#1: Number.prototype.toUpperCase = String.prototype.toUpperCase; (Number.NEGATIVE_INFINITY).toUpperCase() === "-INFINITY". Actual: '+(Number.NEGATIVE_INFINITY).toUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T7.js new file mode 100644 index 000000000..868301dbe --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_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.5.4.18_A1_T7; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of NaN; +*/ + +Number.prototype.toUpperCase = String.prototype.toUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (NaN.toUpperCase()!== "NAN") { + $ERROR('#1: Number.prototype.toUpperCase = String.prototype.toUpperCase; NaN.toUpperCase()=== "NAN". Actual: '+NaN.toUpperCase()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T8.js new file mode 100644 index 000000000..277f8184f --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T8.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.5.4.18_A1_T8; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of Infinity; +* +*/ + +Number.prototype.toUpperCase = String.prototype.toUpperCase; + +if (Infinity.toUpperCase()!== "INFINITY") { + $ERROR('#1: Number.prototype.toUpperCase = String.prototype.toUpperCase; Infinity.toUpperCase()=== "INFINITY". Actual: '+Infinity.toUpperCase()); +} 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T9.js new file mode 100644 index 000000000..4e56c90d6 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A1_T9.js @@ -0,0 +1,52 @@ +// 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.18_A1_T9; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase(); +* @description: Call toUpperCase() function of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __upperCase = new String(__obj).toUpperCase(); + +var __expected ="UNDEFINED"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__upperCase.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __upperCase = new String(__obj).toUpperCase(); __expected ="UNDEFINED"; __upperCase.length === __expected.length. Actual: '+__upperCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__upperCase.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __upperCase = new String(__obj).toUpperCase(); __expected ="UNDEFINED"; __upperCase.index === __expected.index. Actual: '+__upperCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__upperCase.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __upperCase = new String(__obj).toUpperCase(); __expected ="UNDEFINED"; __upperCase.input === __expected.input. Actual: '+__upperCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__upperCase[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __upperCase = new String(__obj).toUpperCase(); __expected ="UNDEFINED"; __upperCase['+index+']==='+__expected[index]+'. Actual: '+__upperCase[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_A2_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.18_String.prototype.toUpperCase/S15.5.4.18_A2_T1.js new file mode 100644 index 000000000..3ac25001b --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A2_T1.js @@ -0,0 +1,34 @@ +// 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.18_A2_T1; +* @section: 15.5.4.18; +* @assertion: String.prototype.toUpperCase() return a string, but not a String object; +* @description: Checking returned result; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("Hello, WoRlD!".toUpperCase() !== "HELLO, WORLD!") { + $ERROR('#1: "Hello, WoRlD!".toUpperCase() === "HELLO, WORLD!". Actual: '+("Hello, WoRlD!".toUpperCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if ("Hello, WoRlD!".toUpperCase() !== String("HELLO, WORLD!")) { + $ERROR('#2: "Hello, WoRlD!".toUpperCase() === String("HELLO, WORLD!"). Actual: '+("Hello, WoRlD!".toUpperCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("Hello, WoRlD!".toUpperCase() ===new String("HELLO, WORLD!")) { + $ERROR('#3: "Hello, WoRlD!".toUpperCase() !== new String("HELLO, WORLD!")'); +} +// +////////////////////////////////////////////////////////////////////////////// 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A6.js new file mode 100644 index 000000000..c0bea8f32 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A6; +* @section: 15.5.4.18, 13.2; +* @assertion: String.prototype.toUpperCase has not prototype property; +* @description: Checking String.prototype.toUpperCase.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toUpperCase.prototype !== undefined) { + $ERROR('#1: String.prototype.toUpperCase.prototype === undefined. Actual: '+String.prototype.toUpperCase.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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A7.js new file mode 100644 index 000000000..4a3550f63 --- /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.18_String.prototype.toUpperCase/S15.5.4.18_A7.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.18_A7; +* @section: 15.5.4.18, 13.2; +* @assertion: String.prototype.toUpperCase can't be used as constructor; +* @description: Checking if creating the String.prototype.toUpperCase object fails; +*/ + +var __FACTORY = String.prototype.toUpperCase; + +try { + var __instance = new __FACTORY; + $FAIL('#1: var __FACTORY = String.prototype.toUpperCase; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.1: var __FACTORY = String.prototype.toUpperCase; "__instance = new __FACTORY" throw a TypeError. 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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A8.js new file mode 100644 index 000000000..47824acac --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A8; +* @section: 15.5.4.18; +* @assertion: The String.prototype.toUpperCase.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.toUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toUpperCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.toUpperCase.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.toUpperCase.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.toUpperCase){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.toUpperCase){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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_String.prototype.toUpperCase/S15.5.4.18_A9.js new file mode 100644 index 000000000..a1ae49b0c --- /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.18_String.prototype.toUpperCase/S15.5.4.18_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.18_A9; +* @section: 15.5.4.18; +* @assertion: The String.prototype.toUpperCase.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.toUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toUpperCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.toUpperCase.length) { + $ERROR('#1: delete String.prototype.toUpperCase.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.toUpperCase.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.toUpperCase.length; String.prototype.toUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toUpperCase.hasOwnProperty('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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A10.js new file mode 100644 index 000000000..36ca6df5f --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A10; +* @section: 15.5.4.19; +* @assertion: The String.prototype.toLocaleUpperCase.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.toLocaleUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleUpperCase.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.toLocaleUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.toLocaleUpperCase.length; + +String.prototype.toLocaleUpperCase.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleUpperCase.length !== __obj) { + $ERROR('#2: __obj = String.prototype.toLocaleUpperCase.length; String.prototype.toLocaleUpperCase.length = function(){return "shifted";}; String.prototype.toLocaleUpperCase.length === __obj. Actual: '+String.prototype.toLocaleUpperCase.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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A11.js new file mode 100644 index 000000000..692c99e21 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A11; +* @section: 15.5.4.19; +* @assertion: The length property of the toLocaleUpperCase method is 0; +* @description: Checking String.prototype.toLocaleUpperCase.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleUpperCase.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.toLocaleUpperCase.hasOwnProperty("length") return true. Actual: '+String.prototype.toLocaleUpperCase.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleUpperCase.length !== 0) { + $ERROR('#2: String.prototype.toLocaleUpperCase.length === 0. Actual: '+String.prototype.toLocaleUpperCase.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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T1.js new file mode 100644 index 000000000..3a320fec9 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A1_T1; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleUpperCase() !== "TRUE") { + $ERROR('#1: __instance = new Object(true); __instance.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __instance.toLocaleUpperCase() === "TRUE". Actual: '+__instance.toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T10.js new file mode 100644 index 000000000..b3d14cd71 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T10.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.19_A1_T10; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of object with overrode toString function; +*/ + +var __obj = {toString:function(){return "\u0041b";}} +__obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleUpperCase() !=="AB") { + $ERROR('#1: var __obj = {toString:function(){return "\u0041b";}}; __obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __obj.toLocaleUpperCase() ==="AB". Actual: '+__obj.toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T11.js new file mode 100644 index 000000000..78f015f77 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T11.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.5.4.19_A1_T11; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Override toString function, toString throw exception, then call toLocaleUpperCase() function for this object; +*/ + +var __obj = {toString:function(){throw "intostr";}} +__obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleUpperCase(); + $FAIL('#1: "var x = __obj.toLocaleUpperCase()" 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T12.js new file mode 100644 index 000000000..964182e18 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T12.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.5.4.19_A1_T12; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Override toString and valueOf functions, valueOf throw exception, then call toLocaleUpperCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +__obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleUpperCase(); + $FAIL('#1: "var x = __obj.toLocaleUpperCase()" 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T13.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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T13.js new file mode 100644 index 000000000..dd9a0a28f --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T13.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.19_A1_T13; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Override toString and valueOf functions, then call toLocaleUpperCase() function for this object; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} +__obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleUpperCase() !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __obj.toLocaleUpperCase() ==="1". Actual: '+__obj.toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj.toLocaleUpperCase().length !== 1) { + $ERROR('#2: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __obj.toLocaleUpperCase().length === 1. Actual: '+__obj.toLocaleUpperCase().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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T14.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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T14.js new file mode 100644 index 000000000..75499010f --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T14.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.5.4.19_A1_T14; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function for RegExp object; +*/ + +var __reg = new RegExp("abc"); +__reg.toLocaleUpperCase = String.prototype.toLocaleUpperCase; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__reg.toLocaleUpperCase() !== "/ABC/") { + $ERROR('#1: var __reg = new RegExp("abc"); __reg.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __reg.toLocaleUpperCase() === "/ABC/". Actual: '+__reg.toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T2.js new file mode 100644 index 000000000..e4414cfdb --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A1_T2; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleUpperCase() !== "FALSE") { + $ERROR('#1: __instance = new Boolean; __instance.toLocaleUpperCase = String.prototype.toLocaleUpperCase; __instance.toLocaleUpperCase() === "FALSE". Actual: '+__instance.toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T3.js new file mode 100644 index 000000000..c34e44546 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T3.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.19_A1_T3; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Checking by using eval; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (eval("\"bj\"").toLocaleUpperCase() !== "BJ") { + $ERROR('#1: eval("\\"bj\\"").toLocaleUpperCase() === "BJ". Actual: '+eval("\"bj\"").toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T4.js new file mode 100644 index 000000000..e41190077 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T4.js @@ -0,0 +1,44 @@ +// 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.19_A1_T4; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function without arguments of string and from empty string; +*/ + +var __lowerCase = "".toLocaleUpperCase(); +var __expected = ""; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __lowerCase = "".toLocaleUpperCase(); __expected = ""; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __lowerCase = "".toLocaleUpperCase(); __expected = ""; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __lowerCase = "".toLocaleUpperCase(); __expected = ""; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__lowerCase[0]!==__expected[0]) { + $ERROR('#4: __lowerCase = "".toLocaleUpperCase(); __lowerCase[0]==='+__expected[0]+'. Actual: '+__lowerCase[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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T5.js new file mode 100644 index 000000000..344668545 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A1_T5; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of function call; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "GnulLuNa"}().toLocaleUpperCase() !== "GNULLUNA") { + $ERROR('#1: function(){return "GnulLuNa"}().toLocaleUpperCase() === "GNULLUNA". Actual: '+function(){return "GnulLuNa"}().toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T6.js new file mode 100644 index 000000000..4718a90d3 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A1_T6; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of Number.NEGATIVE_INFINITY; +*/ + +Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((Number.NEGATIVE_INFINITY).toLocaleUpperCase() !== "-INFINITY") { + $ERROR('#1: Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; (Number.NEGATIVE_INFINITY).toLocaleUpperCase() === "-INFINITY". Actual: '+(Number.NEGATIVE_INFINITY).toLocaleUpperCase() ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T7.js new file mode 100644 index 000000000..f636a51f9 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_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.5.4.19_A1_T7; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of NaN; +*/ + +Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (NaN.toLocaleUpperCase()!== "NAN") { + $ERROR('#1: Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; NaN.toLocaleUpperCase()=== "NAN". Actual: '+NaN.toLocaleUpperCase()); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T8.js new file mode 100644 index 000000000..697eb15ec --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T8.js @@ -0,0 +1,15 @@ +// 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.19_A1_T8; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of Infinity; +*/ + +Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; + +if (Infinity.toLocaleUpperCase()!== "INFINITY") { + $ERROR('#1: Number.prototype.toLocaleUpperCase = String.prototype.toLocaleUpperCase; Infinity.toLocaleUpperCase()=== "INFINITY". Actual: '+Infinity.toLocaleUpperCase()); +} 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T9.js new file mode 100644 index 000000000..e3357ae43 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A1_T9.js @@ -0,0 +1,52 @@ +// 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.19_A1_T9; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase(); +* @description: Call toLocaleUpperCase() function of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __lowerCase = new String(__obj).toLocaleUpperCase(); + +var __expected ="UNDEFINED"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.length === __expected.length. Actual: '+__lowerCase.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.index === __expected.index. Actual: '+__lowerCase.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.input === __expected.input. Actual: '+__lowerCase.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__lowerCase[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase['+index+']==='+__expected[index]+'. Actual: '+__lowerCase[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A2_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A2_T1.js new file mode 100644 index 000000000..80315d3c9 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A2_T1.js @@ -0,0 +1,34 @@ +// 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.19_A2_T1; +* @section: 15.5.4.19; +* @assertion: String.prototype.toLocaleUpperCase() return a string, but not a String object; +* @description: Checking returned result; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("Hello, WoRlD!".toLocaleUpperCase() !== "HELLO, WORLD!") { + $ERROR('#1: "Hello, WoRlD!".toLocaleUpperCase() === "HELLO, WORLD!". Actual: '+("Hello, WoRlD!".toLocaleUpperCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if ("Hello, WoRlD!".toLocaleUpperCase() !== String("HELLO, WORLD!")) { + $ERROR('#2: "Hello, WoRlD!".toLocaleUpperCase() === String("HELLO, WORLD!"). Actual: '+("Hello, WoRlD!".toLocaleUpperCase()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("Hello, WoRlD!".toLocaleUpperCase() ===new String("HELLO, WORLD!")) { + $ERROR('#3: "Hello, WoRlD!".toLocaleUpperCase() !== new String("HELLO, WORLD!"'); +} +// +////////////////////////////////////////////////////////////////////////////// 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A6.js new file mode 100644 index 000000000..2baac9b39 --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A6; +* @section: 15.5.4.19, 13.2; +* @assertion: String.prototype.toLocaleUpperCase has not prototype property; +* @description: Checking String.prototype.toLocaleUpperCase.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toLocaleUpperCase.prototype !== undefined) { + $ERROR('#1: String.prototype.toLocaleUpperCase.prototype === undefined. Actual: '+String.prototype.toLocaleUpperCase.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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A7.js new file mode 100644 index 000000000..cb9f5c50c --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A7.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.19_A7; +* @section: 15.5.4.19, 13.2; +* @assertion: String.prototype.toLocaleUpperCase can't be used as constructor; +* @description: Checking if creating the String.prototype.toLocaleUpperCase object fails; +*/ + +var __FACTORY = String.prototype.toLocaleUpperCase; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.toLocaleUpperCase; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.1: var __instance = new __FACTORY; Object has no construct lead a TypeError. 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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A8.js new file mode 100644 index 000000000..dda36bd3f --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A8; +* @section: 15.5.4.19; +* @assertion: The String.prototype.toLocaleUpperCase.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.toLocaleUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleUpperCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLocaleUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.toLocaleUpperCase.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.toLocaleUpperCase.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (var p in String.prototype.toLocaleUpperCase){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.toLocaleUpperCase){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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_A9.js new file mode 100644 index 000000000..f5eb65a2a --- /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.19_String.prototype.toLocaleUpperCase/S15.5.4.19_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.19_A9; +* @section: 15.5.4.19; +* @assertion: The String.prototype.toLocaleUpperCase.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.toLocaleUpperCase.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleUpperCase.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.toLocaleUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleUpperCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.toLocaleUpperCase.length) { + $ERROR('#1: delete String.prototype.toLocaleUpperCase.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.toLocaleUpperCase.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.toLocaleUpperCase.length; String.prototype.toLocaleUpperCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleUpperCase.hasOwnProperty('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.4_String.prototype.charAt/S15.5.4.4_A1.1.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.4_String.prototype.charAt/S15.5.4.4_A1.1.js new file mode 100644 index 000000000..5a9376591 --- /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.4_String.prototype.charAt/S15.5.4.4_A1.1.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.5.4.4_A1.1; +* @section: 15.5.4.4, 13.2; +* @assertion: String.prototype.charAt() can accept many arguments; +* @description: Checking by using eval; +*/ + +function __FACTORY(){this.toString = function(){ return "wizard";};}; + +__FACTORY.prototype.charAt = String.prototype.charAt; + +__instance = new __FACTORY; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__instance){ + if (__instance.charAt(eval("1"),true,null,{})!== "i") { + $ERROR('#1: __instance.charAt(eval("1"),true,null,{})=== "i". Actual: '+__instance.charAt(eval("1"),true,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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A10.js new file mode 100644 index 000000000..2506e2ee3 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A10; +* @section: 15.5.4.4; +* @assertion: The String.prototype.charAt.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.charAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.charAt.hasOwnProperty('length'))) { + $ERROR('#1: String.prototype.charAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.charAt.length; + +String.prototype.charAt.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.charAt.length !== __obj) { + $ERROR('#2: __obj = String.prototype.charAt.length; String.prototype.charAt.length = function(){return "shifted";}; String.prototype.charAt.length === __obj. Actual: '+String.prototype.charAt.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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A11.js new file mode 100644 index 000000000..b83a8da50 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A11; +* @section: 15.5.4.4; +* @assertion: The length property of the charAt method is 1; +* @description: Checking String.prototype.charAt.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.charAt.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.charAt.hasOwnProperty("length") return true. Actual: '+String.prototype.charAt.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.charAt.length !== 1) { + $ERROR('#2: String.prototype.charAt.length === 1. Actual: '+String.prototype.charAt.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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T1.js new file mode 100644 index 000000000..1f74c3c93 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T1; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: pos is false and true, and instance is object; +*/ + +var __instance = new Object(42); + +__instance.charAt = String.prototype.charAt; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.charAt(false)+__instance.charAt(true) !== "42") { + $ERROR('#1: __instance = new Object(42); __instance.charAt = String.prototype.charAt; __instance = new Object(42); __instance.charAt = String.prototype.charAt; __instance.charAt(false)+__instance.charAt(true) === "42". Actual: '+__instance.charAt(false)+__instance.charAt(true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T10.js new file mode 100644 index 000000000..b5f436af0 --- /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.4_String.prototype.charAt/S15.5.4.4_A1_T10.js @@ -0,0 +1,22 @@ +// 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.4_A1_T10; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with object argument; +*/ + +var __obj = {toString:function(){return 1;}} +var __str = "lego"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (charAt(__obj) !== "e") { + $ERROR('#1: var __obj = {toString:function(){return 1;}}; var __str = "lego"; charAt(__obj) === "e". Actual: charAt(__obj) ==='+charAt(__obj) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T2.js new file mode 100644 index 000000000..ca6dd0fd2 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T2; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: pos is equation with false and true, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.charAt = String.prototype.charAt; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.charAt(false)+__instance.charAt(true)+__instance.charAt(true+1) !== "fal") { + $ERROR('#1: __instance = new Boolean; __instance.charAt = String.prototype.charAt; __instance = new Boolean; __instance.charAt = String.prototype.charAt; __instance.charAt(false)+__instance.charAt(true)+__instance.charAt(true+1) === "fal". Actual: '+__instance.charAt(false)+__instance.charAt(true)+__instance.charAt(true+1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T3.js new file mode 100644 index 000000000..564eba432 --- /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.4_String.prototype.charAt/S15.5.4.4_A1_T3.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.4_A1_T3; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Use numbers and strings as pos; +*/ + +var charAt = String.prototype.charAt; + +if (typeof toString === "undefined"){ + var toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (charAt("1") + charAt(2) + charAt("3") + charAt(4) + charAt("5") + charAt(6) !== "object") { + $ERROR('#1: charAt = String.prototype.charAt; charAt("1") + charAt(2) + charAt("3") + charAt(4) + charAt("5") + charAt(6) === "object". Actual: '+charAt("1") + charAt(2) + charAt("3") + charAt(4) + charAt("5") + charAt(6) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T4.js new file mode 100644 index 000000000..0aeff7564 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T4; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function without argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger() evaluates to 0 charAt() evaluates to charAt(0) +if ("lego".charAt() !== "l") { + $ERROR('#1: "lego".charAt() === "l". Actual: "lego".charAt() ==='+("lego".charAt()) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T5.js new file mode 100644 index 000000000..c68b450cb --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T5; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(null) evaluates to 0 charAt() evaluates to charAt(0) +if (function(){return "lego"}().charAt(null) !== "l") { + $ERROR('#1: function(){return "lego"}().charAt(null) === "l". Actual: function(){return "lego"}().charAt(null) ==='+function(){return "lego"}().charAt(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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T6.js new file mode 100644 index 000000000..4e0b48dd7 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T6; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with x argument of new String object, where x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charAt() evaluates to charAt(0) +if (new String("lego").charAt(x) !== "l") { + $ERROR('#1: var x; new String("lego").charAt(x) === "l". Actual: new String("lego").charAt(x) ==='+new String("lego").charAt(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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T7.js new file mode 100644 index 000000000..95420e614 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A1_T7; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with undefined argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charAt() evaluates to charAt(0) +if (String("lego").charAt(undefined) !== "l") { + $ERROR('#1: String("lego").charAt(undefined) === "l". Actual: String("lego").charAt(undefined) ==='+String("lego").charAt(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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T8.js new file mode 100644 index 000000000..86e7ced1c --- /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.4_String.prototype.charAt/S15.5.4.4_A1_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.5.4.4_A1_T8; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with void 0 argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(void 0) evaluates to 0 charAt() evaluates to charAt(0) +if (String(42).charAt(void 0) !== "4") { + $ERROR('#1: String(42).charAt(void 0) === "4". Actual: String(42).charAt(void 0) ==='+String(42).charAt(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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A1_T9.js new file mode 100644 index 000000000..14a1c7497 --- /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.4_String.prototype.charAt/S15.5.4.4_A1_T9.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.4_A1_T9; +* @section: 15.5.4.4; +* @assertion: String.prototype.charAt(pos); +* @description: Call charAt() function with function(){}() argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charAt() evaluates to charAt(0) +if (new String(42).charAt(function(){}()) !== "4") { + $ERROR('#1: new String(42).charAt(function(){}()) === "4". Actual: new String(42).charAt(function(){}()) ==='+new String(42).charAt(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.4_String.prototype.charAt/S15.5.4.4_A2.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.4_String.prototype.charAt/S15.5.4.4_A2.js new file mode 100644 index 000000000..535cdb532 --- /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.4_String.prototype.charAt/S15.5.4.4_A2.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.4_A2; +* @section: 15.5.4.4; +* @assertion: When String.prototype.charAt(pos) calls if ToInteger(pos) less than 0 the empty string returns; +* @description: Call charAt(pos) with negative pos; +*/ + +function __FACTORY(){}; + +__FACTORY.prototype.charAt = String.prototype.charAt; + +var __instance = new __FACTORY; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.charAt(-1) !== "") { + $ERROR('#1: __instance.charAt(-1) === "". Actual: __instance.charAt(-1) ==='+__instance.charAt(-1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_A3.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.4_String.prototype.charAt/S15.5.4.4_A3.js new file mode 100644 index 000000000..d223f06b9 --- /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.4_String.prototype.charAt/S15.5.4.4_A3.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.5.4.4_A3; +* @section: 15.5.4.4; +* @assertion: When String.prototype.charAt(pos) calls if ToInteger(pos) not less than ToString(this value) the empty string returns; +* @description: pos is bigger of string length; +*/ + +var __instance = new String("ABC"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.charAt(3) !== "") { + $ERROR('#1: __instance = new String("ABC"); __instance.charAt(3) === "". Actual: __instance.charAt(3) ==='+__instance.charAt(3) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A4_T1.js new file mode 100644 index 000000000..90b3945f9 --- /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.4_String.prototype.charAt/S15.5.4.4_A4_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.4_A4_T1; +* @section: 15.5.4.4; +* @assertion: If pos is a value of Number type that is an integer, then the result of x.charAt(pos) is equal to the result of x.substring(pos, pos+1); +* @description: Compare results of x.charAt(pos) and x.substring(pos, pos+1); +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for(var i=0; i<6; i++) { + if ("ABC\u0041\u0042\u0043".charAt(i) !== "\u0041\u0042\u0043ABC".substring(i, i+1)) { + $ERROR('#'+i+': "ABC\\u0041\\u0042\\u0043".charAt('+i+') === "\\u0041\\u0042\\u0043ABC".substring('+i+', '+(i+1)+'). Actual: "ABC\\u0041\\u0042\\u0043".charAt('+i+') ==='+("ABC\u0041\u0042\u0043".charAt(i)) ); + } +} + +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A4_T2.js new file mode 100644 index 000000000..f16448e4c --- /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.4_String.prototype.charAt/S15.5.4.4_A4_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.4_A4_T2; +* @section: 15.5.4.4; +* @assertion: If pos is a value of Number type that is an integer, then the result of x.charAt(pos) is equal to the result of x.substring(pos, pos+1); +* @description: Compare results of x.charAt(pos) and x.substring(pos, pos+1), wheb pos is smaller of zero; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for(var i=-2; i<0; i++) { + if ("ABC\u0041\u0042\u0043".charAt(i) !== "\u0041\u0042\u0043ABC".substring(i, i+1)) { + $ERROR('#'+(i+2)+': "ABC\\u0041\\u0042\\u0043".charAt('+i+') === "\\u0041\\u0042\\u0043ABC".substring('+i+', '+(i+1)+'). Actual: "ABC\\u0041\\u0042\\u0043".charAt('+i+') ==='+("ABC\u0041\u0042\u0043".charAt(i)) ); + } +} + +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A4_T3.js new file mode 100644 index 000000000..4973d76d2 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A4_T3; +* @section: 15.5.4.4; +* @assertion: If pos is a value of Number type that is an integer, then the result of x.charAt(pos) is equal to the result of x.substring(pos, pos+1); +* @description: Compare results of x.charAt(pos) and x.substring(pos, pos+1), wheb pos is bigger string length; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for(var i=6; i<8; i++) { + if ("ABC\u0041\u0042\u0043".charAt(i) !== "\u0041\u0042\u0043ABC".substring(i, i+1)) { + $ERROR('#'+(i-5)+': "ABC\\u0041\\u0042\\u0043".charAt('+i+') === "\\u0041\\u0042\\u0043ABC".substring('+i+', '+(i+1)+'). Actual: "ABC\\u0041\\u0042\\u0043".charAt('+i+') ==='+("ABC\u0041\u0042\u0043".charAt(i))); + } +} + +// +////////////////////////////////////////////////////////////////////////////// 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.4_String.prototype.charAt/S15.5.4.4_A5.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.4_String.prototype.charAt/S15.5.4.4_A5.js new file mode 100644 index 000000000..b37e0bd85 --- /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.4_String.prototype.charAt/S15.5.4.4_A5.js @@ -0,0 +1,28 @@ +// 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.4_A5; +* @section: 15.5.4.4; +* @assertion: When String.prototype.charAt(pos) calls first calls ToString, giving it the this value as its argument; +* @description: Change toString function, it trow exception, and call charAt(); +*/ + +var __obj={ + valueOf:1, + toString:function(){throw 'intostring'}, + charAt:String.prototype.charAt +} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.charAt(); + $FAIL('#1: __obj={valueOf:1,toString:function(){throw \'intostring\'},charAt:String.prototype.charAt}; "var x = __obj.charAt()" lead to throwing exception'); +} catch (e) { + if (e !== 'intostring') { + $ERROR('#1.1: Exception === \'intostring\'. Actual: exception ==='+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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A6.js new file mode 100644 index 000000000..8ae2d4200 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A6; +* @section: 15.5.4.4, 13.2; +* @assertion: String.prototype.charAt has not prototype property; +* @description: Checking String.prototype.charAt.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.charAt.prototype !== undefined) { + $ERROR('#1: String.prototype.charAt.prototype === undefined. Actual: '+String.prototype.charAt.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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A7.js new file mode 100644 index 000000000..4999f21be --- /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.4_String.prototype.charAt/S15.5.4.4_A7.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.4_A7; +* @section: 15.5.4.4, 13.2; +* @assertion: String.prototype.charAt can't be used as constructor; +* @description: Checking if creating the String.prototype.charAt object fails; +*/ + +var __FACTORY = String.prototype.charAt; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.charAt; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: undefined = 1 throw a TypeError. 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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A8.js new file mode 100644 index 000000000..37da79d50 --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A8; +* @section: 15.5.4.4; +* @assertion: The String.prototype.charAt.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.charAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.charAt.hasOwnProperty('length'))) { + $ERROR('#0: String.prototype.charAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.charAt.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.charAt.propertyIsEnumerable(\'length\') return false. Actual: '+String.prototype.charAt.propertyIsEnumerable('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.charAt){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.charAt){if (p==="length") count++;}; count === 0. Actual: count ==='+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.4_String.prototype.charAt/S15.5.4.4_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.4_String.prototype.charAt/S15.5.4.4_A9.js new file mode 100644 index 000000000..526fa0f2f --- /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.4_String.prototype.charAt/S15.5.4.4_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.4_A9; +* @section: 15.5.4.4; +* @assertion: The String.prototype.charAt.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.charAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.charAt.hasOwnProperty('length'))) { + $ERROR('#0: String.prototype.charAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.charAt.length) { + $ERROR('#1: delete String.prototype.charAt.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.charAt.hasOwnProperty('length'))) { + $ERROR('#2: delete String.prototype.charAt.length; String.prototype.charAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charAt.hasOwnProperty('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.5_String.prototype.charCodeAt/S15.5.4.5_A1.1.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.5_String.prototype.charCodeAt/S15.5.4.5_A1.1.js new file mode 100644 index 000000000..32483e953 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1.1.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.5_A1.1; +* @section: 15.5.4.5, 13.2; +* @assertion: String.prototype.charCodeAt() can accept many arguments; +* @description: Checking by using eval; +*/ + +function __FACTORY(){this.toString = function(){ return "wizard";};}; + +__FACTORY.prototype.charCodeAt = String.prototype.charCodeAt; + +var __instance = new __FACTORY; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__instance){ + + if (__instance.charCodeAt(eval("1"),true,null,{})!== 0x69) { + $ERROR('#1: __instance.charCodeAt(eval("1"),true,null,{})=== 0x69. Actual: __instance.charCodeAt(eval("1"),true,null,{})==='+__instance.charCodeAt(eval("1"),true,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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A10.js new file mode 100644 index 000000000..213be52b4 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A10; +* @section: 15.5.4.5; +* @assertion: The String.prototype.charCodeAt.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.charCodeAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.charCodeAt.hasOwnProperty('length'))) { + $ERROR('#1: String.prototype.charCodeAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charCodeAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.charCodeAt.length; + +String.prototype.charCodeAt.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.charCodeAt.length !== __obj) { + $ERROR('#2: __obj = String.prototype.charCodeAt.length; String.prototype.charCodeAt.length = function(){return "shifted";}; String.prototype.charCodeAt.length === __obj. Actual: '+String.prototype.charCodeAt.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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A11.js new file mode 100644 index 000000000..bf07f8849 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A11; +* @section: 15.5.4.5; +* @assertion: The length property of the charCodeAt method is 1; +* @description: Checking String.prototype.charCodeAt.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.charCodeAt.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.charCodeAt.hasOwnProperty("length") return true. Actual: '+String.prototype.charCodeAt.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.charCodeAt.length !== 1) { + $ERROR('#2: String.prototype.charCodeAt.length === 1. Actual: '+String.prototype.charCodeAt.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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T1.js new file mode 100644 index 000000000..9779e579a --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A1_T1; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: pos is false and true, and instance is object; +*/ + +var __instance = new Object(42); + +__instance.charCodeAt = String.prototype.charCodeAt; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((__instance.charCodeAt(false) !== 52)||(__instance.charCodeAt(true) !== 50)) { + $ERROR('#1: __instance = new Object(42); __instance.charCodeAt = String.prototype.charCodeAt; __instance.charCodeAt(false) === 52 and __instance.charCodeAt(true) === 50. Actual: __instance.charCodeAt(false) ==='+__instance.charCodeAt(false)+' and __instance.charCodeAt(true) ==='+__instance.charCodeAt(true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T10.js new file mode 100644 index 000000000..b841ef4ab --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T10.js @@ -0,0 +1,22 @@ +// 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.5_A1_T10; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with object argument; +*/ + +var __obj = {toString:function(){return 1;}} +var __str = "lego"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (charCodeAt(__obj) !== 0x65) { + $ERROR('#1: var __obj = {toString:function(){return 1;}}; var __str = "lego"; charCodeAt(__obj) === 0x65. Actual: charCodeAt(__obj) ==='+charCodeAt(__obj) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T2.js new file mode 100644 index 000000000..1a0a01e87 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T2.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.5_A1_T2; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: pos is equation with false and true, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.charCodeAt = String.prototype.charCodeAt; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.charCodeAt(false)!==0x66) { + $ERROR('#1: __instance = new Boolean; __instance.charCodeAt = String.prototype.charCodeAt; __instance.charCodeAt(false)===0x66. Actual: '+__instance.charCodeAt(false)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__instance.charCodeAt(true)!==0x61) { + $ERROR('#2: __instance = new Boolean; __instance.charCodeAt = String.prototype.charCodeAt; __instance.charCodeAt(true)===0x61. Actual: '+__instance.charCodeAt(true)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__instance.charCodeAt(true+1) !== 0x6C) { + $ERROR('#3: __instance = new Boolean; __instance.charCodeAt = String.prototype.charCodeAt; __instance.charCodeAt(true+1) === 0x6C. Actual: '+__instance.charCodeAt(true+1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T3.js new file mode 100644 index 000000000..304a460b3 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T3.js @@ -0,0 +1,58 @@ +// 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.5_A1_T3; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Use numbers and strings as pos; +*/ + +var charCodeAt = String.prototype.charCodeAt; + +if (typeof toString === "undefined"){ + var toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (charCodeAt("2") !== 0x62) { + $ERROR('#1: charCodeAt = String.prototype.charCodeAt; charCodeAt("2") === 0x62. Actual: '+charCodeAt("2") ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (charCodeAt(3) !== 0x6A) { + $ERROR('#2: charCodeAt = String.prototype.charCodeAt; charCodeAt(3) === 0x6A. Actual: '+charCodeAt(3) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (charCodeAt("4") !== 0x65) { + $ERROR('#3: charCodeAt = String.prototype.charCodeAt; charCodeAt("4") === 0x65. Actual: '+charCodeAt("4") ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (charCodeAt(5) !== 0x63) { + $ERROR('#4: charCodeAt = String.prototype.charCodeAt; charCodeAt(5) === 0x63. Actual: '+charCodeAt(5) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (charCodeAt("6") !== 0x74) { + $ERROR('#5: charCodeAt = String.prototype.charCodeAt; charCodeAt("6") === 0x74. Actual: '+charCodeAt("6") ); +} +// +////////////////////////////////////////////////////////////////////////////// + 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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T4.js new file mode 100644 index 000000000..15a799277 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A1_T4; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function without argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since Number() evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if ("smart".charCodeAt() !== 0x73) { + $ERROR('#1: "smart".charCodeAt() === 0x73. Actual: "smart".charCodeAt() ==='+("smart".charCodeAt()) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T5.js new file mode 100644 index 000000000..b6ab5eb9f --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A1_T5; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(null) evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if (function(){return "lego"}().charCodeAt(null) !== 0x6C) { + $ERROR('#1: function(){return "lego"}().charCodeAt(null) === 0x6C. Actual: '+function(){return "lego"}().charCodeAt(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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T6.js new file mode 100644 index 000000000..493d587f3 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A1_T6; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with x argument of new String object, where x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if (new String("lego").charCodeAt(x) !== 0x6C) { + $ERROR('#1: var x; new String("lego").charCodeAt(x) === 0x6C. Actual: new String("lego").charCodeAt(x) ==='+new String("lego").charCodeAt(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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T7.js new file mode 100644 index 000000000..21fa8e9af --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A1_T7; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with undefined argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if (String("lego").charCodeAt(undefined) !== 0x6C) { + $ERROR('#1: String("lego").charCodeAt(undefined) === 0x6C. Actual: String("lego").charCodeAt(undefined) ==='+String("lego").charCodeAt(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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T8.js new file mode 100644 index 000000000..7a0628e2c --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1_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.5.4.5_A1_T8; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with void 0 argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(void 0) evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if (String(42).charCodeAt(void 0) !== 0x34) { + $ERROR('#1: String(42).charCodeAt(void 0) === 0x34. Actual: String(42).charCodeAt(void 0) ==='+String(42).charCodeAt(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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T9.js new file mode 100644 index 000000000..4cbbc3468 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A1_T9.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.5_A1_T9; +* @section: 15.5.4.5; +* @assertion: String.prototype.charCodeAt(pos); +* @description: Call charCodeAt() function with function(){}() argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToInteger(undefined) evaluates to 0 charCodeAt() evaluates to charCodeAt(0) +if (new String(42).charCodeAt(function(){}()) !== 0x34) { + $ERROR('#1: new String(42).charCodeAt(function(){}()) === 0x34. Actual: new String(42).charCodeAt(function(){}()) ==='+new String(42).charCodeAt(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.5_String.prototype.charCodeAt/S15.5.4.5_A2.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.5_String.prototype.charCodeAt/S15.5.4.5_A2.js new file mode 100644 index 000000000..1aecff819 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A2.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.5_A2; +* @section: 15.5.4.5; +* @assertion: When String.prototype.charCodeAt(pos) calls if ToInteger(pos) less than 0 the NaN returns; +* @description: Call charCodeAt(pos) with negative pos; +*/ + +function __FACTORY(){}; + +__FACTORY.prototype.charCodeAt = String.prototype.charCodeAt; + +var __instance = new __FACTORY; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!isNaN(__instance.charCodeAt(-1))) { + $ERROR('#1: function __FACTORY(){}; __FACTORY.prototype.charCodeAt = String.prototype.charCodeAt; __instance = new __FACTORY; isNaN(__instance.charCodeAt(-1)) return true. Actual: '+isNaN(__instance.charCodeAt(-1))); +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_A3.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.5_String.prototype.charCodeAt/S15.5.4.5_A3.js new file mode 100644 index 000000000..1aa7cbbc5 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A3.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.5.4.5_A3; +* @section: 15.5.4.5; +* @assertion: When String.prototype.charCodeAt(pos) calls if ToInteger(pos) not less than ToString(this value) the NaN returns; +* @description: pos is bigger of string length; +*/ + +var __instance = new String("ABC"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!isNaN(__instance.charCodeAt(3))) { + $ERROR('#1: __instance = new String("ABC"); isNaN(__instance.charCodeAt(3)) return true. Actual: '+isNaN(__instance.charCodeAt(3))); +} +// +////////////////////////////////////////////////////////////////////////////// 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.5_String.prototype.charCodeAt/S15.5.4.5_A4.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.5_String.prototype.charCodeAt/S15.5.4.5_A4.js new file mode 100644 index 000000000..2c26ac566 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A4.js @@ -0,0 +1,28 @@ +// 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.5_A4; +* @section: 15.5.4.5; +* @assertion: When String.prototype.charCodeAt(pos) calls first calls ToString, giving it the this value as its argument; +* @description: Change toString function, it trow exception, and call charCodeAt(); +*/ + +var __obj={ + valueOf:1, + toString:function(){throw 'intostring'}, + charCodeAt:String.prototype.charCodeAt +} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.charCodeAt(); + $FAIL('#1: "var x = __obj.charCodeAt()" lead to throwing exception'); +} catch (e) { + if (e !== 'intostring') { + $ERROR('#1.1: Exception === \'intostring\'. Actual: exception ==='+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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A6.js new file mode 100644 index 000000000..6034b5f69 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A6; +* @section: 15.5.4.5, 13.2; +* @assertion: String.prototype.charCodeAt has not prototype property; +* @description: Checking String.prototype.charCodeAt.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.charCodeAt.prototype !== undefined) { + $ERROR('#1: String.prototype.charCodeAt.prototype === undefined. Actual: '+String.prototype.charCodeAt.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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A7.js new file mode 100644 index 000000000..a4c5f6a65 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_A7.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.5.4.5_A7; +* @section: 15.5.4.5, 13.2; +* @assertion: String.prototype.charCodeAt can't be used as constructor; +* @description: Checking if creating the String.prototype.charCodeAt object fails; +*/ + +var __FACTORY = String.prototype.charCodeAt; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.charCodeAt; "__instance = new __FACTORY" lead to throwing exception'); +} catch (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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A8.js new file mode 100644 index 000000000..b365e36e6 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A8; +* @section: 15.5.4.5; +* @assertion: The String.prototype.charCodeAt.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.charCodeAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.charCodeAt.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.charCodeAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charCodeAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.charCodeAt.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.charCodeAt.propertyIsEnumerable(\'length\') return false. Actual: '+String.prototype.charCodeAt.propertyIsEnumerable('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.charCodeAt){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.charCodeAt){if (p==="length") count++;} count === 0. Actual: count ==='+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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_String.prototype.charCodeAt/S15.5.4.5_A9.js new file mode 100644 index 000000000..d7c463283 --- /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.5_String.prototype.charCodeAt/S15.5.4.5_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.5_A9; +* @section: 15.5.4.5; +* @assertion: The String.prototype.charCodeAt.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.charCodeAt.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.charCodeAt.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.charCodeAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charCodeAt.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.charCodeAt.length) { + $ERROR('#1: delete String.prototype.charCodeAt.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.charCodeAt.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.charCodeAt.length; String.prototype.charCodeAt.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.charCodeAt.hasOwnProperty('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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A10.js new file mode 100644 index 000000000..f9700d583 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A10; +* @section: 15.5.4.6; +* @assertion: The String.prototype.concat.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.concat.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.concat.hasOwnProperty('length'))) { + $ERROR('#1: String.prototype.concat.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.concat.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.concat.length; + +String.prototype.concat.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.concat.length !== __obj) { + $ERROR('#2: __obj = String.prototype.concat.length; String.prototype.concat.length = function(){return "shifted";}; String.prototype.concat.length === __obj. Actual: '+String.prototype.concat.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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A11.js new file mode 100644 index 000000000..0f4341564 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A11; +* @section: 15.5.4.6; +* @assertion: The length property of the concat method is 1; +* @description: Checking String.prototype.concat.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.concat.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.concat.hasOwnProperty("length") return true. Actual: '+String.prototype.concat.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.concat.length !== 1) { + $ERROR('#2: String.prototype.concat.length === 1. Actual: '+String.prototype.concat.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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T1.js new file mode 100644 index 000000000..26f229fe9 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T1; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(42); + +__instance.concat = String.prototype.concat; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.concat(false,true) !== "42falsetrue") { + $ERROR('#1: __instance = new Object(42); __instance.concat = String.prototype.concat; __instance.concat(false,true) === "42falsetrue". Actual: '+__instance.concat(false,true) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T10.js new file mode 100644 index 000000000..768493795 --- /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.6_String.prototype.concat/S15.5.4.6_A1_T10.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.5.4.6_A1_T10; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with object arguments; +*/ + +var __obj = {toString:function(){return "\u0041";}} +var __obj2 = {toString:function(){return true;}} +var __obj3 = {toString:function(){return 42;}} +var __str = "lego"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (concat(__obj, __obj2, __obj3, x) !== "legoAtrue42undefined") { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041";}}; var __obj2 = {toString:function(){return true;}}; var __obj3 = {toString:function(){return 42;}}; var __str = "lego"; concat(__obj, __obj2, __obj3, x) === "legoAtrue42undefined". Actual: '+concat(__obj, __obj2, __obj3, 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T2.js new file mode 100644 index 000000000..c4fd29498 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T2; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Arguments are equation with false and true, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.concat = String.prototype.concat; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.concat("\u0041",true,true+1) !== "falseAtrue2") { + $ERROR('#1: __instance = new Boolean; __instance.concat = String.prototype.concat; __instance.concat("\\u0041",true,true+1) === "falseAtrue2". Actual: '+__instance.concat("\u0041",true,true+1) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T3.js new file mode 100644 index 000000000..b3c40ff7a --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T3; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Use numbers and function object as arguments; +*/ + +var concat = String.prototype.concat; + +var __obj5 = {toString:function(){return 5;}}; + +if (typeof toString === "undefined"){ + var toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (concat(1,2,3,4,__obj5)!=__class__+"12345") { + $ERROR('#1: concat = String.prototype.concat; concat(1,2,3,4,__obj5)==__class__+"12345". Actual: concat(1,2,3,4,__obj5)=='+concat(1,2,3,4,__obj5)); +} +// +////////////////////////////////////////////////////////////////////////////// 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T4.js new file mode 100644 index 000000000..902f3c646 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T4; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function without argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString() evaluates to "" concat() evaluates to concat("") +if ("lego".concat() !== "lego") { + $ERROR('#1: "lego".concat() === "lego". Actual: '+("lego".concat()) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T5.js new file mode 100644 index 000000000..639fd60dd --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T5; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" concat(null) evaluates to concat("null") +if (function(){return "lego"}().concat(null) !== "legonull") { + $ERROR('#1: function(){return "lego"}().concat(null) === "legonull". Actual: '+function(){return "lego"}().concat(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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T6.js new file mode 100644 index 000000000..5c378a5c0 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T6; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with x argument of new String object, where x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" concat(undefined) evaluates to concat("undefined") +if (new String("lego").concat(x) !== "legoundefined") { + $ERROR('#1: var x; new String("lego").concat(x) === "legoundefined". Actual: '+new String("lego").concat(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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T7.js new file mode 100644 index 000000000..ca79866c5 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A1_T7; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with undefined argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" concat(undefined) evaluates to concat("undefined") +if (String("lego").concat(undefined) !== "legoundefined") { + $ERROR('#1: String("lego").concat(undefined) === "legoundefined". Actual: '+String("lego").concat(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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T8.js new file mode 100644 index 000000000..7242e1478 --- /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.6_String.prototype.concat/S15.5.4.6_A1_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.5.4.6_A1_T8; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with void 0 argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(void 0) evaluates to "undefined" concat(void 0) evaluates to concat("undefined") +if (String(42).concat(void 0) !== "42undefined") { + $ERROR('#1: String(42).concat(void 0) === "42undefined". Actual: '+String(42).concat(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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A1_T9.js new file mode 100644 index 000000000..ad50529b8 --- /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.6_String.prototype.concat/S15.5.4.6_A1_T9.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.6_A1_T9; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]); +* @description: Call concat([,[...]]) function with function(){}() argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" concat(undefined) evaluates to concat("undefined") +if (new String(42).concat(function(){}()) !== "42undefined") { + $ERROR('#1: new String(42).concat(function(){}()) === "42undefined". Actual: '+new String(42).concat(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.6_String.prototype.concat/S15.5.4.6_A2.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.6_String.prototype.concat/S15.5.4.6_A2.js new file mode 100644 index 000000000..55343dcfb --- /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.6_String.prototype.concat/S15.5.4.6_A2.js @@ -0,0 +1,32 @@ +// 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.6_A2; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]) can accept at least 128; +* @description: Call concat([,[...]]) function with 128 arguments; +*/ + +var __instance = new Number(); + +__instance.concat = String.prototype.concat; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.concat( +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF, +0,1,2,3,4,5,6,7,8,9,0xA,0xB,0xC,0xD,0xE,0xF +) !== "001234567891011121314150123456789101112131415012345678910111213141501234567891011121314150123456789101112131415012345678910111213141501234567891011121314150123456789101112131415") { + $ERROR('#1: Call concat([,[...]]) function with 128 arguments does not lead to throwing any errors'); +} +// +////////////////////////////////////////////////////////////////////////////// + + 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.6_String.prototype.concat/S15.5.4.6_A3.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.6_String.prototype.concat/S15.5.4.6_A3.js new file mode 100644 index 000000000..baa5bcca3 --- /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.6_String.prototype.concat/S15.5.4.6_A3.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.6_A3; +* @section: 15.5.4.6; +* @assertion: String.prototype.concat([,[...]]) can't change the instance to be applied; +* @description: Checking if varying the instance that is applied fails; +*/ + +var __instance = new String("one"); + +__instance.concat("two"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance != "one") { + $ERROR('#1: __instance = new String("one"); __instance.concat("two"); __instance = new String("one"); __instance.concat("two"); __instance == "one". Actual: '+__instance); +} +// +////////////////////////////////////////////////////////////////////////////// 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A4_T1.js new file mode 100644 index 000000000..91dc5276f --- /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.6_String.prototype.concat/S15.5.4.6_A4_T1.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.6_A4_T1; +* @section: 15.5.4.6; +* @assertion: when String.prototype.concat([,[...]]) is called first Call ToString, giving it the this value as its argument; +* @description: Override toString function; +*/ + +var __instance = {toString:function(){return "one"}}; + +__instance.concat = String.prototype.concat; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.concat("two",x) !== "onetwoundefined") { + $ERROR('#1: var x; __instance = {toString:function(){return "one"}}; __instance.concat = String.prototype.concat; __instance.concat("two",x) === "onetwoundefined". Actual: '+__instance.concat("two",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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A4_T2.js new file mode 100644 index 000000000..d7390e9f4 --- /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.6_String.prototype.concat/S15.5.4.6_A4_T2.js @@ -0,0 +1,32 @@ +// 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.6_A4_T2; +* @section: 15.5.4.6; +* @assertion: when String.prototype.concat([,[...]]) is called first Call ToString, giving it the this value as its argument; +* @description: Override toString function onto function, that throw exception; +*/ + +var __instance = {toString:function(){throw "intostring";}}; +var __obj = {toString:function(){throw "infirstarg";}}; + +__instance.concat = String.prototype.concat; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + String.prototype.concat.call(__instance,__obj, notexist); + $FAIL('#1: "String.prototype.concat.call(__instance,__obj, notexist)" lead to throwing exception'); +} catch (e) { + if (e !== "intostring") { + $ERROR('#1: e === "intostring". Actual: '+e ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +var notexist; + + + 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A6.js new file mode 100644 index 000000000..eb9123260 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A6; +* @section: 15.5.4.6, 13.2; +* @assertion: String.prototype.concat has not prototype property; +* @description: Checking String.prototype.concat.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.concat.prototype !== undefined) { + $ERROR('#1: String.prototype.concat.prototype === undefined. Actual: '+String.prototype.concat.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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A7.js new file mode 100644 index 000000000..ad72d5cf1 --- /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.6_String.prototype.concat/S15.5.4.6_A7.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.5.4.6_A7; +* @section: 15.5.4.6, 13.2; +* @assertion: String.prototype.concat can't be used as constructor; +* @description: Checking if creating the String.prototype.concat object fails; +*/ + +var __FACTORY = String.prototype.concat; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.concat; "__instance = new __FACTORY" lead throwing exception'); +} catch (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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A8.js new file mode 100644 index 000000000..209fd21e1 --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A8; +* @section: 15.5.4.6; +* @assertion: The String.prototype.concat.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.concat.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.concat.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.concat.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.concat.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.concat.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.concat.propertyIsEnumerable(\'length\') return false. Actual: '+String.prototype.concat.propertyIsEnumerable('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +count = 0; + +for (p in String.prototype.concat){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count = 0; for (p in String.prototype.concat){ 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.6_String.prototype.concat/S15.5.4.6_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.6_String.prototype.concat/S15.5.4.6_A9.js new file mode 100644 index 000000000..58213078f --- /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.6_String.prototype.concat/S15.5.4.6_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.6_A9; +* @section: 15.5.4.6; +* @assertion: The String.prototype.concat.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.concat.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.concat.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.concat.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.concat.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.concat.length) { + $ERROR('#1: delete String.prototype.concat.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.concat.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.concat.length; String.prototype.concat.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.concat.hasOwnProperty('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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A10.js new file mode 100644 index 000000000..8f3582136 --- /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_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.7_A10; +* @section: 15.5.4.7; +* @assertion: The String.prototype.indexOf.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.indexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.indexOf.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.indexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.indexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.indexOf.length; + +String.prototype.indexOf.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.indexOf.length !== __obj) { + $ERROR('#2: __obj = String.prototype.indexOf.length; String.prototype.indexOf.length = function(){return "shifted";}; String.prototype.indexOf.length === __obj. Actual: '+String.prototype.indexOf.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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A11.js new file mode 100644 index 000000000..95688130b --- /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_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.7_A11; +* @section: 15.5.4.7; +* @assertion: The length property of the indexOf method is 1; +* @description: Checking String.prototype.indexOf.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.indexOf.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.indexOf.hasOwnProperty("length") return true. Actual: '+String.prototype.indexOf.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.indexOf.length !== 1) { + $ERROR('#2: String.prototype.indexOf.length === 1. Actual: '+String.prototype.indexOf.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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T1.js new file mode 100644 index 000000000..94d85fcdb --- /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_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.7_A1_T1; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.indexOf = String.prototype.indexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.indexOf(true, false) !== 0) { + $ERROR('#1: __instance = new Object(true); __instance.indexOf = String.prototype.indexOf; __instance.indexOf(true, false) === 0. Actual: '+__instance.indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T10.js new file mode 100644 index 000000000..4fb387650 --- /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_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.7_A1_T10; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function with object arguments; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __obj2 = {valueOf:function(){return true;}} +var __str = "ABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (indexOf(__obj, __obj2) !== 3) { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABB\u0041BABAB"; indexOf(__obj, __obj2) === 3. Actual: '+indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T11.js new file mode 100644 index 000000000..734090e51 --- /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_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.7_A1_T11; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Instance is Date(0) object; +*/ + +var __instance = new Date(0); + +__instance.indexOf = String.prototype.indexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((__instance.getTimezoneOffset()>0 ? __instance.indexOf('31') : __instance.indexOf('01')) !== 8) { + $ERROR('#1: __instance = new Date(0); __instance.indexOf = String.prototype.indexOf; (__instance.getTimezoneOffset()>0 ? __instance.indexOf(\'31\') : __instance.indexOf(\'01\')) === 8. Actual: '+(__instance.getTimezoneOffset()>0 ? __instance.indexOf('31') : __instance.indexOf('01')) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A1_T12.js new file mode 100644 index 000000000..a432083d9 --- /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_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.7_A1_T12; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Argument is string, and instance is array of strings; +*/ + +var __instance = new Array('new','zoo','revue'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.indexOf('new') !== 0) { + $ERROR('#1: __instance = new Array(\'new\',\'zoo\',\'revue\'); __instance.indexOf(\'new\') === 0. Actual: '+__instance.indexOf('new') ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__instance.indexOf('zoo') !== 1) { + $ERROR('#2: __instance = new Array(\'new\',\'zoo\',\'revue\'); __instance.indexOf(\'zoo\') === 1. Actual: '+__instance.indexOf('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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T2.js new file mode 100644 index 000000000..9e3b4a9ba --- /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_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.7_A1_T2; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Arguments are boolean equation, function and null, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.indexOf = String.prototype.indexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.indexOf("A"!=="\u0041", function(){return 0;}(),null) !== 0) { + $ERROR('#1: __instance = new Boolean; __instance.indexOf = String.prototype.indexOf; __instance.indexOf("A"!=="\\u0041", function(){return 0;}(),null) === 0. Actual: '+__instance.indexOf("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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T3.js new file mode 100644 index 000000000..583733536 --- /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_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.7_A1_T3; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Checking by using eval; +*/ + +var indexOf = String.prototype.indexOf; + +var __obj__pos = {valueOf:function(){return 5;}}; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (indexOf(eval("\"[\""),__obj__pos)!=-1) { + $ERROR('#1: indexOf = String.prototype.indexOf; indexOf(eval("\\"[\\""),__obj__pos)==-1. Actual: indexOf(eval("\\"[\\""),__obj__pos)=='+indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T4.js new file mode 100644 index 000000000..0fefab1fa --- /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_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.7_A1_T4; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function without arguments of string; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString() evaluates to "" indexOf() evaluates to indexOf("",0) +if ("".indexOf() !== -1) { + $ERROR('#1: "".indexOf() === -1. Actual: '+("".indexOf()) ); +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A1_T5.js new file mode 100644 index 000000000..a2c231c33 --- /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_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.7_A1_T5; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" indexOf(null) evaluates to indexOf("",0) +if (function(){return "gnulluna"}().indexOf(null) !== 1) { + $ERROR('#1: function(){return "gnulluna"}().indexOf(null) === 1. Actual: '+function(){return "gnulluna"}().indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T6.js new file mode 100644 index 000000000..f4496568a --- /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_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.7_A1_T6; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function with x argument of new String object, where x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "" indexOf(undefined) evaluates to indexOf("",0) +if (new String("undefined").indexOf(x) !== 0) { + $ERROR('#1: var x; new String("undefined").indexOf(x) === 0. Actual: '+new String("undefined").indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T7.js new file mode 100644 index 000000000..11d75e74b --- /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_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.7_A1_T7; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function with undefined argument of string object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(undefined) evaluates to "undefined" indexOf(undefined) evaluates to indexOf("undefined",0) +if (String("undefined").indexOf(undefined) !== 0) { + $ERROR('#1: String("undefined").indexOf(undefined) === 0. Actual: '+String("undefined").indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T8.js new file mode 100644 index 000000000..f3ccedb1e --- /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_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.7_A1_T8; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(searchString, position) function with void 0 argument of string object; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(void 0) evaluates to "undefined" indexOf(void 0) evaluates to indexOf("undefined") +if (String(__obj).indexOf(void 0) !== 0) { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).indexOf(void 0) === 0. Actual: '+String(__obj).indexOf(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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A1_T9.js new file mode 100644 index 000000000..f5dd7c30f --- /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_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.7_A1_T9; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf(searchString, position); +* @description: Call indexOf(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).indexOf(function(){}()) !== 0) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).indexOf(function(){}()) === 0. Actual: '+new String(__obj).indexOf(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.7_String.prototype.indexOf/S15.5.4.7_A2_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_A2_T1.js new file mode 100644 index 000000000..8a26c01ca --- /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_A2_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_A2_T1; +* @section: 15.5.4.7; +* @assertion: When length of searchString less than length of ToString(this) -1 returns; +* @description: Call "abcd".indexOf("abcdab") and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("abcd".indexOf("abcdab")!==-1) { + $ERROR('#1: "abcd".indexOf("abcdab")===-1. Actual: '+("abcd".indexOf("abcdab"))); +} +// +////////////////////////////////////////////////////////////////////////////// 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_A2_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.7_String.prototype.indexOf/S15.5.4.7_A2_T2.js new file mode 100644 index 000000000..9d342ed2c --- /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_A2_T2.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_A2_T2; +* @section: 15.5.4.7; +* @assertion: When length of searchString less than length of ToString(this) -1 returns; +* @description: Call "abcd".indexOf("abcdab",0) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("abcd".indexOf("abcdab",0)!==-1) { + $ERROR('#1: "abcd".indexOf("abcdab",0)===-1. Actual: '+("abcd".indexOf("abcdab",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.7_String.prototype.indexOf/S15.5.4.7_A2_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.7_String.prototype.indexOf/S15.5.4.7_A2_T3.js new file mode 100644 index 000000000..da6d45a04 --- /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_A2_T3.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_A2_T3; +* @section: 15.5.4.7; +* @assertion: When length of searchString less than length of ToString(this) -1 returns; +* @description: Call "abcd".indexOf("abcdab",99) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("abcd".indexOf("abcdab",99)!==-1) { + $ERROR('#1: "abcd".indexOf("abcdab",99)===-1. Actual: '+("abcd".indexOf("abcdab",99))); +} +// +////////////////////////////////////////////////////////////////////////////// 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_A2_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.7_String.prototype.indexOf/S15.5.4.7_A2_T4.js new file mode 100644 index 000000000..6c5e79c1c --- /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_A2_T4.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_A2_T4; +* @section: 15.5.4.7; +* @assertion: When length of searchString less than length of ToString(this) -1 returns; +* @description: Call "abcd".indexOf("abcdab",NaN) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("abcd".indexOf("abcdab",NaN)!==-1) { + $ERROR('#1: "abcd".indexOf("abcdab",NaN)===-1. Actual: '+("abcd".indexOf("abcdab",NaN))); +} +// +////////////////////////////////////////////////////////////////////////////// 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))); +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A3_T2.js new file mode 100644 index 000000000..945ebb383 --- /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_T2.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_T2; +* @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",eval("\"-99\"")) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("$$abcdabcd".indexOf("ab",eval("\"-99\""))!==2) { + $ERROR('#1: "$$abcdabcd".indexOf("ab",eval("\\"-99\\""))===2. Actual: '+("$$abcdabcd".indexOf("ab",eval("\"-99\"")))); +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A3_T3.js new file mode 100644 index 000000000..7e314656c --- /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_T3.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_T3; +* @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",function(){return -Infinity;}()) and check result; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("$$abcdabcd".indexOf("ab", function(){return -Infinity;}())!==2) { + $ERROR('#1: "$$abcdabcd".indexOf("ab", function(){return -Infinity;}())===2. Actual: '+("$$abcdabcd".indexOf("ab", function(){return -Infinity;}()))); +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A4_T1.js new file mode 100644 index 000000000..f799682c1 --- /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_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.7_A4_T1; +* @section: 15.5.4.7; +* @assertion: when String.prototype.indexOf(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 = indexOf(__obj, __obj2); + $FAIL('#1: "var x = indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A4_T2.js new file mode 100644 index 000000000..c60f0de47 --- /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_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.7_A4_T2; +* @section: 15.5.4.7; +* @assertion: when String.prototype.indexOf(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 = indexOf(__obj, __obj2); + $FAIL('#1: "var x = indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A4_T3.js new file mode 100644 index 000000000..9a757d803 --- /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_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.7_A4_T3; +* @section: 15.5.4.7; +* @assertion: when String.prototype.indexOf(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(){return "1";}} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB".indexOf(__obj, __obj2)!==3) { + $ERROR('#1: var __obj = {toString:function(){return "\u0041B";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "1";}}; "ABB\\u0041BABAB".indexOf(__obj, __obj2)===3. Actual: '+("ABB\u0041BABAB".indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A4_T4.js new file mode 100644 index 000000000..3fd019909 --- /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_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.7_A4_T4; +* @section: 15.5.4.7; +* @assertion: when String.prototype.indexOf(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.indexOf=String.prototype.indexOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__instance){ + try { + var x = indexOf(__obj, __obj2); + $FAIL('#1: "var x = indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A4_T5.js new file mode 100644 index 000000000..83a3766e0 --- /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_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.7_A4_T5; +* @section: 15.5.4.7; +* @assertion: when String.prototype.indexOf(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.indexOf = String.prototype.indexOf; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __instance.indexOf(__obj, __obj2); + $FAIL('#1: "var x = __instance.indexOf(__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.7_String.prototype.indexOf/S15.5.4.7_A5_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_A5_T1.js new file mode 100644 index 000000000..a2c188747 --- /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_A5_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.7_A5_T1; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search one symbol from begin of string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for (var k = 0, i = 0x0020; i < 0x007e; i++, k++ ) { + if (TEST_STRING.indexOf( String.fromCharCode(i), 0 )!==k) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( String.fromCharCode('+i+'), 0 )==='+k+'. Actual: '+TEST_STRING.indexOf( String.fromCharCode(i), 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.7_String.prototype.indexOf/S15.5.4.7_A5_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.7_String.prototype.indexOf/S15.5.4.7_A5_T2.js new file mode 100644 index 000000000..3b78aafd3 --- /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_A5_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.7_A5_T2; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search one symbol from it`s position in the string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for (var k = 0, i = 0x0020; i < 0x007e; i++, k++ ) { + if (TEST_STRING.indexOf( String.fromCharCode(i), k )!==k) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( String.fromCharCode('+i+'), '+k+' )==='+k+'. Actual: '+TEST_STRING.indexOf( String.fromCharCode(i), k )); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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_A5_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.7_String.prototype.indexOf/S15.5.4.7_A5_T3.js new file mode 100644 index 000000000..afca07689 --- /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_A5_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.7_A5_T3; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search one symbol from it`s position+1 in the string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for ( var k = 0, i = 0x0020; i < 0x007e; i++, k++ ) { + if (TEST_STRING.indexOf( String.fromCharCode(i), k+1 ) !== -1) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( String.fromCharCode('+i+'), '+(k+1)+' )===-1. Actual: '+TEST_STRING.indexOf( String.fromCharCode(i), k+1 )); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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_A5_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.7_String.prototype.indexOf/S15.5.4.7_A5_T4.js new file mode 100644 index 000000000..98e205b15 --- /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_A5_T4.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.7_A5_T4; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search substring from begin of string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for (var k = 0, i = 0x0020; i < 0x007d; i++, k++ ) { + if (TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1) + String.fromCharCode(i+2)), 0 )!==k) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( (String.fromCharCode('+i+')+ String.fromCharCode('+(i+1)+') + String.fromCharCode('+(i+2)+')), 0 )==='+k+'. Actual: '+TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1) + String.fromCharCode(i+2)), 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.7_String.prototype.indexOf/S15.5.4.7_A5_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.7_String.prototype.indexOf/S15.5.4.7_A5_T5.js new file mode 100644 index 000000000..d1354efc0 --- /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_A5_T5.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.7_A5_T5; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search substring from it`s position in the string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for ( var k = 0, i = 0x0020; i < 0x007d; i++, k++ ) { + if (TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1)+ String.fromCharCode(i+2)),k ) !==k) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( (String.fromCharCode('+i+')+ String.fromCharCode('+(i+1)+') + String.fromCharCode('+(i+2)+')), '+k+' )==='+k+'. Actual: '+TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1) + String.fromCharCode(i+2)), k )); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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_A5_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.7_String.prototype.indexOf/S15.5.4.7_A5_T6.js new file mode 100644 index 000000000..d2fe7750d --- /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_A5_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.5.4.7_A5_T6; +* @section: 15.5.4.7; +* @assertion: String.prototype.indexOf works properly; +* @description: Search substring from it`s position+1 in the string; +*/ + +var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +for (var k = 0, i = 0x0020; i < 0x007d; i++, k++ ) { + if (TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1)+ String.fromCharCode(i+2)), k+1 )!== -1) { + $ERROR('#'+(i-0x0020)+': TEST_STRING.indexOf( (String.fromCharCode('+i+')+ String.fromCharCode('+(i+1)+') + String.fromCharCode('+(i+2)+')), '+(k+1)+' )=== -1. Actual: '+TEST_STRING.indexOf( (String.fromCharCode(i)+ String.fromCharCode(i+1) + String.fromCharCode(i+2)), k+1 )); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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_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.7_String.prototype.indexOf/S15.5.4.7_A6.js new file mode 100644 index 000000000..55d2b7387 --- /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_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.7_A6; +* @section: 15.5.4.7, 13.2; +* @assertion: String.prototype.indexOf has not prototype property; +* @description: Checking String.prototype.indexOf.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.indexOf.prototype !== undefined) { + $ERROR('#1: String.prototype.indexOf.prototype === undefined. Actual: '+String.prototype.indexOf.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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A7.js new file mode 100644 index 000000000..98b949acd --- /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_A7.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.7_A7; +* @section: 15.5.4.7, 13.2; +* @assertion: String.prototype.indexOf can't be used as constructor; +* @description: Checking if creating the String.prototype.indexOf object fails; +*/ + +var __FACTORY = String.prototype.indexOf; + +try { + var __instance = new __FACTORY; + $FAIL('#1: var __FACTORY = String.prototype.indexOf; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: var __FACTORY = String.prototype.indexOf; "__instance = new __FACTORY" throw a TypeError. Actual: ' + (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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A8.js new file mode 100644 index 000000000..1347f62d7 --- /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_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.7_A8; +* @section: 15.5.4.7; +* @assertion: The String.prototype.indexOf.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.indexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.indexOf.hasOwnProperty('length'))) { + $ERROR('#0: String.prototype.indexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.indexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.indexOf.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.indexOf.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.indexOf){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.indexOf){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.7_String.prototype.indexOf/S15.5.4.7_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.7_String.prototype.indexOf/S15.5.4.7_A9.js new file mode 100644 index 000000000..d4b4186dc --- /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_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.7_A9; +* @section: 15.5.4.7; +* @assertion: The String.prototype.indexOf.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.indexOf.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.indexOf.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.indexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.indexOf.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.indexOf.length) { + $ERROR('#1: delete String.prototype.indexOf.length raturn false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.indexOf.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.indexOf.length; String.prototype.indexOf.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.indexOf.hasOwnProperty('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_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')); +} +// +////////////////////////////////////////////////////////////////////////////// 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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A10.js new file mode 100644 index 000000000..752c9e4c6 --- /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.9_String.prototype.localeCompare/S15.5.4.9_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.9_A10; +* @section: 15.5.4.9; +* @assertion: The String.prototype.localeCompare.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.localeCompare.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.localeCompare.hasOwnProperty('length'))) { + $ERROR('#1: String.prototype.localeCompare.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.localeCompare.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.localeCompare.length; + +String.prototype.localeCompare.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.localeCompare.length !== __obj) { + $ERROR('#2: __obj = String.prototype.localeCompare.length; String.prototype.localeCompare.length = function(){return "shifted";}; String.prototype.localeCompare.length === __obj. Actual: '+String.prototype.localeCompare.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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A11.js new file mode 100644 index 000000000..1ad93c2e4 --- /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.9_String.prototype.localeCompare/S15.5.4.9_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.9_A11; +* @section: 15.5.4.9; +* @assertion: The length property of the localeCompare method is 1; +* @description: Checking String.prototype.localeCompare.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.localeCompare.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.localeCompare.hasOwnProperty("length") return true. Actual: '+String.prototype.localeCompare.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.localeCompare.length !== 1) { + $ERROR('#2: String.prototype.localeCompare.length === 1. Actual: '+String.prototype.localeCompare.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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A1_T1.js new file mode 100644 index 000000000..2ba261397 --- /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.9_String.prototype.localeCompare/S15.5.4.9_A1_T1.js @@ -0,0 +1,28 @@ +// 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.9_A1_T1; +* @section: 15.5.4.9; +* @assertion: String.prototype.localeCompare(that); +* @description: This string is symbol and arguments are symbols; +*/ + +var str1 = new String("h"); +//CHECK#1 +var str2 = new String ("\x68"); +if (str1.localeCompare(str2)!==0){ + $ERROR('#1: var str1 = new String("h"); var str2 = new String ("\\x68"); str1.localeCompare(str2)===0. Actual: '+str1.localeCompare(str2)); +} + +//CHECK#2 +var str2 = new String ("\u0068"); +if (str1.localeCompare(str2)!==0){ + $ERROR('#2: var str1 = new String("h"); var str2 = new String ("\\u0068"); str1.localeCompare(str2)===0. Actual: '+str1.localeCompare(str2)); +} + +//CHECK#3 +var str2 = new String ("h"); +if (str1.localeCompare(str2)!==0){ + $ERROR('#3: var str1 = new String("h"); var str2 = new String ("h"); str1.localeCompare(str2)===0. Actual: '+str1.localeCompare(str2)); +} 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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A1_T2.js new file mode 100644 index 000000000..59064e193 --- /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.9_String.prototype.localeCompare/S15.5.4.9_A1_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.5.4.9_A1_T2; +* @section: 15.5.4.9; +* @assertion: String.prototype.localeCompare(that); +* @description: Call string_1.localeCompare(string_2) is equal -string_2.localeCompare(string_1); +*/ + +//CHECK#1 +var str1 = "h"; +var str2 = "H"; +if (str1.localeCompare(str2)!==-str2.localeCompare(str1)){ + $ERROR('#1.1: var str1 = "h"; var str2 = "H"; str1.localeCompare(str2)===-str2.localeCompare(str1). Actual: '+str1.localeCompare(str2)); +} 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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A6.js new file mode 100644 index 000000000..5c3c9ad86 --- /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.9_String.prototype.localeCompare/S15.5.4.9_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.9_A6; +* @section: 15.5.4.9, 13.2; +* @assertion: String.prototype.localeCompare has not prototype property; +* @description: Checking String.prototype.localeCompare.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.localeCompare.prototype !== undefined) { + $ERROR('#1: String.prototype.localeCompare.prototype === undefined. Actual: '+String.prototype.localeCompare.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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A7.js new file mode 100644 index 000000000..8542acd31 --- /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.9_String.prototype.localeCompare/S15.5.4.9_A7.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.5.4.9_A7; +* @section: 15.5.4.9, 13.2; +* @assertion: String.prototype.localeCompare can't be used as constructor; +* @description: Checking if creating the String.prototype.localeCompare object fails; +*/ + +var __FACTORY = String.prototype.localeCompare; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.localeCompare; __instance = new __FACTORY lead to throwing exception'); +} catch (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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A8.js new file mode 100644 index 000000000..f2ef8e319 --- /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.9_String.prototype.localeCompare/S15.5.4.9_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.9_A8; +* @section: 15.5.4.9; +* @assertion: The String.prototype.localeCompare.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.localeCompare.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.localeCompare.hasOwnProperty('length'))) { + $ERROR('#0: String.prototype.localeCompare.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.localeCompare.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.localeCompare.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.localeCompare.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.localeCompare){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.localeCompare){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.9_String.prototype.localeCompare/S15.5.4.9_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.9_String.prototype.localeCompare/S15.5.4.9_A9.js new file mode 100644 index 000000000..b5e0aa914 --- /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.9_String.prototype.localeCompare/S15.5.4.9_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.9_A9; +* @section: 15.5.4.9; +* @assertion: The String.prototype.localeCompare.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.localeCompare.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.localeCompare.hasOwnProperty('length'))) { + $ERROR('#0: String.prototype.localeCompare.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.localeCompare.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.localeCompare.length) { + $ERROR('#1: delete String.prototype.localeCompare.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.localeCompare.hasOwnProperty('length'))) { + $ERROR('#2: delete String.prototype.localeCompare.length; String.prototype.localeCompare.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.localeCompare.hasOwnProperty('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/S15.5.4.1_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/S15.5.4.1_A1_T1.js new file mode 100644 index 000000000..39c876071 --- /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/S15.5.4.1_A1_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.1_A1_T1; +* @section: 15.5.4.1; +* @assertion: The initial value of String.prototype.constructor is the built-in String constructor; +* @description: Checking String.prototype.constructor; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.constructor !== String) { + $ERROR('#1: String.prototype.constructor === String. Actual: String.prototype.constructor ==='+String.prototype.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.1_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/S15.5.4.1_A1_T2.js new file mode 100644 index 000000000..e48469bab --- /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/S15.5.4.1_A1_T2.js @@ -0,0 +1,49 @@ +// 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.1_A1_T2; +* @section: 15.5.4.1; +* @assertion: The initial value of String.prototype.constructor is the built-in String constructor; +* @description: Create new String.prototype.constructor object and check it; +*/ + +var __constr = String.prototype.constructor; + +var __instance = new __constr("choosing one"); + +////////////////////////////////////////////////////////////////////////////// +// CHECK#0 +if (__instance !="choosing one") { + $ERROR('#0: __constr = String.prototype.constructor; __instance = new __constr("choosing one"); __instance =="choosing one". Actual: __instance =='+__instance ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (__instance.constructor !== String) { + $ERROR('#1: __constr = String.prototype.constructor; __instance = new __constr("choosing one"); __instance.constructor === String. Actual: __instance.constructor ==='+__instance.constructor ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +if (!(String.prototype.isPrototypeOf(__instance))) { + $ERROR('#2: __constr = String.prototype.constructor; __instance = new __constr("choosing one"); String.prototype.isPrototypeOf(__instance) return true. Actual: '+String.prototype.isPrototypeOf(__instance)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#3 +var __to_string_result = '[object '+ 'String' +']'; + +delete String.prototype.toString; + +if (__instance.toString() !== __to_string_result) { + $ERROR('#3: __constr = String.prototype.constructor; __instance = new __constr("choosing one"); delete String.prototype.toString; __instance.toString() === __to_string_result. Actual: __instance.toString() ==='+__instance.toString()+' __to_string_result ==='+__to_string_result ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.2_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/S15.5.4.2_A1_T1.js new file mode 100644 index 000000000..3dd5b24a9 --- /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/S15.5.4.2_A1_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.5.4.2_A1_T1; +* @section: 15.5.4.2; +* @assertion: String.prototype.toString() returns this string value; +* @description: Create new String(number) and check it`s method toString(); +*/ + +var __string__obj = new String(1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.toString() !== ""+1) { + $ERROR('#1: __string__obj = new String(1); __string__obj.toString() === ""+1. Actual: __string__obj.toString() ==='+__string__obj.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.2_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/S15.5.4.2_A1_T2.js new file mode 100644 index 000000000..acfa26a26 --- /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/S15.5.4.2_A1_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.5.4.2_A1_T2; +* @section: 15.5.4.2; +* @assertion: String.prototype.toString() returns this string value; +* @description: Create new String(boolean) and check it`s method toString(); +*/ + +var __string__obj = new String(true); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.toString() !== ""+true) { + $ERROR('#1: __string__obj = new String(true); __string__obj.toString() === ""+true. Actual: __string__obj.toString() ==='+__string__obj.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.2_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/S15.5.4.2_A1_T3.js new file mode 100644 index 000000000..4cd2f9155 --- /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/S15.5.4.2_A1_T3.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.5.4.2_A1_T3; +* @section: 15.5.4.2; +* @assertion: String.prototype.toString() returns this string value; +* @description: Create new String(string) and check it`s method toString(); +*/ + +var __string__obj = new String("metal"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.toString() !== "metal") { + $ERROR('#1: __string__obj = new String("metal"); __string__obj.toString() === "metal". Actual: __string__obj.toString() ==='+__string__obj.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.2_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/S15.5.4.2_A1_T4.js new file mode 100644 index 000000000..19ecfb419 --- /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/S15.5.4.2_A1_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.5.4.2_A1_T4; +* @section: 15.5.4.2; +* @assertion: String.prototype.toString() returns this string value; +* @description: Create new String(function(){}()) and check it`s method toString(); +*/ + +var __string__obj = new String(function(){}()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.toString() !== "undefined") { + $ERROR('#1: __string__obj = new String(function(){}()); __string__obj.toString() === "undefined". Actual: __string__obj.toString() ==='+__string__obj.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.2_A2_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/S15.5.4.2_A2_T1.js new file mode 100644 index 000000000..ff3689755 --- /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/S15.5.4.2_A2_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.5.4.2_A2_T1; +* @section: 15.5.4.2; +* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a String object. Therefore, it cannot be transferred to other kinds of objects for use as a method; +* @description: Checking if creating variable String.prototype.toString fails; +*/ + +var __toString = String.prototype.toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __toString !== "function") { + $ERROR('#1: __toString = String.prototype.toString; typeof __toString === "function". Actual: typeof __toString ==='+typeof __toString ); +} + +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +try { + var x = __toString(); + $FAIL('#2: "__toString = String.prototype.toString; var x = __toString();" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: "__toString = String.prototype.toString; var x = __toString();" lead to throwing exception. Exception is instance of TypeError. Actual: exception is '+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/S15.5.4.2_A2_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/S15.5.4.2_A2_T2.js new file mode 100644 index 000000000..ea7198c72 --- /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/S15.5.4.2_A2_T2.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.2_A2_T2; +* @section: 15.5.4.2; +* @assertion: The toString function is not generic; it throws a TypeError exception if its this value is not a String object. Therefore, it cannot be transferred to other kinds of objects for use as a method; +* @description: Checking if creating the object String.prototype.toString fails; +*/ + +var __obj={toString : String.prototype.toString}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __obj["toString"] !== "function") { + $ERROR('#1: var __obj={toString : String.prototype.toString}; typeof __obj["toString"] === "function". Actual: typeof __obj["toString"] ==='+typeof __obj["toString"] ); +} + +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +try { + var x = (__obj == 1); + $FAIL('#2: "var x = (__obj == 1)" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: Exception is instance of TypeError. Actual: exception is '+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/S15.5.4.2_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/S15.5.4.2_A3_T1.js new file mode 100644 index 000000000..82a26df5d --- /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/S15.5.4.2_A3_T1.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.2_A3_T1; +* @section: 15.5.4.2, 15.5.4.3; +* @assertion: String.prototype.toString() is equal String.prototype.valueOf(); +* @description: Create new String() with various arguments and compare returned results of toString() and valueOf(); +*/ + +//CHECK#1 +var str = new String(); +if(!(str.valueOf() == str.toString())) + $ERROR('#1: str = new String(),str.valueOf() == str.toString()'); + +//CHECK#2 +str = new String(true); +if(!(str.valueOf() == str.toString())) + $ERROR('#2: str = new String(true),str.valueOf() == str.toString()'); + +//CHECK#3 +str = new String(false); +if(!(str.valueOf() == str.toString())) + $ERROR('#3: str = new String(false),str.valueOf() == str.toString()'); + +//CHECK#4 +str = new String(Math.PI); +if(!(str.valueOf() == str.toString())) + $ERROR('#4: str = new String(Math.PI),str.valueOf() == str.toString()'); 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/S15.5.4.2_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/S15.5.4.2_A4_T1.js new file mode 100644 index 000000000..ae513dcc4 --- /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/S15.5.4.2_A4_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.5.4.2_A4_T1; +* @section: 15.5.4.2; +* @assertion: String.prototype.toString have length property and it is equal 0; +* @description: Checking String.prototype.toString.length property; +*/ + +//CHECK#1 +if (String.prototype.toString.hasOwnProperty('length')!==true){ + $ERROR('#1: String.prototype.toString.hasOwnProperty(\'length\')===true. Actual: '+String.prototype.toString.hasOwnProperty('length')); +} +else{ +//CHECK#2 +if (String.prototype.toString.length!==0) + $ERROR('#2: String.prototype.toString.length===0. Actual: String.prototype.toString.length==='+String.prototype.toString.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/S15.5.4.3_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/S15.5.4.3_A1_T1.js new file mode 100644 index 000000000..4d2d6ffd1 --- /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/S15.5.4.3_A1_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.5.4.3_A1_T1; +* @section: 15.5.4.3; +* @assertion: String.prototype.valueOf() returns this string value; +* @description: Create String object as new String(1) and check it`s valueOf(); +*/ + +var __string__obj = new String(1); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.valueOf() !== ""+1) { + $ERROR('#1: __string__obj = new String(1); __string__obj.valueOf() === ""+1. Actual: __string__obj.valueOf() ==='+__string__obj.valueOf() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.3_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/S15.5.4.3_A1_T2.js new file mode 100644 index 000000000..7bac198bf --- /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/S15.5.4.3_A1_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.5.4.3_A1_T2; +* @section: 15.5.4.3; +* @assertion: String.prototype.valueOf() returns this string value; +* @description: Create String object as new String(true) and check it`s valueOf(); +*/ + +var __string__obj = new String(true); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.valueOf() !== ""+true) { + $ERROR('#1: __string__obj = new String(true); __string__obj.valueOf() === ""+true. Actual: __string__obj.valueOf() ==='+__string__obj.valueOf() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.3_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/S15.5.4.3_A1_T3.js new file mode 100644 index 000000000..55e59ec90 --- /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/S15.5.4.3_A1_T3.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.5.4.3_A1_T3; +* @section: 15.5.4.3; +* @assertion: String.prototype.valueOf() returns this string value; +* @description: Create String object as new String(string) and check it`s valueOf(); +*/ + +var __string__obj = new String("metal"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.valueOf() !== "metal") { + $ERROR('#1: __string__obj = new String("metal"); __string__obj.valueOf() === "metal". Actual: __string__obj.valueOf() ==='+__string__obj.valueOf() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.3_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/S15.5.4.3_A1_T4.js new file mode 100644 index 000000000..2bf799f26 --- /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/S15.5.4.3_A1_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.5.4.3_A1_T4; +* @section: 15.5.4.3; +* @assertion: String.prototype.valueOf() returns this string value; +* @description: Create String object as new String(function(){}()) and check it`s valueOf(); +*/ + +var __string__obj = new String(function(){}()); + +////////////////////////////////////////////////////////////////////////////// +//CHECK# +if (__string__obj.valueOf() !== "undefined") { + $ERROR('#1: __string__obj = new String(function(){}()); __string__obj.valueOf() === "undefined". Actual: __string__obj.valueOf() ==='+__string__obj.valueOf() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4.3_A2_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/S15.5.4.3_A2_T1.js new file mode 100644 index 000000000..b12e7cbfd --- /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/S15.5.4.3_A2_T1.js @@ -0,0 +1,34 @@ +// 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.3_A2_T1; +* @section: 15.5.4.3; +* @assertion: The valueOf function is not generic; it throws a TypeError exception if its this value is not a String object. +* Therefore, it cannot be transferred to other kinds of objects for use as a method; +* @description: Checking if creating variable String.prototype.valueOf fails; +*/ + +var __valueOf = String.prototype.valueOf; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __valueOf !== "function") { + $ERROR('#1: __valueOf = String.prototype.valueOf; typeof __valueOf === "function". Actual: typeof __valueOf ==='+typeof __valueOf ); +} + +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +try { + var x = __valueOf(); + $FAIL('#2: "__valueOf = String.prototype.valueOf; var x = __valueOf()" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: Exception is instance of TypeError. Actual: exception is '+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/S15.5.4.3_A2_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/S15.5.4.3_A2_T2.js new file mode 100644 index 000000000..7e1461f94 --- /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/S15.5.4.3_A2_T2.js @@ -0,0 +1,34 @@ +// 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.3_A2_T2; +* @section: 15.5.4.3; +* @assertion: The valueOf function is not generic; it throws a TypeError exception if its this value is not a String object. +* Therefore, it cannot be transferred to other kinds of objects for use as a method; +* @description: Checking if creating the object String.prototype.valueOf fails; +*/ + +var __obj={valueOf : String.prototype.valueOf}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __obj["valueOf"] !== "function") { + $ERROR('#1: var __obj={valueOf : String.prototype.valueOf}; typeof __obj["valueOf"] === "function". Actual: typeof __obj["valueOf"] ==='+typeof __obj["valueOf"] ); +} + +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +try { + var x = (__obj == 1); + $FAIL('#2: "var __obj={valueOf : String.prototype.valueOf}; var x = (__obj == 1)" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#2.1: Exception is instance of TypeError. Actual: exception is '+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/S15.5.4_A1.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/S15.5.4_A1.js new file mode 100644 index 000000000..6b12fb34c --- /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/S15.5.4_A1.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_A1; +* @section: 15.5.4; +* @assertion: The String prototype object is itself a String object (its [[Class]] is "String"); +* @description: first we delete String.prototype.toString cause it overrides Object prototype toString. +* Object.prototype.toString returns [object+[[class]]+]; +*/ + +delete String.prototype.toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toString() !== "[object "+"String"+"]") { + $ERROR('#1: delete String.prototype.toString; String.prototype.toString() === "[object "+"String"+"]". Actual: String.prototype.toString() ==='+String.prototype.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// 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/S15.5.4_A2.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/S15.5.4_A2.js new file mode 100644 index 000000000..a0b501383 --- /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/S15.5.4_A2.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_A2; +* @section: 15.5.4; +* @assertion: The String prototype object is itself a String object whose value is an empty string; +* @description: Checking String.prototype; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype !="") { + $ERROR('#1: String.prototype =="". Actual: String.prototype =='+String.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/S15.5.4_A3.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/S15.5.4_A3.js new file mode 100644 index 000000000..36baa1ac2 --- /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/S15.5.4_A3.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_A3; +* @section: 15.5.4, 15.2.3.1; +* @assertion: The value of the internal [[Prototype]] property of the String prototype object is the Object prototype object (15.2.3.1); +* @description: Checking Object.prototype.isPrototypeOf(String.prototype); +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(Object.prototype.isPrototypeOf(String.prototype))) { + $ERROR('#1: Object.prototype.isPrototypeOf(String.prototype) return true. Actual: '+Object.prototype.isPrototypeOf(String.prototype)); +} +// +////////////////////////////////////////////////////////////////////////////// + +delete String.prototype.toString; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toString() != "[object "+"String"+"]") { + $ERROR('#2: delete String.prototype.toString; String.prototype.toString() == "[object "+"String"+"]". Actual: String.prototype.toString() =='+String.prototype.toString() ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A1.js new file mode 100644 index 000000000..82ccd48e9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A1.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.5.1_A1; +* @section: 15.5.5.1; +* @assertion: length property contains the number of characters in the String value represented by this String object; +* @description: Create strings and check its length; +*/ + +var __str__instance = new String("ABC\u0041\u0042\u0043"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str__instance.length !== 6) { + $ERROR('#1: var __str__instance = new String("ABC\\u0041\\u0042\\u0043"); __str__instance.length === 6, where __str__instance is new String("ABC\\u0041\\u0042\\u0043"). Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str__instance = new String; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str__instance.length !== 0) { + $ERROR('#2: __str__instance = new String; __str__instance.length === 0, where __str__instance is new String. Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A2.js new file mode 100644 index 000000000..592b089e5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A2.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.5.1_A2; +* @section: 15.5.5.1; +* @assertion: length property has the attributes {DontEnum}; +* @description: Checking if enumerating the length property of String fails; +*/ + +var __str__instance = new String("globglob"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__str__instance.hasOwnProperty("length"))) { + $ERROR('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(prop in __str__instance){ + if (prop === "length") { + $ERROR('#2: length property has the attributes {DontEnum}'); + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A3.js new file mode 100644 index 000000000..95e03a952 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A3.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.5.1_A3; +* @section: 15.5.5.1; +* @assertion: length property has the attributes {DontDelete}; +* @description: Checking if deleting the length property of String fails; +*/ + +var __str__instance = new String("globglob"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__str__instance.hasOwnProperty("length"))) { + $ERROR('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (delete __str__instance === true) { + $ERROR('#2: var __str__instance = new String("globglob"); delete __str__instance !== true'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (!(__str__instance.hasOwnProperty("length"))) { + $ERROR('#3: var __str__instance = new String("globglob"); delete __str__instance; __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A4.js new file mode 100644 index 000000000..4901eed6a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A4.js @@ -0,0 +1,58 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.5.1_A4; +* @section: 15.5.5.1; +* @assertion: length property has the attributes {ReadOnly}; +* @description: Checking if varying the length property of String fails; +*/ + +var __str__instance = new String("globglob"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__str__instance.hasOwnProperty("length"))) { + $ERROR('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str__instance.length !== 8) { + $ERROR('#2: var __str__instance = new String("globglob"); __str__instance.length === 8. Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str__instance.length=-1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__str__instance.length !== 8) { + $ERROR('#3: var __str__instance = new String("globglob"); __str__instance.length=-1; __str__instance.length === 8(after redefine length property). Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +with(__str__instance) + length = 0; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__str__instance.length !== 8) { + $ERROR('#4: var __str__instance = new String("globglob"); with(__str__instance) length = 0; __str__instance.length === 8(after redefine length property with using "with"). Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str__instance.length++; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__str__instance.length !== 8) { + $ERROR('#5: var __str__instance = new String("globglob"); __str__instance.length++; __str__instance.length === 8(after redefine length property with using "++"). Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A5.js new file mode 100644 index 000000000..f02edf120 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A5.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.5.1_A5; +* @section: 15.5.5.1; +* @assertion: Once a String object is created, the length property is unchanging; +* @description: Change valueOf and toString of String object and check length property; +*/ + +var __str__instance = new String("ABC\u0041\u0042\u0043"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__str__instance.length !== 6) { + $ERROR('#1: var __str__instance = new String("ABC\\u0041\\u0042\\u0043"); __str__instance.length === 6. Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +__str__instance.valueOf = function(){return "ed"}; +__str__instance.toString = function(){return "ed"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__str__instance !="ed") { + $ERROR('#2: var __str__instance = new String("ABC\\u0041\\u0042\\u0043"); __str__instance.valueOf = function(){return "ed"}; __str__instance.toString = function(){return "ed"}; __str__instance =="ed". Actual: __str__instance =='+__str__instance ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__str__instance.length !== 6) { + $ERROR('#3: var __str__instance = new String("ABC\\u0041\\u0042\\u0043"); __str__instance.valueOf = function(){return "ed"}; __str__instance.toString = function(){return "ed"}; __str__instance.length === 6. Actual: __str__instance.length ==='+__str__instance.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_T1.js new file mode 100644 index 000000000..a2e469d05 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_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.5.5_A1_T1; +* @section: 15.5.5; +* @assertion: String instance has not [[call]] property; +* @description: Create new String and try call it; +*/ + +var __str = new String; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + __str(); + $FAIL('#1: __str = new String; __str() lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. Actual: exception is '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_T2.js new file mode 100644 index 000000000..4e2ba8b44 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A1_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.5_A1_T2; +* @section: 15.5.5; +* @assertion: String instance has not [[call]] property; +* @description: Checking if creating new "String("a|b")()" fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + String("a|b")(); + $FAIL('#1: String("a|b")() lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. Actual: exception is '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A2_T1.js new file mode 100644 index 000000000..254827995 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_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.5.5_A2_T1; +* @section: 15.5.5; +* @assertion: String instance has not [[construct]] property; +* @description: Create new string object and try new created_string; +*/ + +var __str = new Object(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + new __str; + $FAIL('#1: __str = new Object(""); "new __str" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. Actual: exception is '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A2_T2.js new file mode 100644 index 000000000..c026f5c1d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5_A2_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.5_A2_T2; +* @section: 15.5.5; +* @assertion: String instance has not [[construct]] property; +* @description: Checking if creating "new String" fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + new new String; + $FAIL('#1: "new new String" lead to throwing exception'); +} catch (e) { + if (!(e instanceof TypeError)) { + $ERROR('#1.1: Exception is instance of TypeError. Actual: exception is '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// |