summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_3/LexicalConventions
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/tests/ecma_3/LexicalConventions
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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/ecma_3/LexicalConventions')
-rw-r--r--js/src/tests/ecma_3/LexicalConventions/7.4-01.js40
-rw-r--r--js/src/tests/ecma_3/LexicalConventions/7.8.3-01.js23
-rw-r--r--js/src/tests/ecma_3/LexicalConventions/7.9.1.js124
-rw-r--r--js/src/tests/ecma_3/LexicalConventions/browser.js0
-rw-r--r--js/src/tests/ecma_3/LexicalConventions/shell.js0
5 files changed, 187 insertions, 0 deletions
diff --git a/js/src/tests/ecma_3/LexicalConventions/7.4-01.js b/js/src/tests/ecma_3/LexicalConventions/7.4-01.js
new file mode 100644
index 000000000..2ec702e9e
--- /dev/null
+++ b/js/src/tests/ecma_3/LexicalConventions/7.4-01.js
@@ -0,0 +1,40 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 475834;
+var summary = ' /**/ comments with newlines in them must act as line breaks';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ function f() {
+ L: for (var i=0; i<2; i++) {
+ for (var j=0; j<2; j++) {
+ break/*
+ */L;
+ }
+ return "conformant!";
+ }
+ return "non-conformant!";
+ }
+
+ expect = 'conformant!';
+ print(actual = f());
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/js/src/tests/ecma_3/LexicalConventions/7.8.3-01.js b/js/src/tests/ecma_3/LexicalConventions/7.8.3-01.js
new file mode 100644
index 000000000..e323738f0
--- /dev/null
+++ b/js/src/tests/ecma_3/LexicalConventions/7.8.3-01.js
@@ -0,0 +1,23 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+
+var BUGNUMBER = 523401;
+var summary = 'identifier starts immediately after numeric literal';
+var expect = "SyntaxError: identifier starts immediately after numeric literal";
+var actual;
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+try {
+ eval("actual = 0in [1]");
+} catch (e) {
+ actual = e;
+}
+actual = '' + actual;
+
+reportCompare(expect, actual, summary);
+
+printStatus("All tests passed!");
diff --git a/js/src/tests/ecma_3/LexicalConventions/7.9.1.js b/js/src/tests/ecma_3/LexicalConventions/7.9.1.js
new file mode 100644
index 000000000..7e11692cf
--- /dev/null
+++ b/js/src/tests/ecma_3/LexicalConventions/7.9.1.js
@@ -0,0 +1,124 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 402386;
+var summary = 'Automatic Semicolon insertion in postfix expressions';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var expr;
+ var code;
+
+ // LeftHandSideExpression [no LineTerminator here] ++
+
+ code = 'expr ++';
+ expr = 0;
+ expect = 1;
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = 'expr\n++';
+ expr = 0;
+ expect = 'SyntaxError: expected expression, got end of script';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ // LeftHandSideExpression [no LineTerminator here] --
+
+ code = 'expr --';
+ expr = 0;
+ expect = -1;
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = 'expr\n--';
+ expr = 0;
+ expect = 'SyntaxError: expected expression, got end of script';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ //
+
+ var x = 1;
+ var y = 1;
+ code = '(x\n)-- y';
+ expect = 'SyntaxError: missing ; before statement';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = '(x)-- y';
+ expect = 'SyntaxError: missing ; before statement';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ exitFunc ('test');
+}
+
diff --git a/js/src/tests/ecma_3/LexicalConventions/browser.js b/js/src/tests/ecma_3/LexicalConventions/browser.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/ecma_3/LexicalConventions/browser.js
diff --git a/js/src/tests/ecma_3/LexicalConventions/shell.js b/js/src/tests/ecma_3/LexicalConventions/shell.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/ecma_3/LexicalConventions/shell.js