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

Unified Diff: frog/leg/native_handler.dart

Issue 9583006: Support the literal kind for native classes (ie Console). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
Index: frog/leg/native_handler.dart
===================================================================
--- frog/leg/native_handler.dart (revision 4793)
+++ frog/leg/native_handler.dart (working copy)
@@ -161,8 +161,16 @@
builder.add(thenInstruction);
}
- if (!element.isInstanceMember()) {
- // If the method is a non-instance method, we just generate a direct
+ bool isNativeLiteral;
kasperl 2012/03/02 13:11:33 Initialize to false?
ngeoffray 2012/03/05 08:28:00 Thanks for spotting this. I was convinced it would
+ if (element.enclosingElement.kind == ElementKind.CLASS) {
+ ClassElement classElement = element.enclosingElement;
+ String nativeName = classElement.nativeName.slowToString();
+ isNativeLiteral =
+ builder.compiler.emitter.nativeEmitter.isNativeLiteral(nativeName);
+ }
+ if (!element.isInstanceMember() || isNativeLiteral) {
+ // If the method is a non-instance method, or is a member of a native
+ // class that represents a literal, we just generate a direct
// call to the native method.
visitThen();
builder.stack.add(thenInstruction);

Powered by Google App Engine
This is Rietveld 408576698