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

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

Issue 340783011: Take inheritance into account when computing the elements accessible by mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased + fixes Created 6 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: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
index 5aa2477eacae344d2930b80089449f8bdfdada61..212cbeb56662eab225fd1a3ee7f4bb764cbed8ef 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
@@ -224,11 +224,8 @@ class ClassEmitter extends CodeEmitterHelper {
}
}
if (backend.isAccessibleByReflection(field)) {
- reflectionMarker = '-';
- if (backend.isNeededForReflection(field)) {
- DartType type = field.type;
- reflectionMarker = '-${task.metadataEmitter.reifyType(type)}';
- }
+ DartType type = field.type;
+ reflectionMarker = '-${task.metadataEmitter.reifyType(type)}';
}
builder.addField('$fieldName$fieldCode$reflectionMarker');
fieldsAdded = true;
@@ -313,7 +310,7 @@ class ClassEmitter extends CodeEmitterHelper {
classBuilder.addProperty("@", metadata);
}
- if (backend.isNeededForReflection(classElement)) {
+ if (backend.isAccessibleByReflection(classElement)) {
Link typeVars = classElement.typeVariables;
Iterable typeVariableProperties = task.typeVariableHandler
.typeVariablesOf(classElement).map(js.number);
@@ -353,7 +350,7 @@ class ClassEmitter extends CodeEmitterHelper {
String reflectionName = task.getReflectionName(classElement, className);
if (reflectionName != null) {
- if (!backend.isNeededForReflection(classElement)) {
+ if (!backend.isAccessibleByReflection(classElement)) {
enclosingBuilder.addProperty("+$reflectionName", js.number(0));
} else {
List<int> types = <int>[];
@@ -536,7 +533,7 @@ class ClassEmitter extends CodeEmitterHelper {
task.precompiledFunction.add(
js('#.prototype.# = function(#) { return #.# }',
[className, getterName, args, receiver, fieldName]));
- if (backend.isNeededForReflection(member)) {
+ if (backend.isAccessibleByReflection(member)) {
task.precompiledFunction.add(
js('#.prototype.#.${namer.reflectableField} = 1',
[className, getterName]));
@@ -554,7 +551,7 @@ class ClassEmitter extends CodeEmitterHelper {
// TODO: remove 'return'?
js('#.prototype.# = function(#, v) { return #.# = v; }',
[className, setterName, args, receiver, fieldName]));
- if (backend.isNeededForReflection(member)) {
+ if (backend.isAccessibleByReflection(member)) {
task.precompiledFunction.add(
js('#.prototype.#.${namer.reflectableField} = 1',
[className, setterName]));

Powered by Google App Engine
This is Rietveld 408576698