Skip to content
Snippets Groups Projects
Commit 94be366f authored by André Bargull's avatar André Bargull
Browse files

Fix strict mode errors in built-ins/RegExp

- Add missing "var" declarations and noStrict flags
- Remove with statements

Part of issue #35.
parent 87fd4e56
Branches
No related tags found
No related merge requests found
Showing
with 37 additions and 37 deletions
......@@ -14,7 +14,7 @@ var regexp_d = /\d/;
//CHECK#0410-042F
var result = true;
for (alpha = 0x0410; alpha <= 0x042F; alpha++) {
for (var alpha = 0x0410; alpha <= 0x042F; alpha++) {
if (regexp_d.exec(String.fromCharCode(alpha)) !== null) {
result = false;
}
......
......@@ -13,9 +13,9 @@ var regexp_D = /\D/;
//CHECK#0041-005A
var result = true;
for (alpha = 0x0041; alpha <= 0x005A; alpha++) {
str = String.fromCharCode(alpha);
arr = regexp_D.exec(str);
for (var alpha = 0x0041; alpha <= 0x005A; alpha++) {
var str = String.fromCharCode(alpha);
var arr = regexp_D.exec(str);
if ((arr === null) || (arr[0] !== str)) {
result = false;
}
......
......@@ -13,9 +13,9 @@ var regexp_D = /\D/;
//CHECK#0410-042F
var result = true;
for (alpha = 0x0410; alpha <= 0x042F; alpha++) {
str = String.fromCharCode(alpha);
arr = regexp_D.exec(str);
for (var alpha = 0x0410; alpha <= 0x042F; alpha++) {
var str = String.fromCharCode(alpha);
var arr = regexp_D.exec(str);
if ((arr === null) || (arr[0] !== str)) {
result = false;
}
......
......@@ -10,7 +10,7 @@ es5id: 15.10.2.13_A1_T1
description: Execute /[]a/.test("\0a\0a") and check results
---*/
__executed = /[]a/.test("\0a\0a");;
var __executed = /[]a/.test("\0a\0a");;
//CHECK#1
if (__executed) {
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T10
description: Execute /[a-c\d]+/.exec("\n\n\abc324234\n") and check results
---*/
__executed = /[a-c\d]+/.exec("\n\n\abc324234\n");
var __executed = /[a-c\d]+/.exec("\n\n\abc324234\n");
__expected = ["abc324234"];
var __expected = ["abc324234"];
__expected.index = 2;
__expected.input = "\n\n\abc324234\n";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T11
description: Execute /ab[.]?c/.exec("abc") and check results
---*/
__executed = /ab[.]?c/.exec("abc");
var __executed = /ab[.]?c/.exec("abc");
__expected = ["abc"];
var __expected = ["abc"];
__expected.index = 0;
__expected.input = "abc";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T12
description: Execute /a[b]c/.exec("abc") and check results
---*/
__executed = /a[b]c/.exec("abc");
var __executed = /a[b]c/.exec("abc");
__expected = ["abc"];
var __expected = ["abc"];
__expected.index = 0;
__expected.input = "abc";
......
......@@ -12,9 +12,9 @@ description: >
check results
---*/
__executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g");
var __executed = /[a-z][^1-9][a-z]/.exec("a1b b2c c3d def f4g");
__expected = ["def"];
var __expected = ["def"];
__expected.index = 15;
__expected.input = "a1b b2c c3d def f4g";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T14
description: Execute /[*&$]{3}/.exec("123*&$abc") and check results
---*/
__executed = /[*&$]{3}/.exec("123*&$abc");
var __executed = /[*&$]{3}/.exec("123*&$abc");
__expected = ["*&$"];
var __expected = ["*&$"];
__expected.index = 3;
__expected.input = "123*&$abc";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T15
description: Execute /[\d][\n][^\d]/.exec("line1\nline2") and check results
---*/
__executed = /[\d][\n][^\d]/.exec("line1\nline2");
var __executed = /[\d][\n][^\d]/.exec("line1\nline2");
__expected = ["1\nl"];
var __expected = ["1\nl"];
__expected.index = 4;
__expected.input = "line1\nline2";
......
......@@ -12,9 +12,9 @@ description: >
check results
---*/
__executed = /[\d][\12-\14]{1,}[^\d]/.exec("line1\n\n\n\n\nline2");
var __executed = /[\d][\12-\14]{1,}[^\d]/.exec("line1\n\n\n\n\nline2");
__expected = ["1\n\n\n\n\nl"];
var __expected = ["1\n\n\n\n\nl"];
__expected.index = 4;
__expected.input = "line1\n\n\n\n\nline2";
......
......@@ -10,7 +10,7 @@ es5id: 15.10.2.13_A1_T17
description: Execute /[]/.exec("a[b\n[]\tc]d") and check results
---*/
__executed = /[]/.exec("a[b\n[]\tc]d");
var __executed = /[]/.exec("a[b\n[]\tc]d");
//CHECK#1
if (__executed !== null) {
......
......@@ -10,7 +10,7 @@ es5id: 15.10.2.13_A1_T2
description: Execute /a[]/.test("\0a\0a") and check results
---*/
__executed = /a[]/.test("\0a\0a");;
var __executed = /a[]/.test("\0a\0a");;
//CHECK#1
if (__executed) {
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T3
description: Execute /q[ax-zb](?=\s+)/.exec("qYqy ") and check results
---*/
__executed = /q[ax-zb](?=\s+)/.exec("qYqy ");
var __executed = /q[ax-zb](?=\s+)/.exec("qYqy ");
__expected = ["qy"];
var __expected = ["qy"];
__expected.index = 2;
__expected.input = "qYqy ";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T4
description: Execute /q[ax-zb](?=\s+)/.exec("tqaqy ") and check results
---*/
__executed = /q[ax-zb](?=\s+)/.exec("tqaqy ");
var __executed = /q[ax-zb](?=\s+)/.exec("tqaqy ");
__expected = ["qy"];
var __expected = ["qy"];
__expected.index = 3;
__expected.input = "tqaqy ";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T5
description: Execute /q[ax-zb](?=\s+)/.exec("tqa\t qy ") and check results
---*/
__executed = /q[ax-zb](?=\s+)/.exec("tqa\t qy ");
var __executed = /q[ax-zb](?=\s+)/.exec("tqa\t qy ");
__expected = ["qa"];
var __expected = ["qa"];
__expected.index = 1;
__expected.input = "tqa\t qy ";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T6
description: Execute /ab[ercst]de/.exec("abcde") and check results
---*/
__executed = /ab[ercst]de/.exec("abcde");
var __executed = /ab[ercst]de/.exec("abcde");
__expected = ["abcde"];
var __expected = ["abcde"];
__expected.index = 0;
__expected.input = "abcde";
......
......@@ -10,7 +10,7 @@ es5id: 15.10.2.13_A1_T7
description: Execute /ab[erst]de/.test("abcde") and check results
---*/
__executed = /ab[erst]de/.test("abcde");
var __executed = /ab[erst]de/.test("abcde");
//CHECK#1
if (__executed) {
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T8
description: Execute /[d-h]+/.exec("abcdefghijkl") and check results
---*/
__executed = /[d-h]+/.exec("abcdefghijkl");
var __executed = /[d-h]+/.exec("abcdefghijkl");
__expected = ["defgh"];
var __expected = ["defgh"];
__expected.index = 3;
__expected.input = "abcdefghijkl";
......
......@@ -10,9 +10,9 @@ es5id: 15.10.2.13_A1_T9
description: Execute /[1234567].{2}/.exec("abc6defghijkl") and check results
---*/
__executed = /[1234567].{2}/.exec("abc6defghijkl");
var __executed = /[1234567].{2}/.exec("abc6defghijkl");
__expected = ["6de"];
var __expected = ["6de"];
__expected.index = 3;
__expected.input = "abc6defghijkl";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment