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

Unified Diff: frog/leg/namer.dart

Issue 9284022: Operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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
« no previous file with comments | « frog/leg/lib/core.dart ('k') | frog/leg/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/namer.dart
===================================================================
--- frog/leg/namer.dart (revision 3645)
+++ frog/leg/namer.dart (working copy)
@@ -9,6 +9,7 @@
final Compiler compiler;
static final CLOSURE_INVOCATION_NAME = const SourceString('\$call');
+ static final OPERATOR_EQUALS = const SourceString('operator\$eq');
static Set<String> _jsReserved = null;
Set<String> get jsReserved() {
@@ -60,9 +61,9 @@
String _computeGuess(Element element) {
assert(!element.isInstanceMember());
if (element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
- SourceString name = getConstructorName(element);
FunctionElement functionElement = element;
- return instanceMethodName(name, functionElement.parameterCount(compiler));
+ return instanceMethodName(
+ element.name, functionElement.parameterCount(compiler));
} else {
// TODO(floitsch): deal with named constructors.
String name = '${element.name}';
@@ -83,11 +84,6 @@
return '${getName(element)}\$bailout';
}
- SourceString getConstructorName(FunctionElement constructor) {
- String dartName = constructor.name.stringValue;
- return new SourceString(dartName.replaceFirst('\.', '\$'));
- }
-
/**
* Returns a preferred JS-id for the given element. The returned id is
* guaranteed to be a valid JS-id. Globals and static fields are furthermore
@@ -101,7 +97,7 @@
SourceString name;
if (element.kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
ConstructorBodyElement bodyElement = element;
- SourceString name = getConstructorName(bodyElement.constructor);
+ SourceString name = bodyElement.constructor.name;
return instanceMethodName(name, bodyElement.parameterCount(compiler));
} else if (element.kind == ElementKind.FUNCTION) {
FunctionElement functionElement = element;
« no previous file with comments | « frog/leg/lib/core.dart ('k') | frog/leg/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698