Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
index 60db17c8d4dfe5e3b2b4b2d3be9cde9a4d05833d..fb8f2ed64b3243ec94a6703e4e147f95fd7099b0 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
@@ -42,6 +42,10 @@ class CodeEmitterTask extends CompilerTask { |
final Map<ClassElement, Map<String, jsAst.Expression>> additionalProperties = |
new Map<ClassElement, Map<String, jsAst.Expression>>(); |
+ /// Records if a type variable is read dynamically for type tests. |
+ final Set<TypeVariableElement> readTypeVariables = |
+ new Set<TypeVariableElement>(); |
+ |
// TODO(ngeoffray): remove this field. |
Set<ClassElement> instantiatedClasses; |
@@ -744,8 +748,10 @@ class CodeEmitterTask extends CompilerTask { |
} |
void generateClass(ClassElement classElement, ClassBuilder properties) { |
- classEmitter.generateClass( |
- classElement, properties, additionalProperties[classElement]); |
+ compiler.withCurrentElement(classElement, () { |
+ classEmitter.generateClass( |
+ classElement, properties, additionalProperties[classElement]); |
+ }); |
} |
int _selectorRank(Selector selector) { |
@@ -1606,4 +1612,8 @@ if (typeof $printHelperName === "function") { |
bool get areAnyElementsDeferred { |
return compiler.deferredLoadTask.areAnyElementsDeferred; |
} |
+ |
+ void registerReadTypeVariable(TypeVariableElement element) { |
+ readTypeVariables.add(element); |
+ } |
} |