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

Unified Diff: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart

Issue 3009903002: Pass in `this` as a free variable to the closure class (Closed)
Patch Set: merge with master Created 3 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: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index ae711e06405787400c276287c898e9028430f077..b1591635bb0adf4bd38c61f17880ab9ac6fc9338 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -32,6 +32,7 @@ import '../js_backend/runtime_types.dart'
TypeCheck,
TypeChecks;
import '../js_emitter/sorter.dart';
+import '../js_model/closure.dart' show JClosureField;
import '../util/util.dart' show Setlet;
import '../world.dart';
@@ -180,8 +181,10 @@ class RuntimeTypeGenerator {
if (!method.isAbstract) {
ScopeInfo scopeInfo = _closureDataLookup.getScopeInfo(method);
if (scopeInfo is ClosureRepresentationInfo) {
- ClosureFieldElement thisLocal = scopeInfo.thisFieldEntity;
+ FieldEntity thisLocal = scopeInfo.thisFieldEntity;
if (thisLocal != null) {
+ assert(
+ thisLocal is ClosureFieldElement || thisLocal is JClosureField);
jsAst.Name thisName = _namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);
}

Powered by Google App Engine
This is Rietveld 408576698