Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index f08f9b31d901eb4c1b0483d4f2426d8437a8104f..24da4c7a06bc06164895dda8ab62462d111e117d 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -4552,6 +4552,28 @@ TEST(ScanUnterminatedTemplateLiterals) { |
} |
+TEST(TemplateLiteralsIllegalTokens) { |
+ const char* context_data[][2] = {{"'use strict';", ""}, |
+ {"function foo(){ 'use strict';" |
+ " var a, b, c; return ", "}"}, |
+ {NULL, NULL}}; |
+ const char* data[] = { |
+ "`hello\\x`", |
+ "`hello\\x${1}`", |
+ "`hello${1}\\x`", |
+ "`hello${1}\\x${2}`", |
+ "`hello\\x\n`", |
+ "`hello\\x\n${1}`", |
+ "`hello${1}\\x\n`", |
+ "`hello${1}\\x\n${2}`", |
+ NULL}; |
+ |
+ static const ParserFlag always_flags[] = {kAllowHarmonyTemplates}; |
+ RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
+ arraysize(always_flags)); |
+} |
+ |
+ |
TEST(LexicalScopingSloppyMode) { |
const char* context_data[][2] = { |
{"", ""}, |