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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 50313007: Implement dynamic function checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r30897. Created 7 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
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 ac52424185f11ffced91faac42810a47d313674e..1f5919ae49266190fa05130c2aad056bd4a976f3 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]);
+ });
}
/**
@@ -1592,4 +1598,8 @@ if (typeof $printHelperName === "function") {
bool get areAnyElementsDeferred {
return compiler.deferredLoadTask.areAnyElementsDeferred;
}
+
+ void registerReadTypeVariable(TypeVariableElement element) {
+ readTypeVariables.add(element);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698