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

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

Issue 11412105: - Move length getter and setter interceptors to the new interceptor scheme. (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/js_array.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/js_array.dart (revision 15190)
+++ sdk/lib/_internal/compiler/implementation/lib/js_array.dart (working copy)
@@ -168,4 +168,13 @@
int get hashCode => Primitives.objectHashCode(receiver);
Type get runtimeType => createRuntimeType('List');
+
+ int get length => JS('int', r'#.length', this);
ahe 2012/11/23 06:51:23 Is the compiler smart enough to elide the return t
ngeoffray 2012/11/23 12:01:17 Yes. I have just double checked.
+
+ void set length(int newLength) {
+ if (newLength is !int) throw new ArgumentError(newLength);
+ if (newLength < 0) throw new RangeError.value(newLength);
+ checkGrowable(this, 'set length');
+ JS('void', r'#.length = #', this, newLength);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698