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

Unified Diff: frog/leg/native_handler.dart

Issue 9750003: Write our JS blobs for handling native classes in Dart. (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
Index: frog/leg/native_handler.dart
===================================================================
--- frog/leg/native_handler.dart (revision 5817)
+++ frog/leg/native_handler.dart (working copy)
@@ -30,12 +30,14 @@
void processNativeClassesInLibrary(Compiler compiler,
LibraryElement library) {
+ bool hasNativeClass = false;
for (Link<Element> link = library.topLevelElements;
!link.isEmpty(); link = link.tail) {
Element element = link.head;
if (element.kind == ElementKind.CLASS) {
ClassElement classElement = element;
if (classElement.isNative()) {
+ hasNativeClass = true;
compiler.registerInstantiatedClass(classElement);
// Also parse the node to know all its methods because
// otherwise it will only be parsed if there is a call to
@@ -51,6 +53,12 @@
}
}
}
+ if (hasNativeClass) {
+ compiler.registerStaticUse(compiler.findHelper(
+ const SourceString('dynamicFunction')));
+ compiler.registerStaticUse(compiler.findHelper(
+ const SourceString('dynamicSetMetadata')));
+ }
}
void maybeEnableNative(Compiler compiler,

Powered by Google App Engine
This is Rietveld 408576698