summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/regexp-error-location.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/parser/regexp-error-location.js')
-rw-r--r--js/src/jit-test/tests/parser/regexp-error-location.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/parser/regexp-error-location.js b/js/src/jit-test/tests/parser/regexp-error-location.js
new file mode 100644
index 0000000000..4f9b11e4f5
--- /dev/null
+++ b/js/src/jit-test/tests/parser/regexp-error-location.js
@@ -0,0 +1,16 @@
+// Check that error location for RegExp points to the actual line/column inside
+// the script instead of inside the pattern.
+var line, column;
+try {
+ eval(`
+
+ /aaa(/;
+012345678;
+`);
+} catch (e) {
+ line = e.lineNumber;
+ column = e.columnNumber;
+}
+
+assertEq(line, 3);
+assertEq(column, 6);