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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.dart

Issue 764113005: dart2js: Always generate functions for rti substitutions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index f32d77fe9d7c8db25064145476b8b5859d5e7954..157b0a1fe183ee74244217af023d1aefe6ac5843 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -453,7 +453,7 @@ class RuntimeTypes {
* for type arguments in a subtype test.
*
* The result can be:
- * 1) [:null:], if no substituted check is necessary, because the
+ * 1) `null`, if no substituted check is necessary, because the
* type variables are the same or there are no type variables in the class
* that is checked for.
* 2) A list expression describing the type arguments to be used in the
@@ -464,11 +464,10 @@ class RuntimeTypes {
*/
jsAst.Expression getSupertypeSubstitution(
ClassElement cls,
- ClassElement check,
- {bool alwaysGenerateFunction: false}) {
+ ClassElement check) {
Substitution substitution = getSubstitution(cls, check);
if (substitution != null) {
- return substitution.getCode(this, alwaysGenerateFunction);
+ return substitution.getCode(this);
} else {
return null;
}
@@ -871,7 +870,7 @@ class Substitution {
Substitution.function(this.arguments, this.parameters)
: isFunction = true;
- jsAst.Expression getCode(RuntimeTypes rti, bool ensureIsFunction) {
+ jsAst.Expression getCode(RuntimeTypes rti) {
jsAst.Expression declaration(TypeVariableType variable) {
return new jsAst.Parameter(
rti.backend.namer.safeVariableName(variable.name));
@@ -887,10 +886,8 @@ class Substitution {
if (isFunction) {
Iterable<jsAst.Expression> formals = parameters.map(declaration);
return js('function(#) { return # }', [formals, value]);
- } else if (ensureIsFunction) {
- return js('function() { return # }', value);
} else {
- return value;
+ return js('function() { return # }', value);
}
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698