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

Unified Diff: test/mjsunit/harmony/templates.js

Issue 745233002: Fix raw TemplateLiteral spans with non-ascii characters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't use Utf8Decoder::WriteUtf16 when length is 0 Created 6 years, 1 month 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
« src/parser.cc ('K') | « src/parser.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/templates.js
diff --git a/test/mjsunit/harmony/templates.js b/test/mjsunit/harmony/templates.js
index 3baf05eb5d0583734e09a4896663f49119742438..ee37d8241219a2de1aad479cd3648338c5689d3f 100644
--- a/test/mjsunit/harmony/templates.js
+++ b/test/mjsunit/harmony/templates.js
@@ -401,9 +401,21 @@ var obj = {
assertEquals("안녕", callSites[0][0]);
assertEquals("\\uc548\\ub155", callSites[0].raw[0]);
assertEquals("안녕", callSites[1][0]);
- // TODO(caitp, arv): blocked on correctly generating raw strings from
- // multi-byte UTF8.
- // assertEquals("안녕", callSites[1].raw[0]);
+ assertEquals("안녕", callSites[1].raw[0]);
+
+ // Extra-thorough UTF8 decoding test.
+ callSites = [];
+
+ tag`Iñtërnâtiônàlizætiøn\u2603\uD83D\uDCA9`;
+ tag`Iñtërnâtiônàlizætiøn☃💩`;
+
+ assertEquals(2, callSites.length);
+ assertTrue(callSites[0] !== callSites[1]);
+ assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[0][0]);
+ assertEquals(
+ "Iñtërnâtiônàlizætiøn\\u2603\\uD83D\\uDCA9", callSites[0].raw[0]);
+ assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[1][0]);
+ assertEquals("Iñtërnâtiônàlizætiøn☃💩", callSites[1].raw[0]);
})();
« src/parser.cc ('K') | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698