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

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

Issue 11358217: Add a getter interceptor to the new interceptor scheme. Also cleanup the "this" that turns into a r… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/interceptors.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (revision 14875)
+++ sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (working copy)
@@ -21,6 +21,14 @@
if (index >= length) throw new RangeError.value(index);
return JS('int', r'#.charCodeAt(#)', this, index);
}
+
+ List<int> get charCodes {
+ List<int> result = new List<int>(length);
+ for (int i = 0; i < length; i++) {
+ result[i] = charCodeAt(i);
+ }
+ return result;
+ }
}
/**
@@ -670,16 +678,6 @@
return 0x1fffffff & (hash + (0x00003fff & hash) << 15);
}
-get$charCodes(receiver) {
- if (receiver is !String) return UNINTERCEPTED(receiver.charCodes);
- int len = receiver.length;
- List<int> result = new List<int>(len);
- for (int i = 0; i < len; i++) {
- result[i] = receiver.charCodeAt(i);
- }
- return result;
-}
-
get$isEven(receiver) {
if (receiver is !int) return UNINTERCEPTED(receiver.isEven);
return (receiver & 1) == 0;

Powered by Google App Engine
This is Rietveld 408576698