summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/regexp-after-variable.js
blob: 3ba2206c1f96aa6f8298bd33938b6eba5a9f425f (plain)
1
2
3
4
5
6
7
8
// RegExp after variable name get parsed or throws error correctly.

load(libdir + "asserts.js");

assertNoWarning(() => Function("var foo \n /bar/g"), SyntaxError,
                "RegExp in next line should be parsed");
assertThrowsInstanceOf(() => Function("var foo /bar/g"), SyntaxError,
                       "RegExp in same line should be error");