| Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| index 8b6f8725ad2f945ae4b9170ad68dae3e29f9da01..fc6113c2fd942542566d89c60be11426b0a98e24 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| @@ -1555,6 +1555,25 @@ class JavaScriptBackend extends Backend {
|
| if (metaTargets != null) metaTargetsUsed.addAll(metaTargets);
|
| }
|
|
|
| + /**
|
| + * Returns `true` if [element] can be accessed through reflection, that is,
|
| + * is in the set of elements covered by a `MirrorsUsed` annotation.
|
| + *
|
| + * This property is used to tag emitted elements with a marker which is
|
| + * checked by the runtime system to throw an exception if an element is
|
| + * accessed (invoked, get, set) that is not accessible for the reflective
|
| + * system.
|
| + */
|
| + bool isAccessibleByReflection(Element element) {
|
| + if (hasInsufficientMirrorsUsed) return true;
|
| + return isNeededForReflection(element);
|
| + }
|
| +
|
| + /**
|
| + * Returns `true` if the emitter must emit the element even though there
|
| + * is no direct use in the program, but because the reflective system may
|
| + * need to access it.
|
| + */
|
| bool isNeededForReflection(Element element) {
|
| if (hasInsufficientMirrorsUsed) return isTreeShakingDisabled;
|
| /// Record the name of [element] in [symbolsUsed]. Return true for
|
|
|