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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 2076713002: Move type tagging logic out of setSignature (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Move type tagging logic out of setSignature Created 4 years, 6 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: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index 3efe6f66ccbdef8a95d4eca113cd170268abc7a7..efd3de99c60dc02ece3c50b063de1bab89e6d39e 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -1614,6 +1614,12 @@ class CodeGenerator extends GeneralizingAstVisitor
var sig = new JS.ObjectInitializer(sigFields);
body.add(js.statement('dart.setSignature(#, #);', [className, sig]));
}
+ // Add static property dart._runtimeType to Object.
+ // All other Dart classes will (statically) inherit this property.
+ if (classElem == objectClass) {
+ body.add(js.statement('dart.tagComputed(#, () => #.#);',
+ [className, emitLibraryName(dartCoreLibrary), 'Type']));
+ }
}
/// Ensure `dartx.` symbols we will use are present.

Powered by Google App Engine
This is Rietveld 408576698