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

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

Issue 9773026: Add a method on native classes for is checks. Reduces the code for generating is checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « frog/leg/emitter.dart ('k') | frog/leg/native_emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/lib/native_helper.dart
===================================================================
--- frog/leg/lib/native_helper.dart (revision 5868)
+++ frog/leg/lib/native_helper.dart (working copy)
@@ -257,21 +257,3 @@
_dynamicMetadata.add(new MetaInfo(tag, tags, set));
}
}
-
-// Initialized by the compiler.
-var isChecksHelper;
-
-// This method will be called for 'is' checks on native types.
-// It takes the object on which the 'is' check is being done, and the
-// property name for the type check. The method patches the real
-// prototype of the object with the value from the Dart object
-// (see [generateNativeClass]).
-bool dynamicIsCheck(obj, String typeName) {
- if (isJsArray(obj)) return false;
- // Check if the Dart object corresponding to this class has the property.
- var res = JS('bool', '!!#[#][#]', isChecksHelper, getTypeNameOf(obj),
- typeName);
- var proto = JS('var', 'Object.getPrototypeOf(#)', obj);
- defineProperty(proto, typeName, res);
- return res;
-}
« no previous file with comments | « frog/leg/emitter.dart ('k') | frog/leg/native_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698