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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_helper.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/lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index ed61b0c45a885f78d61576c2d56756c3878972a9..a79fbe7b68e76554483be917623c347b1cfde06e 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -536,11 +536,12 @@ class Primitives {
static num dateNow() => JS('num', r'Date.now()');
- static String stringFromCharCodes(charCodes) {
- for (var i in charCodes) {
+ static String stringFromCodeUnits(codeUnits) {
+ for (var i in codeUnits) {
if (i is !int) throw new ArgumentError(i);
+ if (i > String.MAX_CODE_UNIT) throw new ArgumentError(i);
}
- return JS('String', r'String.fromCharCode.apply(#, #)', null, charCodes);
+ return JS('String', r'String.fromCharCode.apply(#, #)', null, codeUnits);
}
static String getTimeZoneName(receiver) {

Powered by Google App Engine
This is Rietveld 408576698