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

Unified Diff: pkg/compiler/lib/src/universe/universe.dart

Issue 1258243002: Expose getter and setter invocations by name, in dart2js 'World'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/universe.dart
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index 28715e6ddba336b3e180fc36065124cf2f6bd00f..aa90f73fca182335f047d30a87b85a457681bcb2 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -4,6 +4,8 @@
library universe;
+import 'dart:collection';
+
import '../elements/elements.dart';
import '../dart2jslib.dart';
import '../dart_types.dart';
@@ -277,8 +279,21 @@ class Universe {
return masks.add(mask);
}
+ Map<Selector, TypeMaskSet> _asUnmodifiable(Map<Selector, TypeMaskSet> map) {
+ if (map == null) return null;
+ return new UnmodifiableMapView(map);
+ }
+
Map<Selector, TypeMaskSet> invocationsByName(String name) {
- return _invokedNames[name];
+ return _asUnmodifiable(_invokedNames[name]);
+ }
+
+ Map<Selector, TypeMaskSet> getterInvocationsByName(String name) {
+ return _asUnmodifiable(_invokedGetters[name]);
+ }
+
+ Map<Selector, TypeMaskSet> setterInvocationsByName(String name) {
+ return _asUnmodifiable(_invokedSetters[name]);
}
void forEachInvokedName(
« no previous file with comments | « no previous file | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698