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

Unified Diff: lib/compiler/implementation/js_backend/native_emitter.dart

Issue 10832136: Skeleton typedef type implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and updated cf. comments Created 8 years, 4 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 | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/js_backend/native_emitter.dart
diff --git a/lib/compiler/implementation/js_backend/native_emitter.dart b/lib/compiler/implementation/js_backend/native_emitter.dart
index 0840ef05468578f0350705d3ca98603f76e2e60f..6f8adae121dd20e5f4c77ee13f1887316ad46430 100644
--- a/lib/compiler/implementation/js_backend/native_emitter.dart
+++ b/lib/compiler/implementation/js_backend/native_emitter.dart
@@ -184,8 +184,10 @@ function(cls, fields, methods) {
// If [name] is not in [argumentsBuffer], then the parameter is
// an optional parameter that was not provided for that stub.
if (argumentsBuffer.indexOf(name) == -1) return;
- Type type = parameter.computeType(compiler);
+ Type type = parameter.computeType(compiler).unalias(compiler);
if (type is FunctionType) {
+ // The parameter type is a function type either directly or through
+ // typedef(s).
int arity = type.computeArity();
code.add(' $name = $closureConverter($name, $arity);\n');
}
@@ -359,7 +361,11 @@ function(cls, fields, methods) {
compiler.cancel("Is check for type variable", element: element);
return false;
}
- if (element.computeType(compiler) is FunctionType) return false;
+ if (element.computeType(compiler).unalias(compiler) is FunctionType) {
+ // The element type is a function type either directly or through
+ // typedef(s).
+ return false;
+ }
if (!element.isClass()) {
compiler.cancel("Is check does not handle element", element: element);
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698