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

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: New version integrates feedback, adds less to standard String class. 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 97bd0831189bf122e3aec67b87b26d5a573fd7cb..0688895dee009bbb161357f122de4fbbd5255ff2 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -533,11 +533,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