diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object')
108 files changed, 3754 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A10.js new file mode 100644 index 000000000..2a25b2d34 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A10.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A10; +* @section: 15.10.6.2; +* @assertion: The RegExp.prototype.exec.length property has the attribute ReadOnly; +* @description: Checking if varying the RegExp.prototype.exec.length property fails; +*/ + +//CHECK#1 +if (RegExp.prototype.exec.hasOwnProperty('length') !== true) { + $FAIL('#1: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + +__obj = RegExp.prototype.exec.length; + +RegExp.prototype.exec.length = function(){return "shifted";}; + +//CHECK#2 +if (RegExp.prototype.exec.length !== __obj) { + $ERROR('#2: __obj = RegExp.prototype.exec.length; RegExp.prototype.exec.length = function(){return "shifted";}; RegExp.prototype.exec.length === __obj. Actual: ' + (RegExp.prototype.exec.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A11.js new file mode 100644 index 000000000..82dbc26c2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A11.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.10.6.2_A11; +* @section: 15.10.6.2; +* @assertion: The length property of the exec method is 1; +* @description: Checking RegExp.prototype.exec.length; +*/ + +//CHECK#1 +if (RegExp.prototype.exec.hasOwnProperty("length") !== true) { + $FAIL('#1: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + +//CHECK#2 +if (RegExp.prototype.exec.length !== 1) { + $ERROR('#2: RegExp.prototype.exec.length === 1. Actual: ' + (RegExp.prototype.exec.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js new file mode 100644 index 000000000..111aedb39 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js @@ -0,0 +1,18 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A12; +* @section: 15.10.6.2; +* @assertion: regExp exec() acts like regExp.exec('undefined') (step 2); +* @description: Checking RegExp.prototype.exec.length; +*/ + +(/foo/).test('xfoox'); +var match = new RegExp('(.|\r|\n)*','').exec()[0]; +if (match === 'xfoox') { + $FAIL('#1: regExp.exec() leaks match globally'); +} +if (match !== 'undefined') { + $FAIL('#2: regExp.exec() must coerce absent first arg to "undefined"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T1.js new file mode 100644 index 000000000..ea1c79e14 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A1_T1; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is "123" and RegExp is /1|12/; +*/ + +__executed = /1|12/.exec("123"); + +__expected = ["1"]; +__expected.index=0; +__expected.input="123"; +
//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /1|12/.exec("123"); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /1|12/.exec("123"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /1|12/.exec("123"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /1|12/.exec("123"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /1|12/.exec("123"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T10.js new file mode 100644 index 000000000..7d1643c3d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_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.10.6.2_A1_T10; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is 1.01 and RegExp is /1|12/; +*/ + +__executed = /1|12/.exec(1.01); + +__expected = ["1"]; +__expected.index=0; +__expected.input="1.01"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /1|12/.exec(1.01); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /1|12/.exec(1.01); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /1|12/.exec(1.01); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /1|12/.exec(1.01); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /1|12/.exec(1.01); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T11.js new file mode 100644 index 000000000..f0007c8d9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A1_T11; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is new Number(1.012) and RegExp is /2|12/; +*/ + +__executed = /2|12/.exec(new Number(1.012)); + +__expected = ["12"]; +__expected.index=3; +__expected.input="1.012"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /2|12/.exec(new Number(1.012)); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /2|12/.exec(new Number(1.012)); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /2|12/.exec(new Number(1.012)); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /2|12/.exec(new Number(1.012)); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /2|12/.exec(new Number(1.012)); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T12.js new file mode 100644 index 000000000..115be87a3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T12.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.10.6.2_A1_T12; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:function(){return Math.PI;}} and RegExp is /\.14/; +*/ + +__executed = /\.14/.exec({toString:function(){return Math.PI}}); + +__expected = [".14"]; +__expected.index=1; +__expected.input=String(Math.PI); + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /\\.14/.exec({toString:function(){return Math.PI}}); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /\\.14/.exec({toString:function(){return Math.PI}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /\\.14/.exec({toString:function(){return Math.PI}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /\\.14/.exec({toString:function(){return Math.PI}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /\\.14/.exec({toString:function(){return Math.PI}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T13.js new file mode 100644 index 000000000..8bddc32da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T13.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.10.6.2_A1_T13; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is true and RegExp is /t[a-b|q-s]/; +*/ + +__executed = /t[a-b|q-s]/.exec(true); + +__expected = ["tr"]; +__expected.index=0; +__expected.input="true"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /t[a-b|q-s]/.exec(true); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /t[a-b|q-s]/.exec(true); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /t[a-b|q-s]/.exec(true); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /t[a-b|q-s]/.exec(true); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /t[a-b|q-s]/.exec(true); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T14.js new file mode 100644 index 000000000..543d9705f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T14.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.10.6.2_A1_T14; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is new Boolean and RegExp is /AL|se/; +*/ + +__executed = /AL|se/.exec(new Boolean); + +__expected = ["se"]; +__expected.index=3; +__expected.input="false"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /AL|se/.exec(new Boolean); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /AL|se/.exec(new Boolean); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /AL|se/.exec(new Boolean); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /AL|se/.exec(new Boolean); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /AL|se/.exec(new Boolean); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T15.js new file mode 100644 index 000000000..6807fcc03 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T15.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.10.6.2_A1_T15; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:function(){return false;}} and RegExp is /LS/i; +*/ + +__executed = /LS/i.exec({toString:function(){return false}}); + +__expected = ["ls"]; +__expected.index=2; +__expected.input="false"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /LS/i.exec({toString:function(){return false}}); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /LS/i.exec({toString:function(){return false}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /LS/i.exec({toString:function(){return false}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /LS/i.exec({toString:function(){return false}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /LS/i.exec({toString:function(){return false}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T16.js new file mode 100644 index 000000000..79a3fad5e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T16.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.10.6.2_A1_T16; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: RegExp is /undefined/ and call exec() without arguments; +*/ + +__re = /undefined/.exec()[0]; +if (__re !== "undefined") { + $ERROR('#1: /undefined/.exec()[0] === "undefined". Actual: ' + (__re)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T17.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T17.js new file mode 100644 index 000000000..79373bd06 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T17.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.10.6.2_A1_T17; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is null and RegExp is /ll|l/; +*/ + +__executed = /ll|l/.exec(null); + +__expected = ["ll"]; +__expected.index=2; +__expected.input="null"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /ll|l/.exec(null); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /ll|l/.exec(null); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /ll|l/.exec(null); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /ll|l/.exec(null); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /ll|l/.exec(null); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T18.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T18.js new file mode 100644 index 000000000..ee3953b81 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T18.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.10.6.2_A1_T18; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is undefined and RegExp is /nd|ne/; +*/ + +__executed = /nd|ne/.exec(undefined); + +__expected = ["nd"]; +__expected.index=1; +__expected.input="undefined"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /nd|ne/.exec(undefined); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /nd|ne/.exec(undefined); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /nd|ne/.exec(undefined); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /nd|ne/.exec(undefined); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /nd|ne/.exec(undefined); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T19.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T19.js new file mode 100644 index 000000000..ba9c3f21e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T19.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.10.6.2_A1_T19; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is void 0 and RegExp is /e{1}/; +*/ + +__executed = /e{1}/.exec(void 0); + +__expected = ["e"]; +__expected.index=3; +__expected.input="undefined"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /e{1}/.exec(void 0); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /e{1}/.exec(void 0); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /e{1}/.exec(void 0); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /e{1}/.exec(void 0); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /e{1}/.exec(void 0); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T2.js new file mode 100644 index 000000000..99f506d5e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T2.js @@ -0,0 +1,46 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A1_T2; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is new String("123") and RegExp is /((1)|(12))((3)|(23))/; +*/ + +with(/((1)|(12))((3)|(23))/){ + __executed = exec(new String("123")); +} + +__expected = ["123", "1", "1", undefined, "23", undefined, "23"]; +__expected.index=0; +__expected.input="123"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: with(/((1)|(12))((3)|(23))/){__executed = exec(new String("123"));} (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: with(/((1)|(12))((3)|(23))/){__executed = exec(new String("123"));} __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: with(/((1)|(12))((3)|(23))/){__executed = exec(new String("123"));} __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: with(/((1)|(12))((3)|(23))/){__executed = exec(new String("123"));} __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: with(/((1)|(12))((3)|(23))/){__executed = exec(new String("123"));} __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T20.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T20.js new file mode 100644 index 000000000..fd431ea82 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_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.10.6.2_A1_T20; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is x and RegExp is /[a-f]d/, where x is undefined variable; +*/ + +__executed = /[a-f]d/.exec(x); + +__expected = ["ed"]; +__expected.index=7; +__expected.input="undefined"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /[a-f]d/.exec(x); var x; (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /[a-f]d/.exec(x); var x; __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /[a-f]d/.exec(x); var x; __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /[a-f]d/.exec(x); var x; __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /[a-f]d/.exec(x); var x; __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T21.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T21.js new file mode 100644 index 000000000..5b538e9b6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T21.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.10.6.2_A1_T21; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is function(){}() and RegExp is /[a-z]n/; +*/ + +__executed = /[a-z]n/.exec(function(){}()); + +__expected = ["un"]; +__expected.index=0; +__expected.input="undefined"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /[a-z]n/.exec(function(){}()); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /[a-z]n/.exec(function(){}()); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /[a-z]n/.exec(function(){}()); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /[a-z]n/.exec(function(){}()); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /[a-z]n/.exec(function(){}()); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T3.js new file mode 100644 index 000000000..39988e585 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A1_T3; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is new Object("abcdefghi") and RegExp is /a[a-z]{2,4}/; +*/ + +__executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); + +__expected = ["abcde"]; +__expected.index=0; +__expected.input="abcdefghi"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /a[a-z]{2,4}/.exec(new Object("abcdefghi")); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T4.js new file mode 100644 index 000000000..42fc37e27 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A1_T4; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:function(){return "abcdefghi";}} and RegExp is /a[a-z]{2,4}?/; +*/ + +__executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); + +__expected = ["abc"]; +__expected.index=0; +__expected.input="abcdefghi"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return "abcdefghi"}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T5.js new file mode 100644 index 000000000..d11ada895 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T5.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.10.6.2_A1_T5; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:function(){return {};}, valueOf:function(){return "aabaac";}} and RegExp is /(aa|aabaac|ba|b|c)* /; +*/ + +__executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); + +__expected = ["aaba", "ba"]; +__expected.index=0; +__expected.input="aabaac"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return "aabaac";}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T6.js new file mode 100644 index 000000000..b38b1ce88 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T6.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.10.6.2_A1_T6; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is (function(){return "zaacbbbcac"})() and RegExp is /(z)((a+)?(b+)?(c))* /; +*/ + +__executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); + +__expected = ["zaacbbbcac", "z", "ac", "a", undefined, "c"]; +__expected.index=0; +__expected.input="zaacbbbcac"; + +//CHECK#0 +if ((__executed instanceof Array) !== true) { + $ERROR('#0: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); (__executed instanceof Array) === true'); +} + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return "zaacbbbcac"})()); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T7.js new file mode 100644 index 000000000..fd0058a62 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_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.10.6.2_A1_T7; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:function(){throw "intostr";}} and RegExp is /[a-z]/; +*/ + + +//CHECK#1 +try { + $ERROR('#1.1: /[a-z]/.exec({toString:function(){throw "intostr"}}) throw "intostr". Actual: ' + (/[a-z]/.exec({toString:function(){throw "intostr"}}))); +} catch (e) { + if (e !== "intostr") { + $ERROR('#1.2: /[a-z]/.exec({toString:function(){throw "intostr"}}) throw "intostr". Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T8.js new file mode 100644 index 000000000..cf7b47af1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A1_T8; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is {toString:void 0, valueOf:function(){throw "invalof";}} and RegExp is /[a-z]/; +*/ + +//CHECK#1 +try { + $ERROR('#1.1: /[a-z]/.exec({toString:void 0, valueOf:function(){throw "invalof"}}) throw "invalof". Actual: ' + (/[a-z]/.exec({toString:void 0, valueOf:function(){throw "invalof"}}))); +} catch (e) { + if (e !== "invalof") { + $ERROR('#1.2: /[a-z]/.exec({toString:void 0, valueOf:function(){throw "invalof"}}) throw "invalof". Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T9.js new file mode 100644 index 000000000..3a90f4135 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T9.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.10.6.2_A1_T9; +* @section: 15.10.6.2; +* @assertion: RegExp.prototype.exec(string) Performs a regular expression match of ToString(string) against the regular expression and +* returns an Array object containing the results of the match, or null if the string did not match; +* @description: String is undefined variable and RegExp is /1|12/; +*/ + +var __string; + +//CHECK#1 +__re = /1|12/; +if (__re.exec(__string) !== null) { + $ERROR('#1: var __string; /1|12/.exec(__string) === null; function __string(){}. Actual: ' + (__re)); +} + +function __string(){}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T1.js new file mode 100644 index 000000000..94bc7623d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A2_T1; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The internal [[Class]] property is "Object"; +*/ + +__instance = new Object; + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = new Object; __instance.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (__instance.exec("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new Object; __instance.exec = RegExp.prototype.exec. Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T10.js new file mode 100644 index 000000000..7f4dbf746 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A2_T10; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is undefined; +*/ + +exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (exec("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T2.js new file mode 100644 index 000000000..e5e3aea1b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_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.10.6.2_A2_T2; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is Math; +*/ + +__instance = Math; + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + with(__instance) exec("message to investigate"); + $ERROR('#1.1: __instance = Math; __instance.exec = RegExp.prototype.exec; with(__instance) exec("message to investigate")'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = Math; __instance.exec = RegExp.prototype.exec; with(__instance) exec("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T3.js new file mode 100644 index 000000000..e06e2c075 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T3.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.10.6.2_A2_T3; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is function object; +*/ + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + with(__instance) exec("message to investigate"); + $ERROR('#1.1: __instance.exec = RegExp.prototype.exec; with(__instance) exec("message to investigate"); function __instance(){}'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance.exec = RegExp.prototype.exec; with(__instance) exec("message to investigate"); function __instance(){}. Actual: ' + (e)); + } +} + +function __instance(){}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T4.js new file mode 100644 index 000000000..9bddf8ae2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T4.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A2_T4; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new String("[a-b]"); +*/ + +__instance = new String("[a-b]"); + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +with(__instance){ + try { + $ERROR('#1.1: __instance = new String("[a-b]"); __instance.exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (exec("message to investigate"))); + } catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new String("[a-b]"); __instance.exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (e)); + } + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T5.js new file mode 100644 index 000000000..3aac92f1d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_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.10.6.2_A2_T5; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new Boolean(false); +*/ + +__instance = new Boolean(false); + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +with(__instance) { + try { + $ERROR('#1.1: __instance = new Boolean(false); __instance.exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (exec("message to investigate"))); + } catch (e) { + if ((e instanceof TypeError !== true)) { + $ERROR('#1.2: __instance = new Boolean(false); __instance.exec = RegExp.prototype.exec; exec("message to investigate"). Actual: ' + (e)); + } + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T6.js new file mode 100644 index 000000000..7ac059ad0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T6.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.10.6.2_A2_T6; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new Number(1.0); +*/ + +__instance = new Number(1.0); + +__instance.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = new Number(1.0); __instance.exec = RegExp.prototype.exec; __instance["exec"]("message to investigate"). Actual: ' + (__instance["exec"]("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new Number(1.0); __instance.exec = RegExp.prototype.exec; __instance["exec"]("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T7.js new file mode 100644 index 000000000..8dd2d21bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T7.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.10.6.2_A2_T7; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is false; +*/ + +__instance = false; + +Object.prototype.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = false; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (__instance.exec("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = false; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T8.js new file mode 100644 index 000000000..8ee285f7c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T8.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.10.6.2_A2_T8; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is "."; +*/ + +__instance = "."; + +Object.prototype.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = "."; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (__instance.exec("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = "."; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_T9.js new file mode 100644 index 000000000..af4c400d6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A2_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.10.6.2_A2_T9; +* @section: 15.10.6.2; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is 1.0; +*/ + +__instance = 1.0; + +Object.prototype.exec = RegExp.prototype.exec; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = 1.0; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (__instance.exec("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = 1.0; Object.prototype.exec = RegExp.prototype.exec; __instance.exec("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T1.js new file mode 100644 index 000000000..996aafa8d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A3_T1; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /(?:ab|cd)\d?/g and tested string is "ab cd2 ab34 cd"; +*/ + +__re = /(?:ab|cd)\d?/g; + +__matched = []; + +__expected = ["ab", "cd2", "ab3", "cd"]; + +do{ + __executed = __re.exec("ab cd2 ab34 cd"); + if (__executed !== null) { + __matched.push(__executed[0]); + } else { + break; + } +}while(true); + +//CHECK#1 +if (__expected.length !== __matched.length) { + $ERROR('#1: __executed = /(?:ab|cd)\\d?/g.exec("ab cd2 ab34 cd"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length)); +} + +//CHECK#2 +for(var index=0; index<__expected.length; index++) { + if (__expected[index] !== __matched[index]) { + $ERROR('#2: __executed = /(?:ab|cd)\\d?/g.exec("ab cd2 ab34 cd"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T2.js new file mode 100644 index 000000000..8fab0ae55 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T2.js @@ -0,0 +1,155 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A3_T2; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /[Nn]evermore/g and tested string is very long string; +*/ + +__the__raven = " Once upon a midnight dreary, while I pondered weak and weary," + + "Over many a quaint and curious volume of forgotten lore," + + "While I nodded, nearly napping, suddenly there came a tapping," + + "As of some one gently rapping, rapping at my chamber door." + + "`'Tis some visitor,' I muttered, `tapping at my chamber door -" + + "Only this, and nothing more.'" + + "Ah, distinctly I remember it was in the bleak December," + + "And each separate dying ember wrought its ghost upon the floor." + + "Eagerly I wished the morrow; - vainly I had sought to borrow" + + "From my books surcease of sorrow - sorrow for the lost Lenore -" + + "For the rare and radiant maiden whom the angels named Lenore -" + + "Nameless here for evermore." + + "\n" + + "And the silken sad uncertain rustling of each purple curtain" + + "Thrilled me - filled me with fantastic terrors never felt before;" + + "So that now, to still the beating of my heart, I stood repeating" + + "`'Tis some visitor entreating entrance at my chamber door -" + + "Some late visitor entreating entrance at my chamber door; -" + + "This it is, and nothing more,'" + + "Presently my soul grew stronger; hesitating then no longer," + + "`Sir,' said I, `or Madam, truly your forgiveness I implore;" + + "But the fact is I was napping, and so gently you came rapping," + + "And so faintly you came tapping, tapping at my chamber door," + + "That I scarce was sure I heard you' - here I opened wide the door; -" + + "Darkness there, and nothing more." + + "\n" + + "Deep into that darkness peering, long I stood there wondering, fearing," + + "Doubting, dreaming dreams no mortal ever dared to dream before" + + "But the silence was unbroken, and the darkness gave no token," + + "And the only word there spoken was the whispered word, `Lenore!'" + + "This I whispered, and an echo murmured back the word, `Lenore!'" + + "Merely this and nothing more." + + "\n" + + "Back into the chamber turning, all my soul within me burning," + + "Soon again I heard a tapping somewhat louder than before." + + "`Surely,' said I, `surely that is something at my window lattice;" + + "Let me see then, what thereat is, and this mystery explore -" + + "Let my heart be still a moment and this mystery explore; -" + + "'Tis the wind and nothing more!'" + + "\n" + + "Open here I flung the shutter, when, with many a flirt and flutter," + + "In there stepped a stately raven of the saintly days of yore." + + "Not the least obeisance made he; not a minute stopped or stayed he;" + + "But, with mien of lord or lady, perched above my chamber door -" + + "Perched upon a bust of Pallas just above my chamber door -" + + "Perched, and sat, and nothing more." + + "\n" + + "Then this ebony bird beguiling my sad fancy into smiling," + + "By the grave and stern decorum of the countenance it wore," + + "`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven." + + "Ghastly grim and ancient raven wandering from the nightly shore -" + + "Tell me what thy lordly name is on the Night's Plutonian shore!'" + + "Quoth the raven, `Nevermore.'" + + "-n" + + "Much I marvelled this ungainly fowl to hear discourse so plainly," + + "Though its answer little meaning - little relevancy bore;" + + "For we cannot help agreeing that no living human being" + + "Ever yet was blessed with seeing bird above his chamber door -" + + "Bird or beast above the sculptured bust above his chamber door," + + "With such name as `Nevermore.'" + + "\n" + + "But the raven, sitting lonely on the placid bust, spoke only," + + "That one word, as if his soul in that one word he did outpour." + + "Nothing further then he uttered - not a feather then he fluttered -" + + "Till I scarcely more than muttered `Other friends have flown before -" + + "On the morrow he will leave me, as my hopes have flown before.'" + + "Then the bird said, `Nevermore.'" + + "\n" + + "Startled at the stillness broken by reply so aptly spoken," + + "`Doubtless,' said I, `what it utters is its only stock and store," + + "Caught from some unhappy master whom unmerciful disaster" + + "Followed fast and followed faster till his songs one burden bore -" + + "Till the dirges of his hope that melancholy burden bore" + + "Of \"Never-nevermore.\"'" + + "\n" + + "But the raven still beguiling all my sad soul into smiling," + + "Straight I wheeled a cushioned seat in front of bird and bust and door;" + + "Then, upon the velvet sinking, I betook myself to linking" + + "Fancy unto fancy, thinking what this ominous bird of yore -" + + "What this grim, ungainly, ghastly, gaunt, and ominous bird of yore" + + "Meant in croaking `Nevermore.'" + + "\n" + + "This I sat engaged in guessing, but no syllable expressing" + + "To the fowl whose fiery eyes now burned into my bosom's core;" + + "This and more I sat divining, with my head at ease reclining" + + "On the cushion's velvet lining that the lamp-light gloated o'er," + + "But whose velvet violet lining with the lamp-light gloating o'er," + + "She shall press, ah, nevermore!" + + "\n" + + "Then, methought, the air grew denser, perfumed from an unseen censer" + + "Swung by Seraphim whose foot-falls tinkled on the tufted floor." + + "`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee" + + "Respite - respite and nepenthe from thy memories of Lenore!" + + "Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -" + + "Whether tempter sent, or whether tempest tossed thee here ashore," + + "Desolate yet all undaunted, on this desert land enchanted -" + + "On this home by horror haunted - tell me truly, I implore -" + + "Is there - is there balm in Gilead? - tell me - tell me, I implore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!" + + "By that Heaven that bends above us - by that God we both adore -" + + "Tell this soul with sorrow laden if, within the distant Aidenn," + + "It shall clasp a sainted maiden whom the angels named Lenore -" + + "Clasp a rare and radiant maiden, whom the angels named Lenore?'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -" + + "`Get thee back into the tempest and the Night's Plutonian shore!" + + "Leave no black plume as a token of that lie thy soul hath spoken!" + + "Leave my loneliness unbroken! - quit the bust above my door!" + + "Take thy beak from out my heart, and take thy form from off my door!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "And the raven, never flitting, still is sitting, still is sitting" + + "On the pallid bust of Pallas just above my chamber door;" + + "And his eyes have all the seeming of a demon's that is dreaming," + + "And the lamp-light o'er him streaming throws his shadow on the floor;" + + "And my soul from out that shadow that lies floating on the floor" + + "Shall be lifted - nevermore!" + +NEVERMORE=11; + +__re = /[Nn]evermore/g; +__matched=0; + +do{ + __executed = __re.exec(__the__raven); + if (__executed !== null) { + __matched++; + } else { + break; + } +}while(1); + +//CHECK#1 +if (__matched !== NEVERMORE) { + $ERROR('#1: __re = /[Nn]evermore/g; __executed = __re.exec(__the__raven)'+__matched); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T3.js new file mode 100644 index 000000000..568684e9b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T3.js @@ -0,0 +1,155 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A3_T3; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /[Nn]?evermore/g and tested string is very long string; +*/ + +__the__raven = " Once upon a midnight dreary, while I pondered weak and weary," + + "Over many a quaint and curious volume of forgotten lore," + + "While I nodded, nearly napping, suddenly there came a tapping," + + "As of some one gently rapping, rapping at my chamber door." + + "`'Tis some visitor,' I muttered, `tapping at my chamber door -" + + "Only this, and nothing more.'" + + "Ah, distinctly I remember it was in the bleak December," + + "And each separate dying ember wrought its ghost upon the floor." + + "Eagerly I wished the morrow; - vainly I had sought to borrow" + + "From my books surcease of sorrow - sorrow for the lost Lenore -" + + "For the rare and radiant maiden whom the angels named Lenore -" + + "Nameless here for evermore." + + "\n" + + "And the silken sad uncertain rustling of each purple curtain" + + "Thrilled me - filled me with fantastic terrors never felt before;" + + "So that now, to still the beating of my heart, I stood repeating" + + "`'Tis some visitor entreating entrance at my chamber door -" + + "Some late visitor entreating entrance at my chamber door; -" + + "This it is, and nothing more,'" + + "Presently my soul grew stronger; hesitating then no longer," + + "`Sir,' said I, `or Madam, truly your forgiveness I implore;" + + "But the fact is I was napping, and so gently you came rapping," + + "And so faintly you came tapping, tapping at my chamber door," + + "That I scarce was sure I heard you' - here I opened wide the door; -" + + "Darkness there, and nothing more." + + "\n" + + "Deep into that darkness peering, long I stood there wondering, fearing," + + "Doubting, dreaming dreams no mortal ever dared to dream before" + + "But the silence was unbroken, and the darkness gave no token," + + "And the only word there spoken was the whispered word, `Lenore!'" + + "This I whispered, and an echo murmured back the word, `Lenore!'" + + "Merely this and nothing more." + + "\n" + + "Back into the chamber turning, all my soul within me burning," + + "Soon again I heard a tapping somewhat louder than before." + + "`Surely,' said I, `surely that is something at my window lattice;" + + "Let me see then, what thereat is, and this mystery explore -" + + "Let my heart be still a moment and this mystery explore; -" + + "'Tis the wind and nothing more!'" + + "\n" + + "Open here I flung the shutter, when, with many a flirt and flutter," + + "In there stepped a stately raven of the saintly days of yore." + + "Not the least obeisance made he; not a minute stopped or stayed he;" + + "But, with mien of lord or lady, perched above my chamber door -" + + "Perched upon a bust of Pallas just above my chamber door -" + + "Perched, and sat, and nothing more." + + "\n" + + "Then this ebony bird beguiling my sad fancy into smiling," + + "By the grave and stern decorum of the countenance it wore," + + "`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven." + + "Ghastly grim and ancient raven wandering from the nightly shore -" + + "Tell me what thy lordly name is on the Night's Plutonian shore!'" + + "Quoth the raven, `Nevermore.'" + + "-n" + + "Much I marvelled this ungainly fowl to hear discourse so plainly," + + "Though its answer little meaning - little relevancy bore;" + + "For we cannot help agreeing that no living human being" + + "Ever yet was blessed with seeing bird above his chamber door -" + + "Bird or beast above the sculptured bust above his chamber door," + + "With such name as `Nevermore.'" + + "\n" + + "But the raven, sitting lonely on the placid bust, spoke only," + + "That one word, as if his soul in that one word he did outpour." + + "Nothing further then he uttered - not a feather then he fluttered -" + + "Till I scarcely more than muttered `Other friends have flown before -" + + "On the morrow he will leave me, as my hopes have flown before.'" + + "Then the bird said, `Nevermore.'" + + "\n" + + "Startled at the stillness broken by reply so aptly spoken," + + "`Doubtless,' said I, `what it utters is its only stock and store," + + "Caught from some unhappy master whom unmerciful disaster" + + "Followed fast and followed faster till his songs one burden bore -" + + "Till the dirges of his hope that melancholy burden bore" + + "Of \"Never-nevermore.\"'" + + "\n" + + "But the raven still beguiling all my sad soul into smiling," + + "Straight I wheeled a cushioned seat in front of bird and bust and door;" + + "Then, upon the velvet sinking, I betook myself to linking" + + "Fancy unto fancy, thinking what this ominous bird of yore -" + + "What this grim, ungainly, ghastly, gaunt, and ominous bird of yore" + + "Meant in croaking `Nevermore.'" + + "\n" + + "This I sat engaged in guessing, but no syllable expressing" + + "To the fowl whose fiery eyes now burned into my bosom's core;" + + "This and more I sat divining, with my head at ease reclining" + + "On the cushion's velvet lining that the lamp-light gloated o'er," + + "But whose velvet violet lining with the lamp-light gloating o'er," + + "She shall press, ah, nevermore!" + + "\n" + + "Then, methought, the air grew denser, perfumed from an unseen censer" + + "Swung by Seraphim whose foot-falls tinkled on the tufted floor." + + "`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee" + + "Respite - respite and nepenthe from thy memories of Lenore!" + + "Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -" + + "Whether tempter sent, or whether tempest tossed thee here ashore," + + "Desolate yet all undaunted, on this desert land enchanted -" + + "On this home by horror haunted - tell me truly, I implore -" + + "Is there - is there balm in Gilead? - tell me - tell me, I implore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!" + + "By that Heaven that bends above us - by that God we both adore -" + + "Tell this soul with sorrow laden if, within the distant Aidenn," + + "It shall clasp a sainted maiden whom the angels named Lenore -" + + "Clasp a rare and radiant maiden, whom the angels named Lenore?'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -" + + "`Get thee back into the tempest and the Night's Plutonian shore!" + + "Leave no black plume as a token of that lie thy soul hath spoken!" + + "Leave my loneliness unbroken! - quit the bust above my door!" + + "Take thy beak from out my heart, and take thy form from off my door!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "And the raven, never flitting, still is sitting, still is sitting" + + "On the pallid bust of Pallas just above my chamber door;" + + "And his eyes have all the seeming of a demon's that is dreaming," + + "And the lamp-light o'er him streaming throws his shadow on the floor;" + + "And my soul from out that shadow that lies floating on the floor" + + "Shall be lifted - nevermore!" + +NEVERMORE_AND_EVERMORE=12; + +__re = /[Nn]?evermore/g; +__matched=0; + +do{ + __executed = __re.exec(__the__raven); + if (__executed !== null) { + __matched++; + } else { + break; + } +}while(1); + +//CHECK#1 +if (__matched !== NEVERMORE_AND_EVERMORE) { + $ERROR('#1: __re = /[Nn]?evermore/g; __executed = __re.exec(__the__raven)'+__matched); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T4.js new file mode 100644 index 000000000..1cffd6ce1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T4.js @@ -0,0 +1,155 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A3_T4; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /([Nn]?ever|([Nn]othing\s{1,}))more/g and tested string is very long string; +*/ + +__the__raven = " Once upon a midnight dreary, while I pondered weak and weary," + + "Over many a quaint and curious volume of forgotten lore," + + "While I nodded, nearly napping, suddenly there came a tapping," + + "As of some one gently rapping, rapping at my chamber door." + + "`'Tis some visitor,' I muttered, `tapping at my chamber door -" + + "Only this, and nothing more.'" + + "Ah, distinctly I remember it was in the bleak December," + + "And each separate dying ember wrought its ghost upon the floor." + + "Eagerly I wished the morrow; - vainly I had sought to borrow" + + "From my books surcease of sorrow - sorrow for the lost Lenore -" + + "For the rare and radiant maiden whom the angels named Lenore -" + + "Nameless here for evermore." + + "\n" + + "And the silken sad uncertain rustling of each purple curtain" + + "Thrilled me - filled me with fantastic terrors never felt before;" + + "So that now, to still the beating of my heart, I stood repeating" + + "`'Tis some visitor entreating entrance at my chamber door -" + + "Some late visitor entreating entrance at my chamber door; -" + + "This it is, and nothing more,'" + + "Presently my soul grew stronger; hesitating then no longer," + + "`Sir,' said I, `or Madam, truly your forgiveness I implore;" + + "But the fact is I was napping, and so gently you came rapping," + + "And so faintly you came tapping, tapping at my chamber door," + + "That I scarce was sure I heard you' - here I opened wide the door; -" + + "Darkness there, and nothing more." + + "\n" + + "Deep into that darkness peering, long I stood there wondering, fearing," + + "Doubting, dreaming dreams no mortal ever dared to dream before" + + "But the silence was unbroken, and the darkness gave no token," + + "And the only word there spoken was the whispered word, `Lenore!'" + + "This I whispered, and an echo murmured back the word, `Lenore!'" + + "Merely this and nothing more." + + "\n" + + "Back into the chamber turning, all my soul within me burning," + + "Soon again I heard a tapping somewhat louder than before." + + "`Surely,' said I, `surely that is something at my window lattice;" + + "Let me see then, what thereat is, and this mystery explore -" + + "Let my heart be still a moment and this mystery explore; -" + + "'Tis the wind and nothing more!'" + + "\n" + + "Open here I flung the shutter, when, with many a flirt and flutter," + + "In there stepped a stately raven of the saintly days of yore." + + "Not the least obeisance made he; not a minute stopped or stayed he;" + + "But, with mien of lord or lady, perched above my chamber door -" + + "Perched upon a bust of Pallas just above my chamber door -" + + "Perched, and sat, and nothing more." + + "\n" + + "Then this ebony bird beguiling my sad fancy into smiling," + + "By the grave and stern decorum of the countenance it wore," + + "`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven." + + "Ghastly grim and ancient raven wandering from the nightly shore -" + + "Tell me what thy lordly name is on the Night's Plutonian shore!'" + + "Quoth the raven, `Nevermore.'" + + "-n" + + "Much I marvelled this ungainly fowl to hear discourse so plainly," + + "Though its answer little meaning - little relevancy bore;" + + "For we cannot help agreeing that no living human being" + + "Ever yet was blessed with seeing bird above his chamber door -" + + "Bird or beast above the sculptured bust above his chamber door," + + "With such name as `Nevermore.'" + + "\n" + + "But the raven, sitting lonely on the placid bust, spoke only," + + "That one word, as if his soul in that one word he did outpour." + + "Nothing further then he uttered - not a feather then he fluttered -" + + "Till I scarcely more than muttered `Other friends have flown before -" + + "On the morrow he will leave me, as my hopes have flown before.'" + + "Then the bird said, `Nevermore.'" + + "\n" + + "Startled at the stillness broken by reply so aptly spoken," + + "`Doubtless,' said I, `what it utters is its only stock and store," + + "Caught from some unhappy master whom unmerciful disaster" + + "Followed fast and followed faster till his songs one burden bore -" + + "Till the dirges of his hope that melancholy burden bore" + + "Of \"Never-nevermore.\"'" + + "\n" + + "But the raven still beguiling all my sad soul into smiling," + + "Straight I wheeled a cushioned seat in front of bird and bust and door;" + + "Then, upon the velvet sinking, I betook myself to linking" + + "Fancy unto fancy, thinking what this ominous bird of yore -" + + "What this grim, ungainly, ghastly, gaunt, and ominous bird of yore" + + "Meant in croaking `Nevermore.'" + + "\n" + + "This I sat engaged in guessing, but no syllable expressing" + + "To the fowl whose fiery eyes now burned into my bosom's core;" + + "This and more I sat divining, with my head at ease reclining" + + "On the cushion's velvet lining that the lamp-light gloated o'er," + + "But whose velvet violet lining with the lamp-light gloating o'er," + + "She shall press, ah, nevermore!" + + "\n" + + "Then, methought, the air grew denser, perfumed from an unseen censer" + + "Swung by Seraphim whose foot-falls tinkled on the tufted floor." + + "`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee" + + "Respite - respite and nepenthe from thy memories of Lenore!" + + "Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -" + + "Whether tempter sent, or whether tempest tossed thee here ashore," + + "Desolate yet all undaunted, on this desert land enchanted -" + + "On this home by horror haunted - tell me truly, I implore -" + + "Is there - is there balm in Gilead? - tell me - tell me, I implore!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!" + + "By that Heaven that bends above us - by that God we both adore -" + + "Tell this soul with sorrow laden if, within the distant Aidenn," + + "It shall clasp a sainted maiden whom the angels named Lenore -" + + "Clasp a rare and radiant maiden, whom the angels named Lenore?'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -" + + "`Get thee back into the tempest and the Night's Plutonian shore!" + + "Leave no black plume as a token of that lie thy soul hath spoken!" + + "Leave my loneliness unbroken! - quit the bust above my door!" + + "Take thy beak from out my heart, and take thy form from off my door!'" + + "Quoth the raven, `Nevermore.'" + + "\n" + + "And the raven, never flitting, still is sitting, still is sitting" + + "On the pallid bust of Pallas just above my chamber door;" + + "And his eyes have all the seeming of a demon's that is dreaming," + + "And the lamp-light o'er him streaming throws his shadow on the floor;" + + "And my soul from out that shadow that lies floating on the floor" + + "Shall be lifted - nevermore!" + +ALL_THE_HOPELESS_MORE=18; + +__re = /([Nn]?ever|([Nn]othing\s{1,}))more/g; +__matched=0; + +do{ + __executed = __re.exec(__the__raven); + if (__executed !== null) { + __matched++; + } else { + break; + } +}while(1); + +//CHECK#1 +if (__matched !== ALL_THE_HOPELESS_MORE) { + $ERROR('#1: __re = /([Nn]?ever|([Nn]othing\\s{1,}))more/g; __executed = __re.exec(__the__raven)'+__matched); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T5.js new file mode 100644 index 000000000..7cbe3e886 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T5.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.10.6.2_A3_T5; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /\d+/g and tested string is "123 456 789"; +*/ + +__re = /\d+/g; + +__matched = []; + +__expected = ["123","456","789"]; + +do{ + __executed = __re.exec("123 456 789"); + if (__executed !== null) { + __matched.push(__executed[0]); + } else { + break; + } +}while(true); + +//CHECK#1 +if (__expected.length !== __matched.length) { + $ERROR('#1: __executed = /\\d+/g.exec("123 456 789"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length)); +} + +//CHECK#2 +for(var index=0; index<__expected.length; index++) { + if (__expected[index] !== __matched[index]) { + $ERROR('#2: __executed = /\\d+/g.exec("123 456 789"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T6.js new file mode 100644 index 000000000..0a4d1aa74 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T6.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.10.6.2_A3_T6; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /(\d+)/g and tested string is "123 456 789"; +*/ + +__re = /(\d+)/g; + +__matched = []; + +__expected = ["123","456","789"]; + +do{ + __executed = __re.exec("123 456 789"); + if (__executed !== null) { + __matched.push(__executed[0]); + } else { + break; + } +}while(true); + +//CHECK#1 +if (__expected.length !== __matched.length) { + $ERROR('#1: __executed = /(\\d+)/g.exec("123 456 789"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length)); +} + +//CHECK#2 +for(var index=0; index<__expected.length; index++) { + if (__expected[index] !== __matched[index]) { + $ERROR('#2: __executed = /(\\d+)/g.exec("123 456 789"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T7.js new file mode 100644 index 000000000..ab1fc2e61 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A3_T7.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.10.6.2_A3_T7; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true and lastIndex not changed manually, +* next exec calling start to match from position where current match finished; +* @description: RegExp is /\d+/ and tested string is "123 456 789"; +*/ + +__re = /\d+/; + +__matched = []; + +__expected = ["123","123","123","123","123","123","123","123","123","123"]; + +do{ + __executed = __re.exec("123 456 789"); + if (__executed !== null) { + __matched.push(__executed[0]); + } else { + break; + } +}while(__matched.length<10); + +//CHECK#1 +if (__expected.length !== __matched.length) { + $ERROR('#1: __executed = /\\d+/.exec("123 456 789"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length)); +} + +//CHECK#2 +for(var index=0; index<__expected.length; index++) { + if (__expected[index] !== __matched[index]) { + $ERROR('#2: __executed = /\\d+/.exec("123 456 789"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T1.js new file mode 100644 index 000000000..c91f2bc4e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T1.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T1; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = 12 and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = 12; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["ab4"]; +__expected.index = 17; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = 12; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = 12; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = 12; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = 12; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T10.js new file mode 100644 index 000000000..3c9518077 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T10.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T10; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = {valueOf:function(){return 12;}} and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__obj = {valueOf:function(){return 12;}}; + +__re.lastIndex = __obj; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["ab4"]; +__expected.index = 17; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __obj = {valueOf:function(){return 12;}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __obj = {valueOf:function(){return 12;}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __obj = {valueOf:function(){return 12;}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __obj = {valueOf:function(){return 12;}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T11.js new file mode 100644 index 000000000..cbea13abe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T11.js @@ -0,0 +1,54 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T11; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = {valueOf:function(){throw "intoint";}} and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__obj = {valueOf:function(){throw "intoint";}}; + +__re.lastIndex = __obj; + +//CHECK#5 +try { + $FAIL('#5.1: __obj = {valueOf:function(){throw "intoint";}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42") throw "intoint". Actual: ' + (__re.exec("aacd2233ab12nm444ab42"))); +} catch (e) { + if (e !== "intoint") { + $ERROR('#5.2: __obj = {valueOf:function(){throw "intoint";}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42") throw "intoint". Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T12.js new file mode 100644 index 000000000..e5b58be2f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T12.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T12; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = {toString:function(){return 12;},valueOf:function(){return {};}} and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__obj = {toString:function(){return 12;},valueOf:function(){return {};}}; + +__re.lastIndex = __obj; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["ab4"]; +__expected.index = 17; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __obj = {toString:function(){return 12;},valueOf:function(){return {};}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __obj = {toString:function(){return 12;},valueOf:function(){return {};}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __obj = {toString:function(){return 12;},valueOf:function(){return {};}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __obj = {toString:function(){return 12;},valueOf:function(){return {};}}; __re.lastIndex = __obj; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T2.js new file mode 100644 index 000000000..25a041f3e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T2.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T2; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = undefined and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = undefined; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = undefined; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = undefined; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = undefined; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = undefined; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T3.js new file mode 100644 index 000000000..f93b57564 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T3.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T3; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = void 0 and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = void 0; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = void 0; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = void 0; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = void 0; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = void 0; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T4.js new file mode 100644 index 000000000..d2824aa71 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T4.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T4; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = null and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = null; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = null; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = null; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = null; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = null; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T5.js new file mode 100644 index 000000000..9054cf291 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T5.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.10.6.2_A4_T5; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = x and again call exec, where x is undefined variable; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = x; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = x; __executed = __re.exec("aacd2233ab12nm444ab42"); var x; __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = x; __executed = __re.exec("aacd2233ab12nm444ab42"); var x; __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = x; __executed = __re.exec("aacd2233ab12nm444ab42"); var x; __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = x; __executed = __re.exec("aacd2233ab12nm444ab42"); var x; __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T6.js new file mode 100644 index 000000000..dc40ae963 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T6.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T6; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = false and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = false; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = false; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = false; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = false; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = false; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T7.js new file mode 100644 index 000000000..c7b044294 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T7.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T7; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = Math.NaN and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = Math.NaN; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = Math.NaN; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = Math.NaN; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = Math.NaN; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; re.lastIndex = Math.NaN; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T8.js new file mode 100644 index 000000000..433dfb13d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T8.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T8; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = "12" and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = "12"; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["ab4"]; +__expected.index = 17; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "12"; __executed = __re.exec("aacd2233ab12nm444ab42");__executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "12"; __executed = __re.exec("aacd2233ab12nm444ab42");__executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "12"; __executed = __re.exec("aacd2233ab12nm444ab42");__executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "12"; __executed = __re.exec("aacd2233ab12nm444ab42");__executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T9.js new file mode 100644 index 000000000..ca153da19 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A4_T9.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A4_T9; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* If global is true next exec calling start to match from lastIndex position; +* @description: Call first exec, then set re.lastIndex = "eleven" and again call exec; +*/ + +__re = /(?:ab|cd)\d?/g; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__re.lastIndex = "eleven"; + +__executed = __re.exec("aacd2233ab12nm444ab42"); + +__expected = ["cd2"]; +__expected.index = 2; +__expected.input = "aacd2233ab12nm444ab42"; + +//CHECK#5 +if (__executed.length !== __expected.length) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "eleven"; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#6 +if (__executed.index !== __expected.index) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "eleven"; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#7 +if (__executed.input !== __expected.input) { + $ERROR('#7: __re = /(?:ab|cd)\\d?/g; __re.lastIndex = "eleven"; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#8 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#8: __re = /(?:ab|cd)\\d?/g;__re.lastIndex = "eleven"; __executed = __re.exec("aacd2233ab12nm444ab42"); __executed = __re.exec("aacd2233ab12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T1.js new file mode 100644 index 000000000..67590bf06 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T1.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.10.6.2_A5_T1; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* Let global is true and let I = If ToInteger(lastIndex). +* Then if I<0 orI>length then set lastIndex to 0 and return null; +* @description: First call /(?:ab|cd)\d?/g.exec("aac1dz2233a1bz12nm444ab42"), and then First call /(?:ab|cd)\d?/g.exec("aacd22"); +*/ + +__re = /(?:ab|cd)\d?/g; +__executed = __re.exec("aac1dz2233a1bz12nm444ab42"); + +__expected = ["ab4"]; +__expected.index = 21; +__expected.input = "aac1dz2233a1bz12nm444ab42"; + +//CHECK#1 +if (__executed.length !== __expected.length) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aac1dz2233a1bz12nm444ab42"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aac1dz2233a1bz12nm444ab42"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aac1dz2233a1bz12nm444ab42"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aac1dz2233a1bz12nm444ab42"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } +} + +__executed = __re.exec("aacd22"); + +//CHECK#5 +if (__executed) { + $ERROR('#5: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd22"); __executed === true'); +} + +//CHECK#6 +if (__re.lastIndex !== 0) { + $ERROR('#6: __re = /(?:ab|cd)\\d?/g; __executed = __re.exec("aacd22"); __re.lastIndex === 0. Actual: ' + (__re.lastIndex)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T2.js new file mode 100644 index 000000000..e2ef32757 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A5_T2; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* Let global is true and let I = If ToInteger(lastIndex). +* Then if I<0 orI>length then set lastIndex to 0 and return null; +* @description: Set lastIndex to 100 and call /(?:ab|cd)\d?/g.exec("aacd22 "); +*/ + +__re = /(?:ab|cd)\d?/g; +__re.lastIndex=100; +__executed = __re.exec("aacd22 "); + +//CHECK#1 +if (__executed) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=100; __executed = __re.exec("aacd22 "); __executed === true'); +} + +//CHECK#2 +if (__re.lastIndex !== 0) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=100; __executed = __re.exec("aacd22 "); __re.lastIndex === 0. Actual: ' + (__re.lastIndex)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T3.js new file mode 100644 index 000000000..303eaec8c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A5_T3.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.10.6.2_A5_T3; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec behavior depends on global property. +* Let global is true and let I = If ToInteger(lastIndex). +* Then if I<0 orI>length then set lastIndex to 0 and return null; +* @description: Set lastIndex to -1 and call /(?:ab|cd)\d?/g.exec("aacd22 "); +*/ + +__re = /(?:ab|cd)\d?/g; +__re.lastIndex=-1; +__executed = __re.test("aacd22 "); + +//CHECK#1 +if (__executed) { + $ERROR('#1: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __executed === true'); +} + +//CHECK#2 +if (__re.lastIndex !== 0) { + $ERROR('#2: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex === 0. Actual: ' + (__re.lastIndex)); +} + +__re.lastIndex=-100; +__executed = __re.test("aacd22 "); + +//CHECK#3 +if (__executed) { + $ERROR('#3: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __executed === true'); +} + +//CHECK#4 +if (__re.lastIndex !== 0) { + $ERROR('#4: __re = /(?:ab|cd)\\d?/g; __re.lastIndex=-1; __executed = __re.test("aacd22 "); __re.lastIndex=-100; __executed = __re.test("aacd22 "); __re.lastIndex === 0. Actual: ' + (__re.lastIndex)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A6.js new file mode 100644 index 000000000..f905c43df --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.2_A6; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec has not prototype property; +* @description: Checking RegExp.prototype.exec.prototype; +*/ + +//CHECK#1 +if (RegExp.prototype.exec.prototype !== undefined) { + $ERROR('#1: RegExp.prototype.exec.prototype === undefined. Actual: ' + (RegExp.prototype.exec.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A7.js new file mode 100644 index 000000000..4822518c1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_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.10.6.2_A7; +* @section: 15.10.6.2, 13.2; +* @assertion: RegExp.prototype.exec can't be used as constructor; +* @description: Checking if creating the RegExp.prototype.exec object fails; +*/ + +__FACTORY = RegExp.prototype.exec; + +try { + __instance = new __FACTORY; + $ERROR('#1.1: __FACTORY = RegExp.prototype.exec throw TypeError. Actual: ' + (__instance)); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __FACTORY = RegExp.prototype.exec throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A8.js new file mode 100644 index 000000000..74a0096f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A8.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.10.6.2_A8; +* @section: 15.10.6.2; +* @assertion: The RegExp.prototype.exec.length property has the attribute DontEnum; +* @description: Checking if enumerating the RegExp.prototype.exec.length property fails; +*/ + +//CHECK#0 +if (RegExp.prototype.exec.hasOwnProperty('length') !== true) { + $ERROR('#0: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + + //CHECK#1 +if (RegExp.prototype.exec.propertyIsEnumerable('length') !== false) { + $ERROR('#1: RegExp.prototype.exec.propertyIsEnumerable(\'length\') === true'); +} + + //CHECK#2 +count=0; + +for (p in RegExp.prototype.exec){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count = 0; for (p in RegExp.prototype.exec){ if (p==="length") count++; } count === 0. Actual: ' + (count)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A9.js new file mode 100644 index 000000000..cae2ba792 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A9.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.10.6.2_A9; +* @section: 15.10.6.2; +* @assertion: The RegExp.prototype.exec.length property has the attribute DontDelete; +* @description: Checking if deleting the RegExp.prototype.exec.length property fails; +*/ + +//CHECK#0 +if ((RegExp.prototype.exec.hasOwnProperty('length') !== true)) { + $FAIL('#0: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + +//CHECK#1 +if (delete RegExp.prototype.exec.length !== false) { + $ERROR('#1: delete RegExp.prototype.exec.length === false'); +} + +//CHECK#2 +if (RegExp.prototype.exec.hasOwnProperty('length') !== true) { + $ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A10.js new file mode 100644 index 000000000..d72677af7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A10.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.10.6.3_A10; +* @section: 15.10.6.3; +* @assertion: The RegExp.prototype.test.length property has the attribute ReadOnly; +* @description: Checking if varying the RegExp.prototype.test.length property fails; +*/ + +//CHECK#1 +if (RegExp.prototype.test.hasOwnProperty('length') !== true) { + $FAIL('#1: RegExp.prototype.test.hasOwnProperty(\'length\') === true'); +} + +__obj = RegExp.prototype.test.length; + +RegExp.prototype.test.length = function(){return "shifted";}; + +//CHECK#2 +if (RegExp.prototype.test.length !== __obj) { + $ERROR('#2: __obj = RegExp.prototype.test.length; RegExp.prototype.test.length = function(){return "shifted";}; RegExp.prototype.test.length === __obj. Actual: ' + (RegExp.prototype.test.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A11.js new file mode 100644 index 000000000..89ce04c69 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A11.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.10.6.3_A11; +* @section: 15.10.6.3; +* @assertion: The length property of the test method is 1; +* @description: Checking RegExp.prototype.test.length; +*/ + +//CHECK#1 +if (RegExp.prototype.test.hasOwnProperty("length") !== true) { + $FAIL('#1: RegExp.prototype.test.hasOwnProperty(\'length\') === true'); +} + +//CHECK#2 +if (RegExp.prototype.test.length !== 1) { + $ERROR('#2: RegExp.prototype.test.length === 1. Actual: ' + (RegExp.prototype.test.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T1.js new file mode 100644 index 000000000..005cee3a6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_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.10.6.3_A1_T1; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /1|12/ and tested string is "123"; +*/ + +var __string = "123"; +__re = /1|12/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = "123";__re = /1|12/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T10.js new file mode 100644 index 000000000..6045c8dc5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T10.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.10.6.3_A1_T10; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /1|12/ and tested string is 1.01; +*/ + +var __string = 1.01; +__re = /1|12/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = 1.01;__re = /1|12/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T11.js new file mode 100644 index 000000000..9e2071d62 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T11.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.10.6.3_A1_T11; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /2|12/ and tested string is new Number(1.012); +*/ + +var __string = new Number(1.012); +__re = /2|12/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = new Number(1.012); __re = /2|12/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T12.js new file mode 100644 index 000000000..1340fbc0e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T12.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.10.6.3_A1_T12; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /\.14/ and tested string is {toString:function(){return Math.PI;}}; +*/ + +var __string = {toString:function(){return Math.PI;}}; +__re = /\.14/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = {toString:function(){return Math.PI;}}; __re = /\\.14/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T13.js new file mode 100644 index 000000000..5f392d5f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T13.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.10.6.3_A1_T13; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /t[a-b|q-s]/ and tested string is true; +*/ + +var __string = true; +__re = /t[a-b|q-s]/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = true;__re = /t[a-b|q-s]/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T14.js new file mode 100644 index 000000000..a400faaa8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A1_T14; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /AL|se/ and tested string is new Boolean; +*/ + +var __string = new Boolean; +__re = /AL|se/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = new Boolean;__re = /AL|se/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T15.js new file mode 100644 index 000000000..c5ca321b9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T15.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.10.6.3_A1_T15; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /LS/i and tested string is {toString:function(){return false;}}; +*/ + +var __string = {toString:function(){return false;}}; +__re = /LS/i; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = {toString:function(){return false;}}; __re = /LS/i; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T16.js new file mode 100644 index 000000000..40e009004 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T16.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.10.6.3_A1_T16; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /undefined/ and call test() without arguments; +*/ + +__re = /undefined/; + +//CHECK#0 +if (__re.test() !== (__re.exec() !== null)) { + $ERROR('#0: __re = /undefined/; __re.test() === (__re.exec() !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T17.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T17.js new file mode 100644 index 000000000..6e913cfbc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T17.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.10.6.3_A1_T17; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /ll|l/ and tested string is null; +*/ + +__re = /ll|l/; + +//CHECK#0 +if (__re.test(null) !== (__re.exec(null) !== null)) { + $ERROR('#0: __re = /ll|l/; __re.test(null) === (__re.exec(null) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T18.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T18.js new file mode 100644 index 000000000..4a1f93627 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T18.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.10.6.3_A1_T18; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /nd|ne/ and tested string is undefined; +*/ + +__re = /nd|ne/; + +//CHECK#0 +if (__re.test(undefined) !== (__re.exec(undefined) !== null)) { + $ERROR('#0: __re = /nd|ne/; __re.test(undefined) === (__re.exec(undefined) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T19.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T19.js new file mode 100644 index 000000000..8e3ace689 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T19.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.10.6.3_A1_T19; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /e{1}/ and tested string is void 0; +*/ + +__re = /e{1}/; + +//CHECK#0 +if (__re.test(void 0) !== (__re.exec(void 0) !== null)) { + $ERROR('#0: __re = /e{1}/; __re.test(void 0) === (__re.exec(void 0) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T2.js new file mode 100644 index 000000000..491612846 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T2.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.3_A1_T2; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /((1)|(12))((3)|(23))/ and tested string is new String("123"); +*/ + +var __string = new String("123"); +__re = /((1)|(12))((3)|(23))/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = new String("123"); __re = /((1)|(12))((3)|(23))/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T20.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T20.js new file mode 100644 index 000000000..e44ff4ebf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T20.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.10.6.3_A1_T20; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /[a-f]d/ and tested string is x, where x is undefined; +*/ + +__re = /[a-f]d/; + +//CHECK#0 +if (__re.test(x) !== (__re.exec(x) !== null)) { + $ERROR('#0: __re = /[a-f]d/; __re.test(x) === (__re.exec(x) !== null); var x;'); +} + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T21.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T21.js new file mode 100644 index 000000000..d087b8364 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T21.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.10.6.3_A1_T21; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /[a-z]n/ and tested string is x, where x is function(){}(); +*/ + +__re = /[a-z]n/; + +//CHECK#0 +if (__re.test(function(){}()) !== (__re.exec(function(){}()) !== null)) { + $ERROR('#0: __re = /[a-z]n/; __re.test(function(){}()) === (__re.exec(function(){}()) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T3.js new file mode 100644 index 000000000..2e274f612 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.3_A1_T3; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /a[a-z]{2,4}/ and tested string is new Object("abcdefghi"); +*/ + +var __string = new Object("abcdefghi"); +__re = /a[a-z]{2,4}/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = new Object("abcdefghi"); __re = /a[a-z]{2,4}/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T4.js new file mode 100644 index 000000000..3b12567df --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A1_T4; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /a[a-z]{2,4}?/ and tested string is {toString:function(){return "abcdefghi";}}; +*/ + +var __string = {toString:function(){return "abcdefghi";}}; +__re = /a[a-z]{2,4}?/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = {toString:function(){return "abcdefghi";}}; __re = /a[a-z]{2,4}?/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T5.js new file mode 100644 index 000000000..799da0bc1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A1_T5; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /(aa|aabaac|ba|b|c)* / and tested string is {toString:function(){return {};}, valueOf:function(){return "aabaac";}}; +*/ + +var __string = {toString:function(){return {};}, valueOf:function(){return "aabaac";}}; +__re = /(aa|aabaac|ba|b|c)*/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string = {toString:function(){return {};}, valueOf:function(){return "aabaac";}}; __re = /(aa|aabaac|ba|b|c)*/; __re.test(__string) === (__re.exec(__string) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T6.js new file mode 100644 index 000000000..191ab545b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T6.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.10.6.3_A1_T6; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /(z)((a+)?(b+)?(c))* / and tested string is (function(){return "zaacbbbcac"})(); +*/ + +__re = /(z)((a+)?(b+)?(c))*/; + +//CHECK#0 +if (__re.test((function(){return "zaacbbbcac"})()) !== (__re.exec((function(){return "zaacbbbcac"})()) !== null)) { + $ERROR('#0: __re = /(z)((a+)?(b+)?(c))*/; __re.test((function(){return "zaacbbbcac"})()) === (__re.exec((function(){return "zaacbbbcac"})()) !== null)'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T7.js new file mode 100644 index 000000000..fe26935bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A1_T7; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /[a-z]/ and tested string is {toString:function(){throw "intostr";}}; +*/ + +//CHECK#1 +try { + $ERROR('#1.1: /[a-z]/.test({toString:function(){throw "intostr";}}) throw "intostr". Actual: ' + (/[a-z]/.test({toString:function(){throw "intostr";}}))); +} catch (e) { + if (e !== "intostr") { + $ERROR('#1.2: /[a-z]/.test({toString:function(){throw "intostr";}}) throw "intostr". Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T8.js new file mode 100644 index 000000000..dfdb75acf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A1_T8; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /[a-z]/ and tested string is {toString:void 0, valueOf:function(){throw "invalof";}}; +*/ + +//CHECK#1 +try { + $ERROR('#1.1: /[a-z]/.test({toString:void 0, valueOf:function(){throw "invalof";}}) throw "invalof". Actual: ' + (/[a-z]/.test({toString:void 0, valueOf:function(){throw "invalof";}}))); +} catch (e) { + if (e !== "invalof") { + $ERROR('#1.2: /[a-z]/.test({toString:void 0, valueOf:function(){throw "invalof";}}) throw "invalof". Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_T9.js new file mode 100644 index 000000000..c9cdcdffe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A1_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.10.6.3_A1_T9; +* @section: 15.10.6.3; +* @assertion: Equivalent to the expression RegExp.prototype.exec(string) != null; +* @description: RegExp is /1|12/ and tested string is function object; +*/ + +var __string; +__re = /1|12/; + +//CHECK#0 +if (__re.test(__string) !== (__re.exec(__string) !== null)) { + $ERROR('#0: var __string;__re = /1|12/; __re.test(__string) === (__re.exec(__string) !== null); function __string(){};'); +} + +function __string(){}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T1.js new file mode 100644 index 000000000..17e2c3ad6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.3_A2_T1; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new Object; +*/ + +__instance = new Object; + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = new Object; __instance.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (__instance.test("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new Object; __instance.test = RegExp.prototype.test. Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T10.js new file mode 100644 index 000000000..cca9b9113 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_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.10.6.3_A2_T10; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is undefined; +*/ + +test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (test("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T2.js new file mode 100644 index 000000000..69a6328e3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T2.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.10.6.3_A2_T2; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is Math; +*/ + +__instance = Math; + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +try { + with(__instance) test("message to investigate"); + $ERROR('#1.1: __instance = Math; __instance.test = RegExp.prototype.test; with(__instance) test("message to investigate")'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = Math; __instance.test = RegExp.prototype.test; with(__instance) test("message to investigate"). Actual: ' + (e)); + } +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T3.js new file mode 100644 index 000000000..0e52174ca --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T3.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.10.6.3_A2_T3; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is function object; +*/ + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +try { + with(__instance) test("message to investigate"); + $ERROR('#1.1: __instance.test = RegExp.prototype.test; with(__instance) test("message to investigate"); function __instance(){}'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance.test = RegExp.prototype.test; with(__instance) test("message to investigate"); function __instance(){}. Actual: ' + (e)); + } +} + +function __instance(){}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T4.js new file mode 100644 index 000000000..b613cfb54 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T4.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.10.6.3_A2_T4; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new String("[a-b]"); +*/ + +__instance = new String("[a-b]"); + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +with(__instance){ + try { + $ERROR('#1.1: __instance = new String("[a-b]"); __instance.test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (test("message to investigate"))); + } catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new String("[a-b]"); __instance.test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (e)); + } + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T5.js new file mode 100644 index 000000000..a206874a6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_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.10.6.3_A2_T5; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new Boolean(false); +*/ + +__instance = new Boolean(false); + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +with(__instance) { + try { + $ERROR('#1.1: __instance = new Boolean(false); __instance.test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (test("message to investigate"))); + } catch (e) { + if ((e instanceof TypeError !== true)) { + $ERROR('#1.2: __instance = new Boolean(false); __instance.test = RegExp.prototype.test; test("message to investigate"). Actual: ' + (e)); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T6.js new file mode 100644 index 000000000..814504691 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T6.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.10.6.3_A2_T6; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is new Number(1.0); +*/ + +__instance = new Number(1.0); + +__instance.test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = new Number(1.0); __instance.test = RegExp.prototype.test; __instance["test"]("message to investigate"). Actual: ' + (__instance["test"]("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = new Number(1.0); __instance.test = RegExp.prototype.test; __instance["test"]("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T7.js new file mode 100644 index 000000000..a6b80a5d7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T7.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.10.6.3_A2_T7; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is false; +*/ + +__instance = false; + +Object.prototype.test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = false; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (__instance.test("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = false; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (e)); + } +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T8.js new file mode 100644 index 000000000..a8abfdf01 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_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.10.6.3_A2_T8; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is "."; +*/ + +__instance = "."; + +Object.prototype.test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = "."; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (__instance.test("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = "."; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_T9.js new file mode 100644 index 000000000..e24a8cff5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A2_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.10.6.3_A2_T9; +* @section: 15.10.6.3; +* @assertion: A TypeError exception is thrown if the this value is not an object for which the value of the internal [[Class]] property is "RegExp"; +* @description: The tested object is 1.0; +*/ + +__instance = 1.0; + +Object.prototype.test = RegExp.prototype.test; + +//CHECK#1 +try { + $ERROR('#1.1: __instance = 1.0; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (__instance.test("message to investigate"))); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __instance = 1.0; Object.prototype.test = RegExp.prototype.test; __instance.test("message to investigate"). Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A6.js new file mode 100644 index 000000000..c5f4142e3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A6.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.10.6.3_A6; +* @section: 15.10.6.3, 13.2; +* @assertion: RegExp.prototype.test has not prototype property; +* @description: Checking RegExp.prototype.test.prototype; +*/ + +//CHECK#1 +if (RegExp.prototype.test.prototype !== undefined) { + $ERROR('#1: RegExp.prototype.test.prototype === undefined. Actual: ' + (RegExp.prototype.test.prototype)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A7.js new file mode 100644 index 000000000..d9ee8d94a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_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.10.6.3_A7; +* @section: 15.10.6.3, 13.2; +* @assertion: RegExp.prototype.test can't be used as constructor; +* @description: Checking if creating the RegExp.prototype.test object fails; +*/ + +__FACTORY = RegExp.prototype.test; + +try { + __instance = new __FACTORY; + $ERROR('#1.1: __FACTORY = RegExp.prototype.test throw TypeError. Actual: ' + (__instance)); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __FACTORY = RegExp.prototype.test throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A8.js new file mode 100644 index 000000000..cfdbc36da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A8.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.10.6.3_A8; +* @section: 15.10.6.3; +* @assertion: The RegExp.prototype.test.length property has the attribute DontEnum; +* @description: Checking if enumerating the RegExp.prototype.test.length property fails; +*/ + +//CHECK#0 +if (RegExp.prototype.test.hasOwnProperty('length') !== true) { + $ERROR('#0: RegExp.prototype.test.hasOwnProperty(\'length\') === true'); +} + + //CHECK#1 +if (RegExp.prototype.test.propertyIsEnumerable('length') !== false) { + $ERROR('#1: RegExp.prototype.test.propertyIsEnumerable(\'length\') === true'); +} + + //CHECK#2 +count=0; + +for (p in RegExp.prototype.test){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count = 0; for (p in RegExp.prototype.test){ if (p==="length") count++; } count === 0. Actual: ' + (count)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A9.js new file mode 100644 index 000000000..3477fdcba --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.3_RegExp.prototype.test/S15.10.6.3_A9.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.10.6.3_A9; +* @section: 15.10.6.3; +* @assertion: The RegExp.prototype.test.length property has the attribute DontDelete; +* @description: Checking if deleting RegExp.prototype.test.length property fails; +*/ + +//CHECK#0 +if ((RegExp.prototype.exec.hasOwnProperty('length') !== true)) { + $FAIL('#0: RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + +//CHECK#1 +if (delete RegExp.prototype.exec.length !== false) { + $ERROR('#1: delete RegExp.prototype.exec.length === false'); +} + +//CHECK#2 +if (RegExp.prototype.exec.hasOwnProperty('length') !== true) { + $ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A10.js new file mode 100644 index 000000000..4266de6fe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A10.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.10.6.4_A10; +* @section: 15.10.6.4; +* @assertion: The RegExp.prototype.toString.length property has the attribute ReadOnly; +* @description: Checking if varying the RegExp.prototype.toString.length property fails; +*/ + +//CHECK#1 +if (RegExp.prototype.toString.hasOwnProperty('length') !== true) { + $FAIL('#1: RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); +} + +__obj = RegExp.prototype.toString.length; + +RegExp.prototype.toString.length = function(){return "shifted";}; + +//CHECK#2 +if (RegExp.prototype.toString.length !== __obj) { + $ERROR('#2: __obj = RegExp.prototype.toString.length; RegExp.prototype.toString.length = function(){return "shifted";}; RegExp.prototype.toString.length === __obj. Actual: ' + (RegExp.prototype.toString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A11.js new file mode 100644 index 000000000..0f65014b4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A11.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.10.6.4_A11; +* @section: 15.10.6.4; +* @assertion: The length property of the toString method is 1; +* @description: Checking RegExp.prototype.toString.length; +*/ + +//CHECK#1 +if (RegExp.prototype.toString.hasOwnProperty("length") !== true) { + $FAIL('#1: RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); +} + +//CHECK#2 +if (RegExp.prototype.toString.length !== 0) { + $ERROR('#2: RegExp.prototype.toString.length === 0. Actual: ' + (RegExp.prototype.toString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A6.js new file mode 100644 index 000000000..d518db871 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A6.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.10.6.4_A6; +* @section: 15.10.6.4, 13.2; +* @assertion: RegExp.prototype.toString has not prototype property; +* @description: Checking RegExp.prototype.toString.prototype; +*/ + +//CHECK#1 +if (RegExp.prototype.toString.prototype !== undefined) { + $ERROR('#1: RegExp.prototype.toString.prototype === undefined. Actual: ' + (RegExp.prototype.toString.prototype)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A7.js new file mode 100644 index 000000000..fa28c6723 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.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.10.6.4_A7; +* @section: 15.10.6.4, 13.2; +* @assertion: RegExp.prototype.toString can't be used as constructor; +* @description: Checking if creating the RegExp.prototype.toString object fails; +*/ + +__FACTORY = RegExp.prototype.toString; + +try { + __instance = new __FACTORY; + $ERROR('#1.1: __FACTORY = RegExp.prototype.toString throw TypeError. Actual: ' + (__instance)); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: __FACTORY = RegExp.prototype.toString throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A8.js new file mode 100644 index 000000000..bdbeff72e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A8.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.10.6.4_A8; +* @section: 15.10.6.4; +* @assertion: The RegExp.prototype.toString.length property has the attribute DontEnum; +* @description: Checking if enumerating the RegExp.prototype.toString.length property fails; +*/ + +//CHECK#0 +if (RegExp.prototype.toString.hasOwnProperty('length') !== true) { + $ERROR('#0: RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); +} + + //CHECK#1 +if (RegExp.prototype.toString.propertyIsEnumerable('length') !== false) { + $ERROR('#1: RegExp.prototype.toString.propertyIsEnumerable(\'length\') === true'); +} + + //CHECK#2 +count=0; + +for (p in RegExp.prototype.toString){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count = 0; for (p in RegExp.prototype.toString){ if (p==="length") count++; } count === 0. Actual: ' + (count)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A9.js new file mode 100644 index 000000000..cdeda5c89 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.4_RegExp.prototype.toString/S15.10.6.4_A9.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.10.6.4_A9; +* @section: 15.10.6.4; +* @assertion: The RegExp.prototype.toString.length property has the attribute DontDelete; +* @description: Checking if deleting the RegExp.prototype.toString.length property fails; +*/ + +//CHECK#0 +if ((RegExp.prototype.toString.hasOwnProperty('length') !== true)) { + $FAIL('#0: RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); +} + +//CHECK#1 +if (delete RegExp.prototype.toString.length !== false) { + $ERROR('#1: delete RegExp.prototype.toString.length === false'); +} + +//CHECK#2 +if (RegExp.prototype.toString.hasOwnProperty('length') !== true) { + $ERROR('#2: delete RegExp.prototype.toString.length; RegExp.prototype.toString.hasOwnProperty(\'length\') === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_T1.js new file mode 100644 index 000000000..048cf51d7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_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.10.6.1_A1_T1; +* @section: 15.10.6.1; +* @assertion: The initial value of RegExp.prototype.constructor is the built-in RegExp constructor; +* @description: Compare RegExp.prototype.constructor with RegExp; +*/ + +//CHECK#1 +if (RegExp.prototype.constructor !== RegExp) { + $ERROR('#1: RegExp.prototype.constructor === RegExp. Actual: ' + (RegExp.prototype.constructor)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_T2.js new file mode 100644 index 000000000..4b315d510 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6.1_A1_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.10.6.1_A1_T2; +* @section: 15.10.6.1; +* @assertion: The initial value of RegExp.prototype.constructor is the built-in RegExp constructor; +* @description: Compare instance.constructor !== RegExp, where instance is new RegExp.prototype.constructor; +*/ + +__FACTORY = RegExp.prototype.constructor; + +__instance = new __FACTORY; + +//CHECK#1 +if ((__instance instanceof RegExp) !== true) { + $ERROR('#1: __FACTORY = RegExp.prototype.constructor; __instance = new __FACTORY; (__instance instanceof RegExp) === true'); +} + +//CHECK#2 +if (__instance.constructor !== RegExp) { + $ERROR('#2: __FACTORY = RegExp.prototype.constructor; __instance = new __FACTORY; __instance.constructor === RegExp. Actual: ' + (__instance.constructor)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_T1.js new file mode 100644 index 000000000..10ed97f3b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_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.10.6_A1_T1; +* @section: 15.10.6; +* @assertion: The value of the internal [[Prototype]] property of the RegExp prototype object is the Object prototype; +* @description: Checking Object.prototype.isPrototypeOf(RegExp.prototype); +*/ + +//CHECK#1 +if (Object.prototype.isPrototypeOf(RegExp.prototype) !== true) { + $ERROR('#1: Object.prototype.isPrototypeOf(RegExp.prototype) === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_T2.js new file mode 100644 index 000000000..8ea1ce280 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A1_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.10.6_A1_T2; +* @section: 15.10.6; +* @assertion: The value of the internal [[Prototype]] property of the RegExp prototype object is the Object prototype; +* @description: Add new property to Object.prototype and check it of RegExp.prototype; +*/ + +Object.prototype.indicator = 1; + +//CHECK#1 +if (RegExp.prototype.indicator !== 1) { + $ERROR('#1: Object.prototype.indicator = 1; RegExp.prototype.indicator === 1. Actual: ' + (RegExp.prototype.indicator)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A2.js new file mode 100644 index 000000000..a165443ae --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/S15.10.6_A2.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.10.6_A2; +* @section: 15.10.6; +* @assertion: The value of the internal [[Class]] property of the RegExp prototype object is "Object"; +* @description: Checking performs with toString function; +*/ + +RegExp.prototype.toString = Object.prototype.toString; + +//CHECK#1 +if (RegExp.prototype.toString() !== "[object " + "Object" + "]") { + $ERROR('#1: RegExp.prototype.toString = Object.prototype.toString; RegExp.prototype.toString() === "[object " + "Object" + "]". Actual: ' + RegExp.prototype.toString()); +} + |