aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json')
-rw-r--r--website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json368
1 files changed, 368 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json b/website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json
new file mode 100644
index 000000000..25211d20c
--- /dev/null
+++ b/website/resources/scripts/testcases2/15.10.6.2_RegExp.prototype.exec.json
@@ -0,0 +1,368 @@
+{
+ "testCollection": {
+ "name": "15.10.6.2_RegExp.prototype.exec",
+ "numTests": 60,
+ "tests": [
+ {
+ "section": "15.10.6.2",
+ "description": "Checking if varying the RegExp.prototype.exec.length property fails",
+ "test": "//CHECK#1\nif (RegExp.prototype.exec.hasOwnProperty('length') !== true) {\n $FAIL('#1: RegExp.prototype.exec.hasOwnProperty(\\'length\\') === true');\n}\n\n__obj = RegExp.prototype.exec.length;\n\nRegExp.prototype.exec.length = function(){return \"shifted\";};\n\n//CHECK#2\nif (RegExp.prototype.exec.length !== __obj) {\n $ERROR('#2: __obj = RegExp.prototype.exec.length; RegExp.prototype.exec.length = function(){return \"shifted\";}; RegExp.prototype.exec.length === __obj. Actual: ' + (RegExp.prototype.exec.length));\n}\n",
+ "id": "S15.10.6.2_A10"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "Checking RegExp.prototype.exec.length",
+ "test": "//CHECK#1\nif (RegExp.prototype.exec.hasOwnProperty(\"length\") !== true) {\n $FAIL('#1: RegExp.prototype.exec.hasOwnProperty(\\'length\\') === true');\n}\n\n//CHECK#2\nif (RegExp.prototype.exec.length !== 1) {\n $ERROR('#2: RegExp.prototype.exec.length === 1. Actual: ' + (RegExp.prototype.exec.length));\n}\n\n",
+ "id": "S15.10.6.2_A11"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "Checking RegExp.prototype.exec",
+ "test": "(/foo/).test('xfoox');\nvar match = new RegExp('(.|\\r|\\n)*','').exec()[0];\nif (match === 'xfoox') {\n $FAIL('#1: regExp.exec() leaks match globally');\n}\nif (match !== 'undefined') {\n $FAIL('#2: regExp.exec() must coerce absent first arg to \"undefined\"');\n}\n",
+ "id": "S15.10.6.2_A12"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is \"123\" and RegExp is /1|12/",
+ "test": "__executed = /1|12/.exec(\"123\");\n\n__expected = [\"1\"];\n__expected.index=0;\n__expected.input=\"123\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /1|12/.exec(\"123\"); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /1|12/.exec(\"123\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /1|12/.exec(\"123\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /1|12/.exec(\"123\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /1|12/.exec(\"123\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T1"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is 1.01 and RegExp is /1|12/",
+ "test": "__executed = /1|12/.exec(1.01);\n\n__expected = [\"1\"];\n__expected.index=0;\n__expected.input=\"1.01\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /1|12/.exec(1.01); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /1|12/.exec(1.01); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /1|12/.exec(1.01); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /1|12/.exec(1.01); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /1|12/.exec(1.01); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T10"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is new Number(1.012) and RegExp is /2|12/",
+ "test": "__executed = /2|12/.exec(new Number(1.012));\n\n__expected = [\"12\"];\n__expected.index=3;\n__expected.input=\"1.012\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /2|12/.exec(new Number(1.012)); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /2|12/.exec(new Number(1.012)); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /2|12/.exec(new Number(1.012)); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /2|12/.exec(new Number(1.012)); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /2|12/.exec(new Number(1.012)); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T11"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:function(){return Math.PI;}} and RegExp is /\\.14/;",
+ "test": "__executed = /\\.14/.exec({toString:function(){return Math.PI}});\n\n__expected = [\".14\"];\n__expected.index=1;\n__expected.input=String(Math.PI);\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /\\\\.14/.exec({toString:function(){return Math.PI}}); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /\\\\.14/.exec({toString:function(){return Math.PI}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /\\\\.14/.exec({toString:function(){return Math.PI}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /\\\\.14/.exec({toString:function(){return Math.PI}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /\\\\.14/.exec({toString:function(){return Math.PI}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T12"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is true and RegExp is /t[a-b|q-s]/",
+ "test": "__executed = /t[a-b|q-s]/.exec(true);\n\n__expected = [\"tr\"];\n__expected.index=0;\n__expected.input=\"true\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /t[a-b|q-s]/.exec(true); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /t[a-b|q-s]/.exec(true); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /t[a-b|q-s]/.exec(true); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /t[a-b|q-s]/.exec(true); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /t[a-b|q-s]/.exec(true); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T13"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is new Boolean and RegExp is /AL|se/",
+ "test": "__executed = /AL|se/.exec(new Boolean);\n\n__expected = [\"se\"];\n__expected.index=3;\n__expected.input=\"false\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /AL|se/.exec(new Boolean); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /AL|se/.exec(new Boolean); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /AL|se/.exec(new Boolean); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /AL|se/.exec(new Boolean); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /AL|se/.exec(new Boolean); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T14"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:function(){return false;}} and RegExp is /LS/i;",
+ "test": "__executed = /LS/i.exec({toString:function(){return false}});\n\n__expected = [\"ls\"];\n__expected.index=2;\n__expected.input=\"false\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /LS/i.exec({toString:function(){return false}}); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /LS/i.exec({toString:function(){return false}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /LS/i.exec({toString:function(){return false}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /LS/i.exec({toString:function(){return false}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /LS/i.exec({toString:function(){return false}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T15"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "RegExp is /undefined/ and call exec() without arguments",
+ "test": "__re = /undefined/.exec()[0];\nif (__re !== \"undefined\") {\n\t$ERROR('#1: /undefined/.exec()[0] === \"undefined\". Actual: ' + (__re));\n}\n\n",
+ "id": "S15.10.6.2_A1_T16"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is null and RegExp is /ll|l/",
+ "test": "__executed = /ll|l/.exec(null);\n\n__expected = [\"ll\"];\n__expected.index=2;\n__expected.input=\"null\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /ll|l/.exec(null); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /ll|l/.exec(null); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /ll|l/.exec(null); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /ll|l/.exec(null); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /ll|l/.exec(null); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T17"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is undefined and RegExp is /nd|ne/",
+ "test": "__executed = /nd|ne/.exec(undefined);\n\n__expected = [\"nd\"];\n__expected.index=1;\n__expected.input=\"undefined\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /nd|ne/.exec(undefined); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /nd|ne/.exec(undefined); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /nd|ne/.exec(undefined); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /nd|ne/.exec(undefined); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /nd|ne/.exec(undefined); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T18"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is void 0 and RegExp is /e{1}/",
+ "test": "__executed = /e{1}/.exec(void 0);\n\n__expected = [\"e\"];\n__expected.index=3;\n__expected.input=\"undefined\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /e{1}/.exec(void 0); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /e{1}/.exec(void 0); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /e{1}/.exec(void 0); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /e{1}/.exec(void 0); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /e{1}/.exec(void 0); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T19"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is new String(\"123\") and RegExp is /((1)|(12))((3)|(23))/",
+ "test": "with(/((1)|(12))((3)|(23))/){\n __executed = exec(new String(\"123\"));\n}\n\n__expected = [\"123\", \"1\", \"1\", undefined, \"23\", undefined, \"23\"];\n__expected.index=0;\n__expected.input=\"123\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: with(/((1)|(12))((3)|(23))/){__executed = exec(new String(\"123\"));} (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: with(/((1)|(12))((3)|(23))/){__executed = exec(new String(\"123\"));} __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: with(/((1)|(12))((3)|(23))/){__executed = exec(new String(\"123\"));} __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: with(/((1)|(12))((3)|(23))/){__executed = exec(new String(\"123\"));} __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: with(/((1)|(12))((3)|(23))/){__executed = exec(new String(\"123\"));} __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T2"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is x and RegExp is /[a-f]d/, where x is undefined variable",
+ "test": "__executed = /[a-f]d/.exec(x);\n\n__expected = [\"ed\"];\n__expected.index=7;\n__expected.input=\"undefined\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /[a-f]d/.exec(x); var x; (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /[a-f]d/.exec(x); var x; __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /[a-f]d/.exec(x); var x; __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /[a-f]d/.exec(x); var x; __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /[a-f]d/.exec(x); var x; __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\nvar x;\n",
+ "id": "S15.10.6.2_A1_T20"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is function(){}() and RegExp is /[a-z]n/",
+ "test": "__executed = /[a-z]n/.exec(function(){}());\n\n__expected = [\"un\"];\n__expected.index=0;\n__expected.input=\"undefined\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /[a-z]n/.exec(function(){}()); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /[a-z]n/.exec(function(){}()); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /[a-z]n/.exec(function(){}()); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /[a-z]n/.exec(function(){}()); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /[a-z]n/.exec(function(){}()); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T21"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is new Object(\"abcdefghi\") and RegExp is /a[a-z]{2,4}/",
+ "test": "__executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\"));\n\n__expected = [\"abcde\"];\n__expected.index=0;\n__expected.input=\"abcdefghi\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\")); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\")); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\")); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\")); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /a[a-z]{2,4}/.exec(new Object(\"abcdefghi\")); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T3"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:function(){return \"abcdefghi\";}} and RegExp is /a[a-z]{2,4}?/;",
+ "test": "__executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}});\n\n__expected = [\"abc\"];\n__expected.index=0;\n__expected.input=\"abcdefghi\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}}); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /a[a-z]{2,4}?/.exec({toString:function(){return \"abcdefghi\"}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T4"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:function(){return {};}, valueOf:function(){return \"aabaac\";}} and RegExp is /(aa|aabaac|ba|b|c)* /;",
+ "test": "__executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}});\n\n__expected = [\"aaba\", \"ba\"];\n__expected.index=0;\n__expected.input=\"aabaac\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}}); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}}); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}}); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}}); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /(aa|aabaac|ba|b|c)*/.exec({toString:function(){return {};}, valueOf:function(){return \"aabaac\";}}); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T5"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is (function(){return \"zaacbbbcac\"})() and RegExp is /(z)((a+)?(b+)?(c))* /",
+ "test": "__executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})());\n\n__expected = [\"zaacbbbcac\", \"z\", \"ac\", \"a\", undefined, \"c\"];\n__expected.index=0;\n__expected.input=\"zaacbbbcac\";\n\n//CHECK#0\nif ((__executed instanceof Array) !== true) {\n\t$ERROR('#0: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})()); (__executed instanceof Array) === true');\n}\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n $ERROR('#1: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})()); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n $ERROR('#2: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})()); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n $ERROR('#3: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})()); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__executed[index] !== __expected[index]) {\n $ERROR('#4: __executed = /(z)((a+)?(b+)?(c))*/.exec((function(){return \"zaacbbbcac\"})()); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T6"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:function(){throw \"intostr\";}} and RegExp is /[a-z]/;",
+ "test": "//CHECK#1\ntry {\n\t$ERROR('#1.1: /[a-z]/.exec({toString:function(){throw \"intostr\"}}) throw \"intostr\". Actual: ' + (/[a-z]/.exec({toString:function(){throw \"intostr\"}})));\n} catch (e) {\n\tif (e !== \"intostr\") {\n\t\t$ERROR('#1.2: /[a-z]/.exec({toString:function(){throw \"intostr\"}}) throw \"intostr\". Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A1_T7"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": ": String is {toString:void 0, valueOf:function(){throw \"invalof\";}} and RegExp is /[a-z]/;",
+ "test": "//CHECK#1\ntry {\n $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\"}})));\n} catch (e) {\n if (e !== \"invalof\") {\n $ERROR('#1.2: /[a-z]/.exec({toString:void 0, valueOf:function(){throw \"invalof\"}}) throw \"invalof\". Actual: ' + (e));\n }\n}\n\n",
+ "id": "S15.10.6.2_A1_T8"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "String is undefined variable and RegExp is /1|12/",
+ "test": "var __string;\n\n//CHECK#1\n__re = /1|12/;\nif (__re.exec(__string) !== null) {\n\t$ERROR('#1: var __string; /1|12/.exec(__string) === null; function __string(){}. Actual: ' + (__re));\n}\n\nfunction __string(){};\n",
+ "id": "S15.10.6.2_A1_T9"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The internal [[Class]] property is \"Object\"",
+ "test": "__instance = new Object;\n\n__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: __instance = new Object; __instance.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (__instance.exec(\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = new Object; __instance.exec = RegExp.prototype.exec. Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T1"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is undefined",
+ "test": "exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (exec(\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T10"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is Math",
+ "test": "__instance = Math;\n\n__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry { \n with(__instance) exec(\"message to investigate\");\n\t$ERROR('#1.1: __instance = Math; __instance.exec = RegExp.prototype.exec; with(__instance) exec(\"message to investigate\")');\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = Math; __instance.exec = RegExp.prototype.exec; with(__instance) exec(\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T2"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is function object",
+ "test": "__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n with(__instance) exec(\"message to investigate\");\n\t$ERROR('#1.1: __instance.exec = RegExp.prototype.exec; with(__instance) exec(\"message to investigate\"); function __instance(){}');\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance.exec = RegExp.prototype.exec; with(__instance) exec(\"message to investigate\"); function __instance(){}. Actual: ' + (e));\n\t}\n}\n\nfunction __instance(){};\n",
+ "id": "S15.10.6.2_A2_T3"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is new String(\"[a-b]\")",
+ "test": "__instance = new String(\"[a-b]\");\n\n__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\nwith(__instance){\n try {\n \t$ERROR('#1.1: __instance = new String(\"[a-b]\"); __instance.exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (exec(\"message to investigate\")));\n } catch (e) {\n \tif ((e instanceof TypeError) !== true) {\n \t\t$ERROR('#1.2: __instance = new String(\"[a-b]\"); __instance.exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (e));\n \t}\n }\n}\n\n",
+ "id": "S15.10.6.2_A2_T4"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is new Boolean(false)",
+ "test": "__instance = new Boolean(false);\n\n__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\nwith(__instance) {\n try {\n $ERROR('#1.1: __instance = new Boolean(false); __instance.exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (exec(\"message to investigate\")));\n } catch (e) {\n if ((e instanceof TypeError !== true)) {\n $ERROR('#1.2: __instance = new Boolean(false); __instance.exec = RegExp.prototype.exec; exec(\"message to investigate\"). Actual: ' + (e));\n }\n } \n}\n\n",
+ "id": "S15.10.6.2_A2_T5"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is new Number(1.0)",
+ "test": "__instance = new Number(1.0);\n\n__instance.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: __instance = new Number(1.0); __instance.exec = RegExp.prototype.exec; __instance[\"exec\"](\"message to investigate\"). Actual: ' + (__instance[\"exec\"](\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = new Number(1.0); __instance.exec = RegExp.prototype.exec; __instance[\"exec\"](\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T6"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is false",
+ "test": "__instance = false;\n\nObject.prototype.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: __instance = false; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (__instance.exec(\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = false; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T7"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is \".\"",
+ "test": "__instance = \".\";\n\nObject.prototype.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: __instance = \".\"; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (__instance.exec(\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = \".\"; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T8"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "The tested object is 1.0",
+ "test": "__instance = 1.0;\n\nObject.prototype.exec = RegExp.prototype.exec;\n\n//CHECK#1\ntry {\n\t$ERROR('#1.1: __instance = 1.0; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (__instance.exec(\"message to investigate\")));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: __instance = 1.0; Object.prototype.exec = RegExp.prototype.exec; __instance.exec(\"message to investigate\"). Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A2_T9"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /(?:ab|cd)\\d?/g and tested string is \"ab cd2 ab34 cd\"",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__matched = [];\n\n__expected = [\"ab\", \"cd2\", \"ab3\", \"cd\"];\n\ndo{\n __executed = __re.exec(\"ab cd2 ab34 cd\");\n if (__executed !== null) {\n __matched.push(__executed[0]);\n } else {\n break;\n }\n}while(true);\n\n//CHECK#1\nif (__expected.length !== __matched.length) {\n\t$ERROR('#1: __executed = /(?:ab|cd)\\\\d?/g.exec(\"ab cd2 ab34 cd\"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length));\n}\n\n//CHECK#2\nfor(var index=0; index<__expected.length; index++) {\n\tif (__expected[index] !== __matched[index]) {\n\t\t$ERROR('#2: __executed = /(?:ab|cd)\\\\d?/g.exec(\"ab cd2 ab34 cd\"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A3_T1"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /[Nn]evermore/g and tested string is very long string",
+ "test": "__the__raven = \"\tOnce upon a midnight dreary, while I pondered weak and weary,\" +\n \"Over many a quaint and curious volume of forgotten lore,\" +\n \"While I nodded, nearly napping, suddenly there came a tapping,\" +\n \"As of some one gently rapping, rapping at my chamber door.\" +\n \"`'Tis some visitor,' I muttered, `tapping at my chamber door -\" +\n \"Only this, and nothing more.'\" +\n \"Ah, distinctly I remember it was in the bleak December,\" +\n \"And each separate dying ember wrought its ghost upon the floor.\" +\n \"Eagerly I wished the morrow; - vainly I had sought to borrow\" +\n \"From my books surcease of sorrow - sorrow for the lost Lenore -\" +\n \"For the rare and radiant maiden whom the angels named Lenore -\" +\n \"Nameless here for evermore.\" +\n \"\\n\" +\n \"And the silken sad uncertain rustling of each purple curtain\" +\n \"Thrilled me - filled me with fantastic terrors never felt before;\" +\n \"So that now, to still the beating of my heart, I stood repeating\" +\n \"`'Tis some visitor entreating entrance at my chamber door -\" +\n \"Some late visitor entreating entrance at my chamber door; -\" +\n \"This it is, and nothing more,'\" +\n \"Presently my soul grew stronger; hesitating then no longer,\" +\n \"`Sir,' said I, `or Madam, truly your forgiveness I implore;\" +\n \"But the fact is I was napping, and so gently you came rapping,\" +\n \"And so faintly you came tapping, tapping at my chamber door,\" +\n \"That I scarce was sure I heard you' - here I opened wide the door; -\" +\n \"Darkness there, and nothing more.\" +\n \"\\n\" +\n \"Deep into that darkness peering, long I stood there wondering, fearing,\" +\n \"Doubting, dreaming dreams no mortal ever dared to dream before\" +\n \"But the silence was unbroken, and the darkness gave no token,\" +\n \"And the only word there spoken was the whispered word, `Lenore!'\" +\n \"This I whispered, and an echo murmured back the word, `Lenore!'\" +\n \"Merely this and nothing more.\" +\n \"\\n\" +\n \"Back into the chamber turning, all my soul within me burning,\" +\n \"Soon again I heard a tapping somewhat louder than before.\" +\n \"`Surely,' said I, `surely that is something at my window lattice;\" +\n \"Let me see then, what thereat is, and this mystery explore -\" +\n \"Let my heart be still a moment and this mystery explore; -\" +\n \"'Tis the wind and nothing more!'\" +\n \"\\n\" +\n \"Open here I flung the shutter, when, with many a flirt and flutter,\" +\n \"In there stepped a stately raven of the saintly days of yore.\" +\n \"Not the least obeisance made he; not a minute stopped or stayed he;\" +\n \"But, with mien of lord or lady, perched above my chamber door -\" +\n \"Perched upon a bust of Pallas just above my chamber door -\" +\n \"Perched, and sat, and nothing more.\" +\n \"\\n\" +\n \"Then this ebony bird beguiling my sad fancy into smiling,\" +\n \"By the grave and stern decorum of the countenance it wore,\" +\n \"`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven.\" +\n \"Ghastly grim and ancient raven wandering from the nightly shore -\" +\n \"Tell me what thy lordly name is on the Night's Plutonian shore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"-n\" +\n \"Much I marvelled this ungainly fowl to hear discourse so plainly,\" +\n \"Though its answer little meaning - little relevancy bore;\" +\n \"For we cannot help agreeing that no living human being\" +\n \"Ever yet was blessed with seeing bird above his chamber door -\" +\n \"Bird or beast above the sculptured bust above his chamber door,\" +\n \"With such name as `Nevermore.'\" +\n \"\\n\" +\n \"But the raven, sitting lonely on the placid bust, spoke only,\" +\n \"That one word, as if his soul in that one word he did outpour.\" +\n \"Nothing further then he uttered - not a feather then he fluttered -\" +\n \"Till I scarcely more than muttered `Other friends have flown before -\" +\n \"On the morrow he will leave me, as my hopes have flown before.'\" +\n \"Then the bird said, `Nevermore.'\" +\n \"\\n\" +\n \"Startled at the stillness broken by reply so aptly spoken,\" +\n \"`Doubtless,' said I, `what it utters is its only stock and store,\" +\n \"Caught from some unhappy master whom unmerciful disaster\" +\n \"Followed fast and followed faster till his songs one burden bore -\" +\n \"Till the dirges of his hope that melancholy burden bore\" +\n \"Of \\\"Never-nevermore.\\\"'\" +\n \"\\n\" +\n \"But the raven still beguiling all my sad soul into smiling,\" +\n \"Straight I wheeled a cushioned seat in front of bird and bust and door;\" +\n \"Then, upon the velvet sinking, I betook myself to linking\" +\n \"Fancy unto fancy, thinking what this ominous bird of yore -\" +\n \"What this grim, ungainly, ghastly, gaunt, and ominous bird of yore\" +\n \"Meant in croaking `Nevermore.'\" +\n \"\\n\" +\n \"This I sat engaged in guessing, but no syllable expressing\" +\n \"To the fowl whose fiery eyes now burned into my bosom's core;\" +\n \"This and more I sat divining, with my head at ease reclining\" +\n \"On the cushion's velvet lining that the lamp-light gloated o'er,\" +\n \"But whose velvet violet lining with the lamp-light gloating o'er,\" +\n \"She shall press, ah, nevermore!\" +\n \"\\n\" +\n \"Then, methought, the air grew denser, perfumed from an unseen censer\" +\n \"Swung by Seraphim whose foot-falls tinkled on the tufted floor.\" +\n \"`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee\" +\n \"Respite - respite and nepenthe from thy memories of Lenore!\" +\n \"Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -\" +\n \"Whether tempter sent, or whether tempest tossed thee here ashore,\" +\n \"Desolate yet all undaunted, on this desert land enchanted -\" +\n \"On this home by horror haunted - tell me truly, I implore -\" +\n \"Is there - is there balm in Gilead? - tell me - tell me, I implore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!\" +\n \"By that Heaven that bends above us - by that God we both adore -\" +\n \"Tell this soul with sorrow laden if, within the distant Aidenn,\" +\n \"It shall clasp a sainted maiden whom the angels named Lenore -\" +\n \"Clasp a rare and radiant maiden, whom the angels named Lenore?'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -\" +\n \"`Get thee back into the tempest and the Night's Plutonian shore!\" +\n \"Leave no black plume as a token of that lie thy soul hath spoken!\" +\n \"Leave my loneliness unbroken! - quit the bust above my door!\" +\n \"Take thy beak from out my heart, and take thy form from off my door!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"And the raven, never flitting, still is sitting, still is sitting\" +\n \"On the pallid bust of Pallas just above my chamber door;\" +\n \"And his eyes have all the seeming of a demon's that is dreaming,\" +\n \"And the lamp-light o'er him streaming throws his shadow on the floor;\" +\n \"And my soul from out that shadow that lies floating on the floor\" +\n \"Shall be lifted - nevermore!\"\n\nNEVERMORE=11; \n \n__re = /[Nn]evermore/g;\n__matched=0;\n\ndo{\n __executed = __re.exec(__the__raven);\n if (__executed !== null) {\n \t__matched++;\n } else {\n \tbreak;\n }\n}while(1);\n\n//CHECK#1\nif (__matched !== NEVERMORE) {\n\t$ERROR('#1: __re = /[Nn]evermore/g; __executed = __re.exec(__the__raven)'+__matched);\n}\n\n",
+ "id": "S15.10.6.2_A3_T2"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /[Nn]?evermore/g and tested string is very long string",
+ "test": "__the__raven = \"\tOnce upon a midnight dreary, while I pondered weak and weary,\" +\n \"Over many a quaint and curious volume of forgotten lore,\" +\n \"While I nodded, nearly napping, suddenly there came a tapping,\" +\n \"As of some one gently rapping, rapping at my chamber door.\" +\n \"`'Tis some visitor,' I muttered, `tapping at my chamber door -\" +\n \"Only this, and nothing more.'\" +\n \"Ah, distinctly I remember it was in the bleak December,\" +\n \"And each separate dying ember wrought its ghost upon the floor.\" +\n \"Eagerly I wished the morrow; - vainly I had sought to borrow\" +\n \"From my books surcease of sorrow - sorrow for the lost Lenore -\" +\n \"For the rare and radiant maiden whom the angels named Lenore -\" +\n \"Nameless here for evermore.\" +\n \"\\n\" +\n \"And the silken sad uncertain rustling of each purple curtain\" +\n \"Thrilled me - filled me with fantastic terrors never felt before;\" +\n \"So that now, to still the beating of my heart, I stood repeating\" +\n \"`'Tis some visitor entreating entrance at my chamber door -\" +\n \"Some late visitor entreating entrance at my chamber door; -\" +\n \"This it is, and nothing more,'\" +\n \"Presently my soul grew stronger; hesitating then no longer,\" +\n \"`Sir,' said I, `or Madam, truly your forgiveness I implore;\" +\n \"But the fact is I was napping, and so gently you came rapping,\" +\n \"And so faintly you came tapping, tapping at my chamber door,\" +\n \"That I scarce was sure I heard you' - here I opened wide the door; -\" +\n \"Darkness there, and nothing more.\" +\n \"\\n\" +\n \"Deep into that darkness peering, long I stood there wondering, fearing,\" +\n \"Doubting, dreaming dreams no mortal ever dared to dream before\" +\n \"But the silence was unbroken, and the darkness gave no token,\" +\n \"And the only word there spoken was the whispered word, `Lenore!'\" +\n \"This I whispered, and an echo murmured back the word, `Lenore!'\" +\n \"Merely this and nothing more.\" +\n \"\\n\" +\n \"Back into the chamber turning, all my soul within me burning,\" +\n \"Soon again I heard a tapping somewhat louder than before.\" +\n \"`Surely,' said I, `surely that is something at my window lattice;\" +\n \"Let me see then, what thereat is, and this mystery explore -\" +\n \"Let my heart be still a moment and this mystery explore; -\" +\n \"'Tis the wind and nothing more!'\" +\n \"\\n\" +\n \"Open here I flung the shutter, when, with many a flirt and flutter,\" +\n \"In there stepped a stately raven of the saintly days of yore.\" +\n \"Not the least obeisance made he; not a minute stopped or stayed he;\" +\n \"But, with mien of lord or lady, perched above my chamber door -\" +\n \"Perched upon a bust of Pallas just above my chamber door -\" +\n \"Perched, and sat, and nothing more.\" +\n \"\\n\" +\n \"Then this ebony bird beguiling my sad fancy into smiling,\" +\n \"By the grave and stern decorum of the countenance it wore,\" +\n \"`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven.\" +\n \"Ghastly grim and ancient raven wandering from the nightly shore -\" +\n \"Tell me what thy lordly name is on the Night's Plutonian shore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"-n\" +\n \"Much I marvelled this ungainly fowl to hear discourse so plainly,\" +\n \"Though its answer little meaning - little relevancy bore;\" +\n \"For we cannot help agreeing that no living human being\" +\n \"Ever yet was blessed with seeing bird above his chamber door -\" +\n \"Bird or beast above the sculptured bust above his chamber door,\" +\n \"With such name as `Nevermore.'\" +\n \"\\n\" +\n \"But the raven, sitting lonely on the placid bust, spoke only,\" +\n \"That one word, as if his soul in that one word he did outpour.\" +\n \"Nothing further then he uttered - not a feather then he fluttered -\" +\n \"Till I scarcely more than muttered `Other friends have flown before -\" +\n \"On the morrow he will leave me, as my hopes have flown before.'\" +\n \"Then the bird said, `Nevermore.'\" +\n \"\\n\" +\n \"Startled at the stillness broken by reply so aptly spoken,\" +\n \"`Doubtless,' said I, `what it utters is its only stock and store,\" +\n \"Caught from some unhappy master whom unmerciful disaster\" +\n \"Followed fast and followed faster till his songs one burden bore -\" +\n \"Till the dirges of his hope that melancholy burden bore\" +\n \"Of \\\"Never-nevermore.\\\"'\" +\n \"\\n\" +\n \"But the raven still beguiling all my sad soul into smiling,\" +\n \"Straight I wheeled a cushioned seat in front of bird and bust and door;\" +\n \"Then, upon the velvet sinking, I betook myself to linking\" +\n \"Fancy unto fancy, thinking what this ominous bird of yore -\" +\n \"What this grim, ungainly, ghastly, gaunt, and ominous bird of yore\" +\n \"Meant in croaking `Nevermore.'\" +\n \"\\n\" +\n \"This I sat engaged in guessing, but no syllable expressing\" +\n \"To the fowl whose fiery eyes now burned into my bosom's core;\" +\n \"This and more I sat divining, with my head at ease reclining\" +\n \"On the cushion's velvet lining that the lamp-light gloated o'er,\" +\n \"But whose velvet violet lining with the lamp-light gloating o'er,\" +\n \"She shall press, ah, nevermore!\" +\n \"\\n\" +\n \"Then, methought, the air grew denser, perfumed from an unseen censer\" +\n \"Swung by Seraphim whose foot-falls tinkled on the tufted floor.\" +\n \"`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee\" +\n \"Respite - respite and nepenthe from thy memories of Lenore!\" +\n \"Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -\" +\n \"Whether tempter sent, or whether tempest tossed thee here ashore,\" +\n \"Desolate yet all undaunted, on this desert land enchanted -\" +\n \"On this home by horror haunted - tell me truly, I implore -\" +\n \"Is there - is there balm in Gilead? - tell me - tell me, I implore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!\" +\n \"By that Heaven that bends above us - by that God we both adore -\" +\n \"Tell this soul with sorrow laden if, within the distant Aidenn,\" +\n \"It shall clasp a sainted maiden whom the angels named Lenore -\" +\n \"Clasp a rare and radiant maiden, whom the angels named Lenore?'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -\" +\n \"`Get thee back into the tempest and the Night's Plutonian shore!\" +\n \"Leave no black plume as a token of that lie thy soul hath spoken!\" +\n \"Leave my loneliness unbroken! - quit the bust above my door!\" +\n \"Take thy beak from out my heart, and take thy form from off my door!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"And the raven, never flitting, still is sitting, still is sitting\" +\n \"On the pallid bust of Pallas just above my chamber door;\" +\n \"And his eyes have all the seeming of a demon's that is dreaming,\" +\n \"And the lamp-light o'er him streaming throws his shadow on the floor;\" +\n \"And my soul from out that shadow that lies floating on the floor\" +\n \"Shall be lifted - nevermore!\"\n\nNEVERMORE_AND_EVERMORE=12; \n \n__re = /[Nn]?evermore/g;\n__matched=0;\n\ndo{\n __executed = __re.exec(__the__raven);\n if (__executed !== null) {\n \t__matched++;\n } else {\n \tbreak;\n }\n}while(1);\n\n//CHECK#1\nif (__matched !== NEVERMORE_AND_EVERMORE) {\n\t$ERROR('#1: __re = /[Nn]?evermore/g; __executed = __re.exec(__the__raven)'+__matched);\n}\n\n",
+ "id": "S15.10.6.2_A3_T3"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /([Nn]?ever|([Nn]othing\\s{1,}))more/g and tested string is very long string",
+ "test": "__the__raven = \"\tOnce upon a midnight dreary, while I pondered weak and weary,\" +\n \"Over many a quaint and curious volume of forgotten lore,\" +\n \"While I nodded, nearly napping, suddenly there came a tapping,\" +\n \"As of some one gently rapping, rapping at my chamber door.\" +\n \"`'Tis some visitor,' I muttered, `tapping at my chamber door -\" +\n \"Only this, and nothing more.'\" +\n \"Ah, distinctly I remember it was in the bleak December,\" +\n \"And each separate dying ember wrought its ghost upon the floor.\" +\n \"Eagerly I wished the morrow; - vainly I had sought to borrow\" +\n \"From my books surcease of sorrow - sorrow for the lost Lenore -\" +\n \"For the rare and radiant maiden whom the angels named Lenore -\" +\n \"Nameless here for evermore.\" +\n \"\\n\" +\n \"And the silken sad uncertain rustling of each purple curtain\" +\n \"Thrilled me - filled me with fantastic terrors never felt before;\" +\n \"So that now, to still the beating of my heart, I stood repeating\" +\n \"`'Tis some visitor entreating entrance at my chamber door -\" +\n \"Some late visitor entreating entrance at my chamber door; -\" +\n \"This it is, and nothing more,'\" +\n \"Presently my soul grew stronger; hesitating then no longer,\" +\n \"`Sir,' said I, `or Madam, truly your forgiveness I implore;\" +\n \"But the fact is I was napping, and so gently you came rapping,\" +\n \"And so faintly you came tapping, tapping at my chamber door,\" +\n \"That I scarce was sure I heard you' - here I opened wide the door; -\" +\n \"Darkness there, and nothing more.\" +\n \"\\n\" +\n \"Deep into that darkness peering, long I stood there wondering, fearing,\" +\n \"Doubting, dreaming dreams no mortal ever dared to dream before\" +\n \"But the silence was unbroken, and the darkness gave no token,\" +\n \"And the only word there spoken was the whispered word, `Lenore!'\" +\n \"This I whispered, and an echo murmured back the word, `Lenore!'\" +\n \"Merely this and nothing more.\" +\n \"\\n\" +\n \"Back into the chamber turning, all my soul within me burning,\" +\n \"Soon again I heard a tapping somewhat louder than before.\" +\n \"`Surely,' said I, `surely that is something at my window lattice;\" +\n \"Let me see then, what thereat is, and this mystery explore -\" +\n \"Let my heart be still a moment and this mystery explore; -\" +\n \"'Tis the wind and nothing more!'\" +\n \"\\n\" +\n \"Open here I flung the shutter, when, with many a flirt and flutter,\" +\n \"In there stepped a stately raven of the saintly days of yore.\" +\n \"Not the least obeisance made he; not a minute stopped or stayed he;\" +\n \"But, with mien of lord or lady, perched above my chamber door -\" +\n \"Perched upon a bust of Pallas just above my chamber door -\" +\n \"Perched, and sat, and nothing more.\" +\n \"\\n\" +\n \"Then this ebony bird beguiling my sad fancy into smiling,\" +\n \"By the grave and stern decorum of the countenance it wore,\" +\n \"`Though thy crest be shorn and shaven, thou,' I said, `art sure no craven.\" +\n \"Ghastly grim and ancient raven wandering from the nightly shore -\" +\n \"Tell me what thy lordly name is on the Night's Plutonian shore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"-n\" +\n \"Much I marvelled this ungainly fowl to hear discourse so plainly,\" +\n \"Though its answer little meaning - little relevancy bore;\" +\n \"For we cannot help agreeing that no living human being\" +\n \"Ever yet was blessed with seeing bird above his chamber door -\" +\n \"Bird or beast above the sculptured bust above his chamber door,\" +\n \"With such name as `Nevermore.'\" +\n \"\\n\" +\n \"But the raven, sitting lonely on the placid bust, spoke only,\" +\n \"That one word, as if his soul in that one word he did outpour.\" +\n \"Nothing further then he uttered - not a feather then he fluttered -\" +\n \"Till I scarcely more than muttered `Other friends have flown before -\" +\n \"On the morrow he will leave me, as my hopes have flown before.'\" +\n \"Then the bird said, `Nevermore.'\" +\n \"\\n\" +\n \"Startled at the stillness broken by reply so aptly spoken,\" +\n \"`Doubtless,' said I, `what it utters is its only stock and store,\" +\n \"Caught from some unhappy master whom unmerciful disaster\" +\n \"Followed fast and followed faster till his songs one burden bore -\" +\n \"Till the dirges of his hope that melancholy burden bore\" +\n \"Of \\\"Never-nevermore.\\\"'\" +\n \"\\n\" +\n \"But the raven still beguiling all my sad soul into smiling,\" +\n \"Straight I wheeled a cushioned seat in front of bird and bust and door;\" +\n \"Then, upon the velvet sinking, I betook myself to linking\" +\n \"Fancy unto fancy, thinking what this ominous bird of yore -\" +\n \"What this grim, ungainly, ghastly, gaunt, and ominous bird of yore\" +\n \"Meant in croaking `Nevermore.'\" +\n \"\\n\" +\n \"This I sat engaged in guessing, but no syllable expressing\" +\n \"To the fowl whose fiery eyes now burned into my bosom's core;\" +\n \"This and more I sat divining, with my head at ease reclining\" +\n \"On the cushion's velvet lining that the lamp-light gloated o'er,\" +\n \"But whose velvet violet lining with the lamp-light gloating o'er,\" +\n \"She shall press, ah, nevermore!\" +\n \"\\n\" +\n \"Then, methought, the air grew denser, perfumed from an unseen censer\" +\n \"Swung by Seraphim whose foot-falls tinkled on the tufted floor.\" +\n \"`Wretch,' I cried, `thy God hath lent thee - by these angels he has sent thee\" +\n \"Respite - respite and nepenthe from thy memories of Lenore!\" +\n \"Quaff, oh quaff this kind nepenthe, and forget this lost Lenore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil! -\" +\n \"Whether tempter sent, or whether tempest tossed thee here ashore,\" +\n \"Desolate yet all undaunted, on this desert land enchanted -\" +\n \"On this home by horror haunted - tell me truly, I implore -\" +\n \"Is there - is there balm in Gilead? - tell me - tell me, I implore!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Prophet!' said I, `thing of evil! - prophet still, if bird or devil!\" +\n \"By that Heaven that bends above us - by that God we both adore -\" +\n \"Tell this soul with sorrow laden if, within the distant Aidenn,\" +\n \"It shall clasp a sainted maiden whom the angels named Lenore -\" +\n \"Clasp a rare and radiant maiden, whom the angels named Lenore?'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"`Be that word our sign of parting, bird or fiend!' I shrieked upstarting -\" +\n \"`Get thee back into the tempest and the Night's Plutonian shore!\" +\n \"Leave no black plume as a token of that lie thy soul hath spoken!\" +\n \"Leave my loneliness unbroken! - quit the bust above my door!\" +\n \"Take thy beak from out my heart, and take thy form from off my door!'\" +\n \"Quoth the raven, `Nevermore.'\" +\n \"\\n\" +\n \"And the raven, never flitting, still is sitting, still is sitting\" +\n \"On the pallid bust of Pallas just above my chamber door;\" +\n \"And his eyes have all the seeming of a demon's that is dreaming,\" +\n \"And the lamp-light o'er him streaming throws his shadow on the floor;\" +\n \"And my soul from out that shadow that lies floating on the floor\" +\n \"Shall be lifted - nevermore!\"\n\nALL_THE_HOPELESS_MORE=18; \n \n__re = /([Nn]?ever|([Nn]othing\\s{1,}))more/g;\n__matched=0;\n\ndo{\n __executed = __re.exec(__the__raven);\n if (__executed !== null) {\n \t__matched++;\n } else {\n \tbreak;\n }\n}while(1);\n\n//CHECK#1\nif (__matched !== ALL_THE_HOPELESS_MORE) {\n\t$ERROR('#1: __re = /([Nn]?ever|([Nn]othing\\\\s{1,}))more/g; __executed = __re.exec(__the__raven)'+__matched);\n}\n\n",
+ "id": "S15.10.6.2_A3_T4"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /\\d+/g and tested string is \"123 456 789\"",
+ "test": "__re = /\\d+/g;\n\n__matched = [];\n\n__expected = [\"123\",\"456\",\"789\"];\n\ndo{\n __executed = __re.exec(\"123 456 789\");\n if (__executed !== null) {\n \t__matched.push(__executed[0]);\n } else {\n \tbreak;\n }\n}while(true);\n\n//CHECK#1\nif (__expected.length !== __matched.length) {\n $ERROR('#1: __executed = /\\\\d+/g.exec(\"123 456 789\"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length));\n}\n\n//CHECK#2\nfor(var index=0; index<__expected.length; index++) {\n if (__expected[index] !== __matched[index]) {\n $ERROR('#2: __executed = /\\\\d+/g.exec(\"123 456 789\"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A3_T5"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /(\\d+)/g and tested string is \"123 456 789\"",
+ "test": "__re = /(\\d+)/g;\n\n__matched = [];\n\n__expected = [\"123\",\"456\",\"789\"];\n\ndo{\n __executed = __re.exec(\"123 456 789\");\n if (__executed !== null) {\n \t__matched.push(__executed[0]);\n } else {\n \tbreak;\n }\n}while(true);\n\n//CHECK#1\nif (__expected.length !== __matched.length) {\n $ERROR('#1: __executed = /(\\\\d+)/g.exec(\"123 456 789\"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length));\n}\n\n//CHECK#2\nfor(var index=0; index<__expected.length; index++) {\n if (__expected[index] !== __matched[index]) {\n $ERROR('#2: __executed = /(\\\\d+)/g.exec(\"123 456 789\"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A3_T6"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "RegExp is /\\d+/ and tested string is \"123 456 789\"",
+ "test": "__re = /\\d+/;\n\n__matched = [];\n\n__expected = [\"123\",\"123\",\"123\",\"123\",\"123\",\"123\",\"123\",\"123\",\"123\",\"123\"];\n\ndo{\n __executed = __re.exec(\"123 456 789\");\n if (__executed !== null) {\n \t__matched.push(__executed[0]);\n } else {\n \tbreak;\n }\n}while(__matched.length<10);\n\n//CHECK#1\nif (__expected.length !== __matched.length) {\n $ERROR('#1: __executed = /\\\\d+/.exec(\"123 456 789\"); __matched.length === ' + (__expected.length) + '.Actual: ' + (__matched.length));\n}\n\n//CHECK#2\nfor(var index=0; index<__expected.length; index++) {\n if (__expected[index] !== __matched[index]) {\n $ERROR('#2: __executed = /\\\\d+/.exec(\"123 456 789\"); __matched[' + index + '] === ' + __expected[index] + '. Actual: ' + __matched[index]);\n }\n}\n\n",
+ "id": "S15.10.6.2_A3_T7"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = 12 and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = 12;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"ab4\"];\n__expected.index = 17;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = 12; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = 12; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$ERROR('#7: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = 12; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#8: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = 12; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T1"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": ": Call first exec, then set re.lastIndex = {valueOf:function(){return 12;}} and again call exec;",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__obj = {valueOf:function(){return 12;}};\n\n__re.lastIndex = __obj;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"ab4\"];\n__expected.index = 17;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T10"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": ": Call first exec, then set re.lastIndex = {valueOf:function(){throw \"intoint\";}} and again call exec;",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__obj = {valueOf:function(){throw \"intoint\";}};\n\n__re.lastIndex = __obj;\n\n//CHECK#5\ntry {\n $FAIL('#5.1: __obj = {valueOf:function(){throw \"intoint\";}}; __re.lastIndex = __obj; __executed = __re.exec(\"aacd2233ab12nm444ab42\") throw \"intoint\". Actual: ' + (__re.exec(\"aacd2233ab12nm444ab42\")));\n} catch (e) {\n\tif (e !== \"intoint\") {\n\t\t$ERROR('#5.2: __obj = {valueOf:function(){throw \"intoint\";}}; __re.lastIndex = __obj; __executed = __re.exec(\"aacd2233ab12nm444ab42\") throw \"intoint\". Actual: ' + (e));\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T11"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": ": Call first exec, then set re.lastIndex = {toString:function(){return 12;},valueOf:function(){return {};}} and again call exec;",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__obj = {toString:function(){return 12;},valueOf:function(){return {};}};\n\n__re.lastIndex = __obj;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"ab4\"];\n__expected.index = 17;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T12"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = undefined and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = undefined;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = undefined; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = undefined; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$ERROR('#7: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = undefined; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#8: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = undefined; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T2"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = void 0 and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = void 0;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = void 0; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = void 0; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$ERROR('#7: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = void 0; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#8: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = void 0; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T3"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = null and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = null;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = null; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = null; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$ERROR('#7: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = null; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#8: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = null; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T4"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = x and again call exec, where x is undefined variable",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = x;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = x; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); var x; __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = x; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); var x; __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$ERROR('#7: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = x; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); var x; __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#8: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex = x; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); var x; __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\nvar x;\n",
+ "id": "S15.10.6.2_A4_T5"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = false and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = false;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T6"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = Math.NaN and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = Math.NaN;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T7"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = \"12\" and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = \"12\";\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"ab4\"];\n__expected.index = 17;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T8"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Call first exec, then set re.lastIndex = \"eleven\" and again call exec",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd2233ab12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__re.lastIndex = \"eleven\";\n\n__executed = __re.exec(\"aacd2233ab12nm444ab42\");\n\n__expected = [\"cd2\"];\n__expected.index = 2;\n__expected.input = \"aacd2233ab12nm444ab42\";\n\n//CHECK#5\nif (__executed.length !== __expected.length) {\n\t$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);\n}\n\n//CHECK#6\nif (__executed.index !== __expected.index) {\n\t$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);\n}\n\n//CHECK#7\nif (__executed.input !== __expected.input) {\n\t$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);\n}\n\n//CHECK#8\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$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]);\n\t}\n}\n\n",
+ "id": "S15.10.6.2_A4_T9"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "First call /(?:ab|cd)\\d?/g.exec(\"aac1dz2233a1bz12nm444ab42\"), and then First call /(?:ab|cd)\\d?/g.exec(\"aacd22\")",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n__executed = __re.exec(\"aac1dz2233a1bz12nm444ab42\");\n\n__expected = [\"ab4\"];\n__expected.index = 21;\n__expected.input = \"aac1dz2233a1bz12nm444ab42\";\n\n//CHECK#1\nif (__executed.length !== __expected.length) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aac1dz2233a1bz12nm444ab42\"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);\n}\n\n//CHECK#2\nif (__executed.index !== __expected.index) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aac1dz2233a1bz12nm444ab42\"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);\n}\n\n//CHECK#3\nif (__executed.input !== __expected.input) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aac1dz2233a1bz12nm444ab42\"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);\n}\n\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n\tif (__executed[index] !== __expected[index]) {\n\t\t$ERROR('#4: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aac1dz2233a1bz12nm444ab42\"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);\n\t}\n}\n\n__executed = __re.exec(\"aacd22\");\n\n//CHECK#5\nif (__executed) {\n\t$ERROR('#5: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd22\"); __executed === true');\n}\n\n//CHECK#6\nif (__re.lastIndex !== 0) {\n\t$ERROR('#6: __re = /(?:ab|cd)\\\\d?/g; __executed = __re.exec(\"aacd22\"); __re.lastIndex === 0. Actual: ' + (__re.lastIndex));\n}\n\n",
+ "id": "S15.10.6.2_A5_T1"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Set lastIndex to 100 and call /(?:ab|cd)\\d?/g.exec(\"aacd22 \")",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n__re.lastIndex=100;\n__executed = __re.exec(\"aacd22 \");\n\n//CHECK#1\nif (__executed) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex=100; __executed = __re.exec(\"aacd22 \"); __executed === true');\n}\n\n//CHECK#2\nif (__re.lastIndex !== 0) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex=100; __executed = __re.exec(\"aacd22 \"); __re.lastIndex === 0. Actual: ' + (__re.lastIndex));\n}\n\n",
+ "id": "S15.10.6.2_A5_T2"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Set lastIndex to -1 and call /(?:ab|cd)\\d?/g.exec(\"aacd22 \")",
+ "test": "__re = /(?:ab|cd)\\d?/g;\n__re.lastIndex=-1;\n__executed = __re.test(\"aacd22 \");\n\n//CHECK#1\nif (__executed) {\n\t$ERROR('#1: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex=-1; __executed = __re.test(\"aacd22 \"); __executed === true');\n}\n\n//CHECK#2\nif (__re.lastIndex !== 0) {\n\t$ERROR('#2: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex=-1; __executed = __re.test(\"aacd22 \"); __re.lastIndex === 0. Actual: ' + (__re.lastIndex));\n}\n\n__re.lastIndex=-100;\n__executed = __re.test(\"aacd22 \");\n\n//CHECK#3\nif (__executed) {\n\t$ERROR('#3: __re = /(?:ab|cd)\\\\d?/g; __re.lastIndex=-1; __executed = __re.test(\"aacd22 \"); __re.lastIndex=-100; __executed = __re.test(\"aacd22 \"); __executed === true');\n}\n\n//CHECK#4\nif (__re.lastIndex !== 0) {\n\t$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));\n}\n\n",
+ "id": "S15.10.6.2_A5_T3"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Checking RegExp.prototype.exec.prototype",
+ "test": "//CHECK#1\nif (RegExp.prototype.exec.prototype !== undefined) {\n $ERROR('#1: RegExp.prototype.exec.prototype === undefined. Actual: ' + (RegExp.prototype.exec.prototype));\n}\n",
+ "id": "S15.10.6.2_A6"
+ },
+ {
+ "section": "15.10.6.2, 13.2",
+ "description": "Checking if creating the RegExp.prototype.exec object fails",
+ "test": "__FACTORY = RegExp.prototype.exec;\n\ntry {\n __instance = new __FACTORY;\n $ERROR('#1.1: __FACTORY = RegExp.prototype.exec throw TypeError. Actual: ' + (__instance));\n} catch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: __FACTORY = RegExp.prototype.exec throw TypeError. Actual: ' + (e));\n }\n}\n",
+ "id": "S15.10.6.2_A7"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "Checking if enumerating the RegExp.prototype.exec.length property fails",
+ "test": "//CHECK#0\nif (RegExp.prototype.exec.hasOwnProperty('length') !== true) {\n $ERROR('#0: RegExp.prototype.exec.hasOwnProperty(\\'length\\') === true');\n}\n\n //CHECK#1\nif (RegExp.prototype.exec.propertyIsEnumerable('length') !== false) {\n $ERROR('#1: RegExp.prototype.exec.propertyIsEnumerable(\\'length\\') === true');\n}\n\n //CHECK#2\ncount=0;\n\nfor (p in RegExp.prototype.exec){\n if (p===\"length\") count++;\n}\n\nif (count !== 0) {\n $ERROR('#2: count = 0; for (p in RegExp.prototype.exec){ if (p===\"length\") count++; } count === 0. Actual: ' + (count));\n}\n\n",
+ "id": "S15.10.6.2_A8"
+ },
+ {
+ "section": "15.10.6.2",
+ "description": "Checking if deleting the RegExp.prototype.exec.length property fails",
+ "test": "//CHECK#0\nif ((RegExp.prototype.exec.hasOwnProperty('length') !== true)) {\n $FAIL('#0: RegExp.prototype.exec.hasOwnProperty(\\'length\\') === true');\n}\n\n//CHECK#1\nif (delete RegExp.prototype.exec.length !== false) {\n $ERROR('#1: delete RegExp.prototype.exec.length === false');\n}\n\n//CHECK#2\nif (RegExp.prototype.exec.hasOwnProperty('length') !== true) {\n $ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\\'length\\') === true');\n}\n\n",
+ "id": "S15.10.6.2_A9"
+ }
+ ]
+ }
+}