summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/syntax-error-illegal-character.js
blob: ca3eaf99a958936e18627bd1375130d1b238b46f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
load(libdir + "syntax.js");

function check_syntax_error_at(e, code, name) {
  assertEq(e instanceof SyntaxError, true, name + ": " + code);
  assertEq(e.message, "illegal character U+0040", name + ": " + code);
}
test_syntax(["@"], check_syntax_error_at, false);

function check_syntax_error_ellipsis(e, code, name) {
  assertEq(e instanceof SyntaxError, true, name + ": " + code);
  assertEq(e.message, "illegal character U+2026", name + ": " + code);
}
test_syntax(["…"], check_syntax_error_ellipsis, false);

function check_syntax_error_clown(e, code, name) {
  assertEq(e instanceof SyntaxError, true, name + ": " + code);
  assertEq(e.message, "illegal character U+1F921", name + ": " + code);
}
test_syntax(["🤡"], check_syntax_error_clown, false);