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

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

Issue 2908153003: It's alive! (Closed)
Patch Set: Created 3 years, 7 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 119cccfb4ee5031505f7f24636000c2c5578ff1c..67cd86762cef7e40766a29aadc96204ab030dc35 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -772,8 +772,8 @@ class Namer {
}
/// Annotated name for [method] encoding arity and named parameters.
- jsAst.Name instanceMethodName(MethodElement method) {
- if (method.isGenerativeConstructorBody) {
+ jsAst.Name instanceMethodName(FunctionEntity method) {
+ if (method is ConstructorBodyElement) {
Siggi Cherem (dart-lang) 2017/05/30 22:10:20 we'll need this for the J model too, correct? Mayb
Johnni Winther 2017/05/31 08:19:31 Done.
return constructorBodyName(method);
}
return invocationName(new Selector.fromElement(method));
@@ -1421,7 +1421,7 @@ class Namer {
/// [operatorIsPrefix] or [operatorAsPrefix]. If this is a function type,
/// then by convention, an underscore must also separate [operatorIsPrefix]
/// from the type name.
- jsAst.Name runtimeTypeName(TypeDeclarationElement element) {
+ jsAst.Name runtimeTypeName(Entity element) {
if (element == null) return _literalDynamic;
// The returned name affects both the global and instance member namespaces:
//
@@ -1441,7 +1441,7 @@ class Namer {
///
/// This is both the *runtime type* of the class (see [runtimeTypeName])
/// and a global property name in which to store its JS constructor.
- jsAst.Name className(ClassElement class_) => _disambiguateGlobalType(class_);
+ jsAst.Name className(ClassEntity class_) => _disambiguateGlobalType(class_);
/// Property name on which [member] can be accessed directly,
/// without clashing with another JS property name.
@@ -1477,7 +1477,7 @@ class Namer {
///
/// The name is not necessarily unique to [method], since a static method
/// may share its name with an instance method.
- jsAst.Name methodPropertyName(MethodElement method) {
+ jsAst.Name methodPropertyName(FunctionEntity method) {
return method.isInstanceMember
? instanceMethodName(method)
: globalPropertyNameForMember(method);
@@ -1510,12 +1510,6 @@ 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) =>
- globalObjectForMember(element);
-
- /// Returns [staticStateHolder] or one of [reservedGlobalObjectNames].
String globalObjectForMember(MemberEntity element) {
if (_isPropertyOfStaticStateHolder(element)) return staticStateHolder;
return globalObjectForLibrary(element.library);
@@ -1556,8 +1550,8 @@ class Namer {
return deriveLazyInitializerName(name);
}
- jsAst.Name staticClosureName(Element element) {
- assert(Elements.isStaticOrTopLevelFunction(element));
+ jsAst.Name staticClosureName(FunctionEntity element) {
+ assert(element.isTopLevel || element.isStatic);
String enclosing =
element.enclosingClass == null ? "" : element.enclosingClass.name;
String library = _proposeNameForLibrary(element.library);
@@ -1622,7 +1616,7 @@ class Namer {
return operatorIs(interfaceType.element);
}
- jsAst.Name operatorIs(ClassElement element) {
+ jsAst.Name operatorIs(ClassEntity element) {
// TODO(erikcorry): Reduce from $isx to ix when we are minifying.
return new CompoundName(
[new StringBackedName(operatorIsPrefix), runtimeTypeName(element)]);
@@ -1637,7 +1631,7 @@ class Namer {
return name;
}
- jsAst.Name substitutionName(ClassElement element) {
+ jsAst.Name substitutionName(ClassEntity element) {
return new CompoundName(
[new StringBackedName(operatorAsPrefix), runtimeTypeName(element)]);
}

Powered by Google App Engine
This is Rietveld 408576698