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

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: Backend updated 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
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 d2c38251314b9597450d9e73526053a869b47b8f..f16d16835c5e68d051302189f6f82c0bc7db092a 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);

Powered by Google App Engine
This is Rietveld 408576698