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

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

Issue 2731163002: Split js interop registration into library/class/member elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 9 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 | « pkg/compiler/lib/src/js_backend/minify_namer.dart ('k') | pkg/compiler/lib/src/js_backend/native_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1bac3f30410efdf86a75dedb9365eee24ef9f2d9..bf19053a0c35ca60d708a11a63f9788d2ff8950d 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -771,36 +771,6 @@ class Namer {
return invocationName(new Selector.fromElement(method));
}
- String _jsNameHelper(Element e) {
- String jsInteropName = _nativeData.getJsInteropName(e);
- if (jsInteropName != null && jsInteropName.isNotEmpty) return jsInteropName;
- return e.isLibrary ? 'self' : _nativeData.getUnescapedJSInteropName(e.name);
- }
-
- /// Returns a JavaScript path specifying the context in which
- /// [element.fixedBackendName] should be evaluated. Only applicable for
- /// elements using typed JavaScript interop.
- /// For example: fixedBackendPath for the static method createMap in the
- /// Map class of the goog.map JavaScript library would have path
- /// "goog.maps.Map".
- String fixedBackendMethodPath(MethodElement element) {
- return _fixedBackendPath(element);
- }
-
- String _fixedBackendPath(Element element) {
- if (!_nativeData.isJsInterop(element)) return null;
- if (element.isInstanceMember) return 'this';
- if (element.isConstructor) return _fixedBackendPath(element.enclosingClass);
- if (element.isLibrary) return 'self';
- var sb = new StringBuffer();
- sb..write(_jsNameHelper(element.library));
-
- if (element.enclosingClass != null && element.enclosingClass != element) {
- sb..write('.')..write(_jsNameHelper(element.enclosingClass));
- }
- return sb.toString();
- }
-
/// Returns the annotated name for a variant of `call`.
/// The result has the form:
///
« no previous file with comments | « pkg/compiler/lib/src/js_backend/minify_namer.dart ('k') | pkg/compiler/lib/src/js_backend/native_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698