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

Side by Side Diff: dart/lib/compiler/implementation/js_backend/emitter.dart

Issue 10905211: Clean up operator names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * A function element that represents a closure call. The signature is copied 6 * A function element that represents a closure call. The signature is copied
7 * from the given element. 7 * from the given element.
8 */ 8 */
9 class ClosureInvocationElement extends FunctionElement { 9 class ClosureInvocationElement extends FunctionElement {
10 ClosureInvocationElement(SourceString name, 10 ClosureInvocationElement(SourceString name,
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 */ 728 */
729 void emitInstanceMembers(ClassElement classElement, 729 void emitInstanceMembers(ClassElement classElement,
730 CodeBuffer buffer, 730 CodeBuffer buffer,
731 bool needsLeadingComma) { 731 bool needsLeadingComma) {
732 assert(invariant(classElement, classElement.isDeclaration)); 732 assert(invariant(classElement, classElement.isDeclaration));
733 bool needsComma = needsLeadingComma; 733 bool needsComma = needsLeadingComma;
734 void defineInstanceMember(String name, CodeBuffer memberBuffer) { 734 void defineInstanceMember(String name, CodeBuffer memberBuffer) {
735 if (needsComma) buffer.add(','); 735 if (needsComma) buffer.add(',');
736 needsComma = true; 736 needsComma = true;
737 buffer.add('\n'); 737 buffer.add('\n');
738 buffer.add(' $name: '); 738 // TODO(ahe): Only add quotes around name when needed.
739 buffer.add(' "$name": ');
739 buffer.add(memberBuffer); 740 buffer.add(memberBuffer);
740 } 741 }
741 742
742 classElement.implementation.forEachMember(includeBackendMembers: true, 743 classElement.implementation.forEachMember(includeBackendMembers: true,
743 f: (ClassElement enclosing, Element member) { 744 f: (ClassElement enclosing, Element member) {
744 assert(invariant(classElement, member.isDeclaration)); 745 assert(invariant(classElement, member.isDeclaration));
745 if (member.isInstanceMember()) { 746 if (member.isInstanceMember()) {
746 addInstanceMember(member, defineInstanceMember); 747 addInstanceMember(member, defineInstanceMember);
747 } 748 }
748 }); 749 });
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 const String HOOKS_API_USAGE = """ 1513 const String HOOKS_API_USAGE = """
1513 // Generated by dart2js, the Dart to JavaScript compiler. 1514 // Generated by dart2js, the Dart to JavaScript compiler.
1514 // The code supports the following hooks: 1515 // The code supports the following hooks:
1515 // dartPrint(message) - if this function is defined it is called 1516 // dartPrint(message) - if this function is defined it is called
1516 // instead of the Dart [print] method. 1517 // instead of the Dart [print] method.
1517 // dartMainRunner(main) - if this function is defined, the Dart [main] 1518 // dartMainRunner(main) - if this function is defined, the Dart [main]
1518 // method will not be invoked directly. 1519 // method will not be invoked directly.
1519 // Instead, a closure that will invoke [main] is 1520 // Instead, a closure that will invoke [main] is
1520 // passed to [dartMainRunner]. 1521 // passed to [dartMainRunner].
1521 """; 1522 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698