mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
dart2js: Do not emit type metadata for fields declared in non-reflectable classes.
BUG= R=karlklose@google.com, zarah@google.com Review URL: https://codereview.chromium.org//1169453005
This commit is contained in:
parent
3d5f2b45bf
commit
67537ffbd7
1 changed files with 6 additions and 1 deletions
|
@ -161,7 +161,12 @@ class ClassEmitter extends CodeEmitterHelper {
|
|||
fieldCode = FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE];
|
||||
}
|
||||
}
|
||||
if (backend.isAccessibleByReflection(fieldElement)) {
|
||||
// Fields can only be reflected if their declaring class is reflectable
|
||||
// (as they are only accessible via [ClassMirror.declarations]. However,
|
||||
// set/get operations can be performed on them, so they are reflectable
|
||||
// in some sense.
|
||||
if (backend.isAccessibleByReflection(fieldElement) &&
|
||||
backend.isAccessibleByReflection(fieldElement.enclosingClass)) {
|
||||
DartType type = fieldElement.type;
|
||||
reflectionMarker = '-${task.metadataCollector.reifyType(type)}';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue