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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 16154021: Implement reflecting on uninstantiated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update comment in second test. Created 7 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: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index bae5ebe295b038c13e1ab687d27048b082d7c92b..841c0a88fed00aee9a2760345450609dc7b2014a 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -613,7 +613,7 @@ class CodeEmitterTask extends CompilerTask {
*/
js('var classData = desc[""], supr, name = cls, fields = classData'),
optional(
- compiler.mirrorSystemClass != null,
+ compiler.mirrorsEnabled,
js.if_('typeof classData == "object" && '
'classData instanceof Array',
[js('classData = fields = classData[0]')])),
@@ -647,7 +647,7 @@ class CodeEmitterTask extends CompilerTask {
])),
js('var constructor = defineClass(name, cls, fields, desc)'),
- optional(compiler.mirrorSystemClass != null,
+ optional(compiler.mirrorsEnabled,
js('constructor["${namer.metadataField}"] = desc')),
js('isolateProperties[cls] = constructor'),
js.if_('supr', js('pendingClasses[cls] = supr'))
@@ -1470,7 +1470,7 @@ class CodeEmitterTask extends CompilerTask {
if (!classIsNative || needsAccessor) {
buffer.write(separator);
separator = ',';
- if (compiler.mirrorSystemClass != null) {
+ if (compiler.mirrorsEnabled) {
var metadata = buildMetadataFunction(member);
fieldMetadata.add(metadata);
if (metadata != null) {
@@ -2972,7 +2972,7 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
/// annotated with itself. The metadata function is used by
/// mirrors_patch to implement DeclarationMirror.metadata.
jsAst.Fun buildMetadataFunction(Element element) {
- if (compiler.mirrorSystemClass == null) return null;
+ if (!compiler.mirrorsEnabled) return null;
var metadata = [];
Link link = element.metadata;
// TODO(ahe): Why is metadata sometimes null?

Powered by Google App Engine
This is Rietveld 408576698