diff options
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.js | 16 |
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..0d94cf72ee --- /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(/; +123456789; +`); +} catch (e) { + line = e.lineNumber; + column = e.columnNumber; +} + +assertEq(line, 3); +assertEq(column, 7); |