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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 2642063003: Use entities in class_stub_generator. (Closed)
Patch Set: Created 3 years, 11 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: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 97ad11cc52e0f3c5d8cec3ddf72f078f4c01bc5a..c46cc9bf812ffeb25b950d87dbb3e073ba2c3fc8 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1497,9 +1497,19 @@ class Namer {
}
/// Returns [staticStateHolder] or one of [reservedGlobalObjectNames].
+ // TODO(johnniwinther): Verify that the implementation can be changed to
+ // `globalObjectForLibrary(element.library)`.
+ String globalObjectForMethod(MethodElement element) =>
+ globalObjectFor(element);
+
+ /// Returns [staticStateHolder] or one of [reservedGlobalObjectNames].
String globalObjectFor(Element element) {
if (_isPropertyOfStaticStateHolder(element)) return staticStateHolder;
- LibraryElement library = element.library;
+ return globalObjectForLibrary(element.library);
+ }
+
+ /// Returns the [reservedGlobalObjectNames] for [library].
+ String globalObjectForLibrary(LibraryElement library) {
if (library == helpers.interceptorsLibrary) return 'J';
if (library.isInternalLibrary) return 'H';
if (library.isPlatformLibrary) {

Powered by Google App Engine
This is Rietveld 408576698