summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Function/line-terminator-before-arrow.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Function/line-terminator-before-arrow.js')
-rw-r--r--js/src/tests/non262/Function/line-terminator-before-arrow.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/src/tests/non262/Function/line-terminator-before-arrow.js b/js/src/tests/non262/Function/line-terminator-before-arrow.js
new file mode 100644
index 0000000000..52bdce7f3b
--- /dev/null
+++ b/js/src/tests/non262/Function/line-terminator-before-arrow.js
@@ -0,0 +1,9 @@
+assertThrowsInstanceOf(() => eval("() \n => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("a \n => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("(a) /*\n*/ => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("(a, b) \n => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("(a, b = 1) \n => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("(a, ...b) \n => {}"), SyntaxError);
+assertThrowsInstanceOf(() => eval("(a, b = 1, ...c) \n => {}"), SyntaxError);
+
+reportCompare(0, 0, "ok");