Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1588)

Unified Diff: test/mjsunit/harmony/template-escapes.js

Issue 2724003006: [parser] Correctly handle invalid escapes in adjacent template tokens. (Closed)
Patch Set: MoveErrorTo takes a TokenDesc* Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/template-escapes.js
diff --git a/test/mjsunit/harmony/template-escapes.js b/test/mjsunit/harmony/template-escapes.js
index fcaf8ac5bfcfa79e361852c144cca13139317959..ea019851ffe53bfcb07ff056b17e650413de340e 100644
--- a/test/mjsunit/harmony/template-escapes.js
+++ b/test/mjsunit/harmony/template-escapes.js
@@ -783,3 +783,90 @@ check({
1
]
})`left${0}\u{110000}${1}right`;
+
+
+
+function checkMultiple(expectedArray) {
+ let results = [];
+ return function consume(strs, ...args) {
+ if (typeof strs === 'undefined') {
+ assertArrayEquals(expectedArray, results);
+ } else {
+ results.push({cooked: strs, raw: strs.raw, exprs: args});
+ return consume;
+ }
+ };
+}
+
+
+checkMultiple([{
+ 'cooked': [
+ undefined
+ ],
+ 'raw': [
+ '\\u',
+ ],
+ 'exprs': []
+}, {
+ 'cooked': [
+ undefined
+ ],
+ 'raw': [
+ '\\u',
+ ],
+ 'exprs': []
+}])`\u``\u`();
+
+checkMultiple([{
+ 'cooked': [
+ ' '
+ ],
+ 'raw': [
+ ' ',
+ ],
+ 'exprs': []
+}, {
+ 'cooked': [
+ undefined
+ ],
+ 'raw': [
+ '\\u',
+ ],
+ 'exprs': []
+}])` ``\u`();
+
+checkMultiple([{
+ 'cooked': [
+ undefined
+ ],
+ 'raw': [
+ '\\u',
+ ],
+ 'exprs': []
+}, {
+ 'cooked': [
+ ' '
+ ],
+ 'raw': [
+ ' ',
+ ],
+ 'exprs': []
+}])`\u`` `();
+
+checkMultiple([{
+ 'cooked': [
+ ' '
+ ],
+ 'raw': [
+ ' ',
+ ],
+ 'exprs': []
+}, {
+ 'cooked': [
+ ' '
+ ],
+ 'raw': [
+ ' ',
+ ],
+ 'exprs': []
+}])` `` `();
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698