diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch07/7.8/7.8.5 | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch07/7.8/7.8.5')
54 files changed, 1189 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1.js b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1.js new file mode 100644 index 000000000..a8fe6e29f --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1.js @@ -0,0 +1,20 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved. +/// Ecma International makes this code available under the terms and conditions set +/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +/// "Use Terms"). Any redistribution of this code must retain the above +/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch07/7.8/7.8.5/7.8.5-1.js
+ * @description Literal RegExp Objects - SyntaxError exception is thrown if the RegularExpressionNonTerminator position of a RegularExpressionBackslashSequence is a LineTerminator.
+ */
+
+
+function testcase() {
+ try {
+ eval("var regExp = /\\\rn/;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1gs.js b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1gs.js new file mode 100644 index 000000000..4b22a6193 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-1gs.js @@ -0,0 +1,15 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+
+/**
+ * @path ch07/7.8/7.8.5/7.8.5-1gs.js
+ * @description Empty literal RegExp should result in a SyntaxError
+ * @negative ^((?!NotEarlyError).)*$
+ */
+
+throw NotEarlyError;
+var re = //;
+
diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-2gs.js b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-2gs.js new file mode 100644 index 000000000..b67638b03 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/7.8.5-2gs.js @@ -0,0 +1,13 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+
+/**
+ * @path ch07/7.8/7.8.5/7.8.5-2gs.js
+ * @description Empty dynamic RegExp should not result in a SyntaxError
+ */
+
+var re = new RegExp("");
+
diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T1.js new file mode 100644 index 000000000..638177170 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: NonTerminator but not * or \ or /, + * RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.1_T1.js + * @description Without eval + */ + +//CHECK#1 +if (/1/.source !== "1") { + $ERROR('#1: /1/'); +} + +//CHECK#2 +if (/a/.source !== "a") { + $ERROR('#2: /a/'); +} + +//CHECK#3 +if (/;/.source !== ";") { + $ERROR('#3: /;/'); +} + +//CHECK#4 +if (/ /.source !== " ") { + $ERROR('#4: / /'); +} + +//CHECK#5 +if (/\u0041/.source !== "\\u0041") { + $ERROR('#5: /\\u0041/'); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T2.js new file mode 100644 index 000000000..e46d2e24d --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.1_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: NonTerminator but not * or \ or /, + * RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.1_T2.js + * @description Complex test with eval, using syntax pattern + */ + +//CHECK +var errorCount = 0; +var count = 0; +var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; +for (var i1 = 0; i1 < 16; i1++) { + for (var i2 = 0; i2 < 16; i2++) { + for (var i3 = 0; i3 < 16; i3++) { + for (var i4 = 0; i4 < 16; i4++) { + try { + var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; + var Elimination = + ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || + (uu === "003F") || (uu === "0028") || (uu === "0029") || + (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); + if ((Elimination || LineTerminator ) === false) { + var xx = String.fromCharCode("0x" + uu); + var pattern = eval("/" + xx + "/"); + if (pattern.source !== xx) { + $ERROR('#' + uu + ' '); + errorCount++; + } + } else { + count--; + } + } catch (e) { + $ERROR('#' + uu + ' '); + errorCount++; + } + count++; + } + } + } +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T1.js new file mode 100644 index 000000000..d7013d049 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T1.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: * or \ or / or [empty] is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.2_T1.js + * @description * + * @negative + */ + +//CHECK#1 +/*/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T2.js new file mode 100644 index 000000000..b050d8c53 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T2.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: * or \ or / or [empty] is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.2_T2.js + * @description \ + * @negative + */ + +//CHECK#1 +/\/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T3.js new file mode 100644 index 000000000..abd943bac --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: * or \ or / or [empty] is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.2_T3.js + * @description / + * @negative + */ + +//CHECK#1 +/// +.source; + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T4.js new file mode 100644 index 000000000..6d341f991 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.2_T4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: * or \ or / or [empty] is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.2_T4.js + * @description [empty] + * @negative + */ + +//CHECK#1 +// +.source; + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T1.js new file mode 100644 index 000000000..4fdba3e4c --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T1.js + * @description Line Feed, without eval + * @negative + */ + +//CHECK#1 +/ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T2.js new file mode 100644 index 000000000..a2ac51235 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T2.js + * @description Line Feed, with eval + */ + +//CHECK#1 +try { + eval("/\u000A/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: Line Feed is incorrect. Actual: ' + (eval("/\u000A/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: Line Feed is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T3.js new file mode 100644 index 000000000..95d7ebcd6 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T3.js + * @description Carriage Return, without eval + * @negative + */ + +//CHECK#1 +/ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T4.js new file mode 100644 index 000000000..638eecf69 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T4.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T4.js + * @description Carriage Return, with eval + */ + +//CHECK#1 +try { + eval("/\u000D/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: Carriage Return is incorrect. Actual: ' + (eval("/\u000D/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: Carriage Return is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T5.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T5.js new file mode 100644 index 000000000..c621df543 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T5.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T5.js + * @description Line separator, with eval + */ + +//CHECK#1 +try { + eval("/\u2028/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: Line separator is incorrect. Actual: ' + (eval("/\u2028/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: Line separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T6.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T6.js new file mode 100644 index 000000000..1ad88db22 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.3_T6.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.3_T6.js + * @description Paragraph separator, with eval + */ + +//CHECK#1 +try { + eval("/\u2029/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: Paragraph separator is incorrect. Actual: ' + (eval("/\u2029/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: Paragraph separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T1.js new file mode 100644 index 000000000..0c87e0b3d --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator, + * RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.4_T1.js + * @description Check similar to (/\1/.source === "\\1") + */ + +//CHECK#1 +if (/\1/.source !== "\\1") { + $ERROR('#1: /\\1/'); +} + +//CHECK#2 +if (/\a/.source !== "\\a") { + $ERROR('#2: /\\a/'); +} + +//CHECK#3 +if (/\;/.source !== "\\;") { + $ERROR('#3: /\\;/'); +} + +//CHECK#4 +if (/\ /.source !== "\\ ") { + $ERROR('#4: /\\ /'); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T2.js new file mode 100644 index 000000000..f17d8332a --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.4_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator, + * RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.4_T2.js + * @description Complex test with eval, using syntax pattern + */ + +//CHECK +var errorCount = 0; +var count = 0; +var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; +for (var i1 = 0; i1 < 16; i1++) { + for (var i2 = 0; i2 < 16; i2++) { + for (var i3 = 0; i3 < 16; i3++) { + for (var i4 = 0; i4 < 16; i4++) { + try { + var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; + var Elimination = + ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || + (uu === "003F") || (uu === "0028") || (uu === "0029") || + (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); + if ((Elimination || LineTerminator ) === false) { + var xx = "\\" + String.fromCharCode("0x" + uu); + var pattern = eval("/" + xx + "/"); + if (pattern.source !== xx) { + $ERROR('#' + uu + ' '); + errorCount++; + } + } else { + count--; + } + } catch (e) { + $ERROR('#' + uu + ' '); + errorCount++; + } + count++; + } + } + } +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T1.js new file mode 100644 index 000000000..94a9734d0 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T1.js + * @description Line Feed, without eval + * @negative + */ + +//CHECK#1 +/\ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T2.js new file mode 100644 index 000000000..923e3f737 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T2.js + * @description Line Feed, with eval + */ + +//CHECK#1 +try { + eval("/\\\u000A/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: BackslashSequence :: \\Line Feed is incorrect. Actual: ' + (eval("/\\\u000A/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: BackslashSequence :: \\Line Feed is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T3.js new file mode 100644 index 000000000..3c349c10b --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T3.js + * @description Carriage Return, without eval + * @negative + */ + +//CHECK#1 +/\ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T4.js new file mode 100644 index 000000000..e5b89920a --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T4.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T4.js + * @description Carriage Return, with eval + */ + +//CHECK#1 +try { + eval("/\\\u000D/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: BackslashSequence :: \\Carriage Return is incorrect. Actual: ' + (eval("/\\\u000D/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: BackslashSequence :: \\Carriage Return is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T5.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T5.js new file mode 100644 index 000000000..a9b6d9696 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T5.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T5.js + * @description Line separator, with eval + */ + +//CHECK#1 +try { + eval("/\\\u2028/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: BackslashSequence :: \\Line separator is incorrect. Actual: ' + (eval("/\\\u2028/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: BackslashSequence :: \\Line separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T6.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T6.js new file mode 100644 index 000000000..73345ed41 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A1.5_T6.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A1.5_T6.js + * @description Paragraph separator, with eval + */ + +//CHECK#1 +try { + eval("/\\\u2029/").source; + $ERROR('#1.1: RegularExpressionFirstChar :: BackslashSequence :: \\Paragraph separator is incorrect. Actual: ' + (eval("/\\\u2029/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionFirstChar :: BackslashSequence :: \\Paragraph separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T1.js new file mode 100644 index 000000000..5b69da20d --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: NonTerminator but not \ or /, + * RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.1_T1.js + * @description Without eval + */ + +//CHECK#1 +if (/1a/.source !== "1a") { + $ERROR('#1: /1a/'); +} + +//CHECK#2 +if (/aa/.source !== "aa") { + $ERROR('#2: /aa/'); +} + +//CHECK#3 +if (/,;/.source !== ",;") { + $ERROR('#3: /,;/'); +} + +//CHECK#4 +if (/ /.source !== " ") { + $ERROR('#4: / /'); +} + +//CHECK#5 +if (/a\u0041/.source !== "a\\u0041") { + $ERROR('#5: /a\\u0041/'); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T2.js new file mode 100644 index 000000000..b8e66b23e --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.1_T2.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: NonTerminator but not \ or /, + * RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.1_T2.js + * @description Complex test with eval, using syntax pattern + */ + +//CHECK +var errorCount = 0; +var count = 0; +var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; +for (var i1 = 0; i1 < 16; i1++) { + for (var i2 = 0; i2 < 16; i2++) { + for (var i3 = 0; i3 < 16; i3++) { + for (var i4 = 0; i4 < 16; i4++) { + try { + var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; + var Elimination = + ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || + (uu === "003F") || (uu === "0028") || (uu === "0029") || + (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); + if ((Elimination || LineTerminator ) === false) { + var xx = "nnnn" + String.fromCharCode("0x" + uu); + var pattern = eval("/" + xx + "/"); + if (pattern.source !== xx) { + $ERROR('#' + uu + ' '); + errorCount++; + } + + } else { + count--; + } + } catch (e) { + $ERROR('#' + uu + ' '); + errorCount++; + } + count++; + } + } + } +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T1.js new file mode 100644 index 000000000..8231c0407 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T1.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: \ or / is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.2_T1.js + * @description \ + * @negative + */ + +//CHECK#1 +/a\/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T2.js new file mode 100644 index 000000000..b80f21691 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.2_T2.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: \ or / is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.2_T2.js + * @description / + * @negative + */ + +//CHECK#1 +/a//.source; + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T1.js new file mode 100644 index 000000000..fd42341e0 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T1.js + * @description Line Feed, without eval + * @negative + */ + +//CHECK#1 +/a +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T2.js new file mode 100644 index 000000000..8f3523088 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T2.js + * @description Line Feed, with eval + */ + +//CHECK#1 +try { + eval("/a\u000A/").source; + $ERROR('#1.1: RegularExpressionChar :: Line Feedis incorrect. Actual: ' + (eval("/a\u000A/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: Line Feed is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T3.js new file mode 100644 index 000000000..c9debb5c5 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T3.js + * @description Carriage Return, without eval + * @negative + */ + +//CHECK#1 +/a +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T4.js new file mode 100644 index 000000000..4c2dda384 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T4.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T4.js + * @description Carriage Return, with eval + */ + +//CHECK#1 +try { + eval("/a\u000D/").source; + $ERROR('#1.1: RegularExpressionChar :: Carriage Retur is incorrect. Actual: ' + (eval("/a\u000D/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: Carriage Retur is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T5.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T5.js new file mode 100644 index 000000000..85d43801f --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T5.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T5.js + * @description Line separator, with eval + */ + +//CHECK#1 +try { + eval("/a\u2028/").source; + $ERROR('#1.1: RegularExpressionChar :: Line separator is incorrect. Actual: ' + (eval("/a\u2028/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: Line separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T6.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T6.js new file mode 100644 index 000000000..abf9833c5 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.3_T6.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.3_T6.js + * @description Paragraph separator, with eval + */ + +//CHECK#1 +try { + eval("/s\u2029/").source; + $ERROR('#1.1: RegularExpressionChar :: Paragraph separator is incorrect. Actual: ' + (eval("/s\u2029/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: Paragraph separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T1.js new file mode 100644 index 000000000..8a67dc42a --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \NonTerminator, + * RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.4_T1.js + * @description Check similar to (/a\1/.source === "a\\1") + */ + +//CHECK#1 +if (/a\1/.source !== "a\\1") { + $ERROR('#1: /a\\1/'); +} + +//CHECK#2 +if (/a\a/.source !== "a\\a") { + $ERROR('#2: /a\\a/'); +} + +//CHECK#3 +if (/,\;/.source !== ",\\;") { + $ERROR('#3: /,\\;/'); +} + +//CHECK#4 +if (/ \ /.source !== " \\ ") { + $ERROR('#4: / \\ /'); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T2.js new file mode 100644 index 000000000..fa26a976b --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.4_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \NonTerminator, + * RegularExpressionFlags :: [empty] + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.4_T2.js + * @description Complex test with eval, using syntax pattern + */ + +//CHECK +var errorCount = 0; +var count = 0; +var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; +for (var i1 = 0; i1 < 16; i1++) { + for (var i2 = 0; i2 < 16; i2++) { + for (var i3 = 0; i3 < 16; i3++) { + for (var i4 = 0; i4 < 16; i4++) { + try { + var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; + var Elimination = + ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || + (uu === "003F") || (uu === "0028") || (uu === "0029") || + (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); + if ((Elimination || LineTerminator ) === false) { + var xx = "a\\" + String.fromCharCode("0x" + uu); + var pattern = eval("/" + xx + "/"); + if (pattern.source !== xx) { + $ERROR('#' + uu + ' '); + errorCount++; + } + } else { + count--; + } + } catch (e) { + $ERROR('#' + uu + ' '); + errorCount++; + } + count++; + } + } + } +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T1.js new file mode 100644 index 000000000..a3d5e5b4e --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T1.js + * @description Line Feed, without eval + * @negative + */ + +//CHECK#1 +/a\ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T2.js new file mode 100644 index 000000000..685ada093 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T2.js + * @description Line Feed, with eval + */ + +//CHECK#1 +try { + eval("/a\\\u000A/").source; + $ERROR('#1.1: RegularExpressionChar :: BackslashSequence :: \\Line Feed is incorrect. Actual: ' + (eval("/a\\\u000A/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: BackslashSequence :: \\Line Feed is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T3.js new file mode 100644 index 000000000..e85821870 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T3.js + * @description Carriage Return, without eval + * @negative + */ + +//CHECK#1 +/a\ +/ + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T4.js new file mode 100644 index 000000000..5cdea0817 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T4.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T4.js + * @description Carriage Return, with eval + */ + +//CHECK#1 +try { + eval("/a\\\u000D/").source; + $ERROR('#1.1: RegularExpressionChar :: BackslashSequence :: \\Carriage Return is incorrect. Actual: ' + (eval("/a\\\u000D/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: BackslashSequence :: \\Carriage Return is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T5.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T5.js new file mode 100644 index 000000000..acc1f3080 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T5.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T5.js + * @description Line separator, with eval + */ + +//CHECK#1 +try { + eval("/a\\\u2028/").source; + $ERROR('#1.1: RegularExpressionChar :: BackslashSequence :: \\Line separator is incorrect. Actual: ' + (eval("/a\\\u2028/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: BackslashSequence :: \\Line separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T6.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T6.js new file mode 100644 index 000000000..d33041021 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A2.5_T6.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionChar :: BackslashSequence :: \LineTerminator is incorrect + * + * @path ch07/7.8/7.8.5/S7.8.5_A2.5_T6.js + * @description Paragraph separator, with eval + */ + +//CHECK#1 +try { + eval("/a\\\u2029/").source; + $ERROR('#1.1: RegularExpressionChar :: BackslashSequence :: \\Paragraph separator is incorrect. Actual: ' + (eval("/a\\\u2029/").source)); +} +catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: RegularExpressionChar :: BackslashSequence :: \\Paragraph separator is incorrect. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T1.js new file mode 100644 index 000000000..14ea4d7ea --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T1.js + * @description IdentifierPart :: g + */ + +//CHECK#1 +var regexp = /(?:)/g; +if (regexp.global !== true) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === true. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== false) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === false. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== false) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === false. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T2.js new file mode 100644 index 000000000..f247140d2 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T2.js + * @description IdentifierPart :: i + */ + +//CHECK#1 +var regexp = /(?:)/i; +if (regexp.global !== false) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === false. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== true) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== false) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === false. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T3.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T3.js new file mode 100644 index 000000000..4f0e6f14d --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T3.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T3.js + * @description IdentifierPart :: m + */ + +//CHECK#1 +var regexp = /(?:)/m; +if (regexp.global !== false) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === false. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== false) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === false. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== true) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === true. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T4.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T4.js new file mode 100644 index 000000000..fd56ca01c --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T4.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T4.js + * @description IdentifierPart :: gi + */ + +//CHECK#1 +var regexp = /(?:)/gi; +if (regexp.global !== true) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === true. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== true) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== false) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === false. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T5.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T5.js new file mode 100644 index 000000000..3b45a94ca --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T5.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T5.js + * @description IdentifierPart :: mg + */ + +//CHECK#1 +var regexp = /(?:)/mg; +if (regexp.global !== true) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === true. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== false) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === false. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== true) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === true. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T6.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T6.js new file mode 100644 index 000000000..fb188ed6c --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T6.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T6.js + * @description IdentifierPart :: mig + */ + +//CHECK#1 +var regexp = /(?:)/mig; +if (regexp.global !== true) { + $ERROR('#1: var regexp = /(?:)/g; regexp.global === true. Actual: ' + (regexp.global)); +} + +//CHECK#2 +if (regexp.ignoreCase !== true) { + $ERROR('#2: var regexp = /(?:)/g; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase)); +} + +//CHECK#3 +if (regexp.multiline !== true) { + $ERROR('#3: var regexp = /(?:)/g; regexp.multiline === true. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T7.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T7.js new file mode 100644 index 000000000..299241d4c --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T7.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T7.js + * @description IdentifierPart :: \u0067 (g) + */ + +//CHECK#1 +var regexp; +eval("regexp = /(?:)/\u0067"); +if (regexp.global !== true) { + $ERROR('#1: var regexp = /(?:)/\\u0067; regexp.global === true. Actual: ' + (regexp.global)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T8.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T8.js new file mode 100644 index 000000000..de78b6f23 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T8.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T8.js + * @description IdentifierPart :: \u0069 (i) + */ + +//CHECK#1 +var regexp; +eval("regexp = /(?:)/\u0069"); +if (regexp.ignoreCase !== true) { + $ERROR('#1: var regexp = /(?:)/\\u0069; regexp.ignoreCase === true. Actual: ' + (regexp.ignoreCase)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T9.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T9.js new file mode 100644 index 000000000..132586af4 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A3.1_T9.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * RegularExpressionFlags :: IdentifierPart + * + * @path ch07/7.8/7.8.5/S7.8.5_A3.1_T9.js + * @description IdentifierPart :: \u006D (m) + */ + +//CHECK#1 +var regexp; +eval("regexp = /(?:)/\u006D"); +if (regexp.multiline !== true) { + $ERROR('#1: var regexp = /(?:)/\\u006D; regexp.multiline === true. Actual: ' + (regexp.multiline)); +} + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.1.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.1.js new file mode 100644 index 000000000..d8f33d67d --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.1.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * A regular expression literal is an input element that is converted to + * a RegExp object when it is scanned + * + * @path ch07/7.8/7.8.5/S7.8.5_A4.1.js + * @description Check ((/(?:)/ instanceof RegExp) === true) + */ + +//CHECK#1 +if ((/(?:)/ instanceof RegExp) !== true) { + $ERROR('#1: (/(?:)/ instanceof RegExp) === true. Actual: ' + ((/(?:)/ instanceof RegExp))); +} + + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.2.js b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.2.js new file mode 100644 index 000000000..569e4cbd2 --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/S7.8.5_A4.2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Two regular expression literals in a program evaluate to + * regular expression objects that never compare as === to each other even + * if the two literals' contents are identical + * + * @path ch07/7.8/7.8.5/S7.8.5_A4.2.js + * @description Check equality two regular expression literals + */ + +//CHECK#1 +var regexp1 = /(?:)/; +var regexp2 = /(?:)/; +if (regexp1 === regexp2) { + $ERROR('#1: var regexp1 = /(?:)/; var regexp2 = /(?:)/; regexp1 !== regexp2'); +} + + diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/browser.js b/js/src/tests/test262/ch07/7.8/7.8.5/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/browser.js diff --git a/js/src/tests/test262/ch07/7.8/7.8.5/shell.js b/js/src/tests/test262/ch07/7.8/7.8.5/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch07/7.8/7.8.5/shell.js |