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

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 1145283002: Use short array syntax in method signatures (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 5 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 unified diff | Download patch
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dev_compiler.src.codegen.js_codegen; 5 library dev_compiler.src.codegen.js_codegen;
6 6
7 import 'dart:collection' show HashSet, HashMap; 7 import 'dart:collection' show HashSet, HashMap;
8 8
9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 if (!(node.isSetter || node.isGetter || node.isAbstract)) { 592 if (!(node.isSetter || node.isGetter || node.isAbstract)) {
593 var name = node.name.name; 593 var name = node.name.name;
594 var element = node.element; 594 var element = node.element;
595 var inheritedElement = 595 var inheritedElement =
596 classElem.lookUpInheritedConcreteMethod(name, currentLibrary); 596 classElem.lookUpInheritedConcreteMethod(name, currentLibrary);
597 if (inheritedElement != null && 597 if (inheritedElement != null &&
598 inheritedElement.type == element.type) continue; 598 inheritedElement.type == element.type) continue;
599 var unary = node.parameters.parameters.isEmpty; 599 var unary = node.parameters.parameters.isEmpty;
600 var memberName = _emitMemberName(name, 600 var memberName = _emitMemberName(name,
601 type: cType, unary: unary, isStatic: node.isStatic); 601 type: cType, unary: unary, isStatic: node.isStatic);
602 var parts = _emitFunctionTypeParts(element.type);
602 var property = 603 var property =
603 new JS.Property(memberName, _emitTypeName(element.type)); 604 new JS.Property(memberName, new JS.ArrayInitializer(parts));
604 if (node.isStatic) { 605 if (node.isStatic) {
605 tStatics.add(property); 606 tStatics.add(property);
606 sNames.add(memberName); 607 sNames.add(memberName);
607 } else tMethods.add(property); 608 } else tMethods.add(property);
608 } 609 }
609 } 610 }
610 build(name, elements) { 611 build(name, elements) {
611 var o = 612 var o =
612 new JS.ObjectInitializer(elements, vertical: elements.length > 1); 613 new JS.ObjectInitializer(elements, vertical: elements.length > 1);
613 var e = js.call('() => #', o); 614 var e = js.call('() => #', o);
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 2583
2583 /// A special kind of element created by the compiler, signifying a temporary 2584 /// A special kind of element created by the compiler, signifying a temporary
2584 /// variable. These objects use instance equality, and should be shared 2585 /// variable. These objects use instance equality, and should be shared
2585 /// everywhere in the tree where they are treated as the same variable. 2586 /// everywhere in the tree where they are treated as the same variable.
2586 class TemporaryVariableElement extends LocalVariableElementImpl { 2587 class TemporaryVariableElement extends LocalVariableElementImpl {
2587 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); 2588 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name);
2588 2589
2589 int get hashCode => identityHashCode(this); 2590 int get hashCode => identityHashCode(this);
2590 bool operator ==(Object other) => identical(this, other); 2591 bool operator ==(Object other) => identical(this, other);
2591 } 2592 }
OLDNEW
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698