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

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 7a809b704837a6196034428490b1419483c962a2..b01c29b76d51fc6b4c016c6bbd3f26b9ee3486b5 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1534,6 +1534,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.
+ bool isAccessibleByReflection(Element element) {
ahe 2013/08/26 20:41:15 I'm not sure this method is different from isNeede
+ 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