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

Unified Diff: sdk/lib/_internal/compiler/implementation/string_validator.dart

Issue 11368138: Add some support for the code-point code-unit distinction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Implemented feedback from patch set 3 Created 8 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
Index: sdk/lib/_internal/compiler/implementation/string_validator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/string_validator.dart b/sdk/lib/_internal/compiler/implementation/string_validator.dart
index a5f15e218067e6b85a39ba45c28ced379726c840..81453082ec604553550970c5a31c191724e4468c 100644
--- a/sdk/lib/_internal/compiler/implementation/string_validator.dart
+++ b/sdk/lib/_internal/compiler/implementation/string_validator.dart
@@ -168,6 +168,8 @@ class StringValidator {
code = value;
}
}
+ // TODO(erikcorry): Use the string code point iterator when available.
+ if (code >= String.SMP_CODE_POINT_BASE) ++length;;
// This handles both unescaped characters and the value of unicode
// escapes.
if (!isUnicodeScalarValue(code)) {

Powered by Google App Engine
This is Rietveld 408576698