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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart

Issue 940053002: dart2js: add function type to the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 5 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: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index ac8fdf741a8f1621e36f0b643aca912feb009c22..4624980a9758c9711140ee24ed81329cc56a7baf 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -23,6 +23,7 @@ class ContainerBuilder extends CodeEmitterHelper {
bool isClosure = method is InstanceMethod && method.isClosure;
String superAlias = method is InstanceMethod ? method.aliasName : null;
bool hasSuperAlias = superAlias != null;
+ jsAst.Expression memberTypeExpression = method.functionType;
bool needStructuredInfo =
canTearOff || canBeReflected || canBeApplied || hasSuperAlias;
@@ -126,28 +127,13 @@ class ContainerBuilder extends CodeEmitterHelper {
tearOffInfo.add(new jsAst.LiteralString(callSelectorString));
}
- jsAst.Expression memberTypeExpression;
- if (canTearOff || canBeReflected) {
- DartType memberType = method.type;
- if (memberType.containsTypeVariables) {
- jsAst.Expression thisAccess = js(r'this.$receiver');
- memberTypeExpression =
- backend.rti.getSignatureEncoding(memberType, thisAccess);
- } else {
- memberTypeExpression =
- js.number(task.metadataCollector.reifyType(memberType));
- }
- } else {
- memberTypeExpression = js('null');
- }
-
expressions
..addAll(tearOffInfo)
..add((tearOffName == null || member.isAccessor)
? js("null") : js.string(tearOffName))
..add(js.number(requiredParameterCount))
..add(js.number(optionalParameterCount))
- ..add(memberTypeExpression)
+ ..add(memberTypeExpression == null ? js("null") : memberTypeExpression)
..addAll(task.metadataCollector
.reifyDefaultArguments(member).map(js.number));
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698