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

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

Issue 1142713004: fixes #184, type literals now use emitTypeName (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: another case 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 | « no previous file | lib/src/utils.dart » ('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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 984
985 // Get the original declaring element. If we had a property accessor, this 985 // Get the original declaring element. If we had a property accessor, this
986 // indirects back to a (possibly synthetic) field. 986 // indirects back to a (possibly synthetic) field.
987 var element = accessor; 987 var element = accessor;
988 if (element is PropertyAccessorElement) element = accessor.variable; 988 if (element is PropertyAccessorElement) element = accessor.variable;
989 989
990 _loader.declareBeforeUse(element); 990 _loader.declareBeforeUse(element);
991 991
992 var name = element.name; 992 var name = element.name;
993 993
994 // type literal
995 if (element is ClassElement ||
996 element is DynamicElementImpl ||
997 element is FunctionTypeAliasElement) {
998 return _emitTypeName(fillDynamicTypeArgs(element.type, types));
999 }
1000
994 // library member 1001 // library member
995 if (element.enclosingElement is CompilationUnitElement) { 1002 if (element.enclosingElement is CompilationUnitElement) {
996 return _maybeQualifiedName( 1003 return _maybeQualifiedName(
997 element, _emitMemberName(name, isStatic: true)); 1004 element, _emitMemberName(name, isStatic: true));
998 } 1005 }
999 1006
1000 // Unqualified class member. This could mean implicit-this, or implicit 1007 // Unqualified class member. This could mean implicit-this, or implicit
1001 // call to a static from the same class. 1008 // call to a static from the same class.
1002 if (element is ClassMemberElement && element is! ConstructorElement) { 1009 if (element is ClassMemberElement && element is! ConstructorElement) {
1003 bool isStatic = element.isStatic; 1010 bool isStatic = element.isStatic;
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 2475
2469 /// A special kind of element created by the compiler, signifying a temporary 2476 /// A special kind of element created by the compiler, signifying a temporary
2470 /// variable. These objects use instance equality, and should be shared 2477 /// variable. These objects use instance equality, and should be shared
2471 /// everywhere in the tree where they are treated as the same variable. 2478 /// everywhere in the tree where they are treated as the same variable.
2472 class TemporaryVariableElement extends LocalVariableElementImpl { 2479 class TemporaryVariableElement extends LocalVariableElementImpl {
2473 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); 2480 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name);
2474 2481
2475 int get hashCode => identityHashCode(this); 2482 int get hashCode => identityHashCode(this);
2476 bool operator ==(Object other) => identical(this, other); 2483 bool operator ==(Object other) => identical(this, other);
2477 } 2484 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698