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

Unified Diff: dart/frog/leg/lib/js_helper.dart

Issue 9426041: Implement .dynamic and throw ObjectNotClosureException in forEach interceptor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: changes Created 8 years, 10 months 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
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/js_helper.dart
diff --git a/dart/frog/leg/lib/js_helper.dart b/dart/frog/leg/lib/js_helper.dart
index d81866088c875a671399a787d88b57d9284a09ba..121ef8f5d83a00a194b849c0689214c18a235da4 100644
--- a/dart/frog/leg/lib/js_helper.dart
+++ b/dart/frog/leg/lib/js_helper.dart
@@ -572,7 +572,9 @@ builtin$forEach$1(receiver, f) {
checkNull(receiver);
if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.forEach(f));
+
kasperl 2012/02/21 07:18:08 Too many newlines.
var length = JS("num", @"$0.length", receiver);
+ if (length > 0 && f === null) throw new ObjectNotClosureException(); // Sigh.
kasperl 2012/02/21 07:18:08 Maybe change 'Sigh' to something more actionable :
for (var i = 0; i < length; i++) {
f(JS("Object", @"$0[$1]", receiver, i));
}
@@ -1153,3 +1155,6 @@ builtin$hashCode$0(receiver) {
}
return UNINTERCEPTED(receiver.hashCode());
}
+
+// TODO(ahe): Dynamic may be overridden.
+builtin$get$dynamic(receiver) => receiver;
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698