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

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: 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 | test/codegen/expect/misc.js » ('j') | test/codegen/expect/misc.js » ('J')
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 || element is FunctionTypeAliasElement) {
996 return _emitTypeName(fillDynamicTypeArgs(element.type, types));
997 }
998
994 // library member 999 // library member
995 if (element.enclosingElement is CompilationUnitElement) { 1000 if (element.enclosingElement is CompilationUnitElement) {
996 return _maybeQualifiedName( 1001 return _maybeQualifiedName(
997 element, _emitMemberName(name, isStatic: true)); 1002 element, _emitMemberName(name, isStatic: true));
998 } 1003 }
999 1004
1000 // Unqualified class member. This could mean implicit-this, or implicit 1005 // Unqualified class member. This could mean implicit-this, or implicit
1001 // call to a static from the same class. 1006 // call to a static from the same class.
1002 if (element is ClassMemberElement && element is! ConstructorElement) { 1007 if (element is ClassMemberElement && element is! ConstructorElement) {
1003 bool isStatic = element.isStatic; 1008 bool isStatic = element.isStatic;
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 2473
2469 /// A special kind of element created by the compiler, signifying a temporary 2474 /// A special kind of element created by the compiler, signifying a temporary
2470 /// variable. These objects use instance equality, and should be shared 2475 /// variable. These objects use instance equality, and should be shared
2471 /// everywhere in the tree where they are treated as the same variable. 2476 /// everywhere in the tree where they are treated as the same variable.
2472 class TemporaryVariableElement extends LocalVariableElementImpl { 2477 class TemporaryVariableElement extends LocalVariableElementImpl {
2473 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); 2478 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name);
2474 2479
2475 int get hashCode => identityHashCode(this); 2480 int get hashCode => identityHashCode(this);
2476 bool operator ==(Object other) => identical(this, other); 2481 bool operator ==(Object other) => identical(this, other);
2477 } 2482 }
OLDNEW
« no previous file with comments | « no previous file | test/codegen/expect/misc.js » ('j') | test/codegen/expect/misc.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698