Index: runtime/vm/scanner.cc |
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc |
index 229dfdf36f0a9b06d37104a6ec56f31b1283bff0..c40eb1a19740bcafb39ba80ba680898f996d4be9 100644 |
--- a/runtime/vm/scanner.cc |
+++ b/runtime/vm/scanner.cc |
@@ -498,7 +498,7 @@ void Scanner::ScanEscapedCodePoint(uint32_t* code_point) { |
void Scanner::ScanLiteralStringChars(bool is_raw) { |
- GrowableArray<uint32_t> string_chars(64); |
+ GrowableArray<uint16_t> string_chars(64); |
ASSERT(IsScanningString()); |
// We are at the first character of a string literal piece. A string literal |
@@ -534,7 +534,15 @@ void Scanner::ScanLiteralStringChars(bool is_raw) { |
break; |
case 'u': |
case 'x': { |
- ScanEscapedCodePoint(&escape_char); |
+ uint32_t ch; |
+ ScanEscapedCodePoint(&ch); |
+ int32_t code_point = ch; |
+ if (code_point > Utf16::kMaxCodeUnit) { |
+ string_chars.Add(Utf16::LeadFromCodePoint(code_point)); |
+ escape_char = Utf16::TrailFromCodePoint(code_point); |
+ } else { |
+ escape_char = code_point; |
+ } |
break; |
} |
default: |