Skip to content

Commit d2457b1

Browse files
szledanegavrin
authored andcommitted
Add missing RegExp case in the token_type_to_string
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
1 parent 4fdb524 commit d2457b1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

jerry-core/parser/js/lexer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ lexer_token_type_to_string (token_type tt)
16901690
case TOK_KEYWORD: return "Keyword";
16911691
case TOK_SMALL_INT: /* FALLTHRU */
16921692
case TOK_NUMBER: return "Number";
1693+
case TOK_REGEXP: return "RegExp";
16931694

16941695
case TOK_NULL: return "null";
16951696
case TOK_BOOL: return "bool";

tests/jerry/eval.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,13 @@ catch (e)
107107
{
108108
assert (e instanceof SyntaxError);
109109
}
110+
111+
try
112+
{
113+
eval ("v_0 = {a: Math, /[]/};");
114+
assert (false);
115+
}
116+
catch(e)
117+
{
118+
assert (e instanceof SyntaxError);
119+
}

0 commit comments

Comments
 (0)