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

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

Issue 23045004: Throw when reflecting on elements not covered by a `MirrorsUsed` annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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_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..03de46dea3c0d40ecc84ba8879a83539e0aa3ca3 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1555,6 +1555,13 @@ 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.
ngeoffray 2013/08/29 07:45:49 Please also add a comment for isNeededForReflectio
karlklose 2013/08/29 15:33:37 Done.
+ bool isAccessibleByReflection(Element element) {
+ if (hasInsufficientMirrorsUsed) return true;
+ return isNeededForReflection(element);
+ }
+
bool isNeededForReflection(Element element) {
if (hasInsufficientMirrorsUsed) return isTreeShakingDisabled;
/// Record the name of [element] in [symbolsUsed]. Return true for

Powered by Google App Engine
This is Rietveld 408576698