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

Side by Side Diff: lib/src/compiler/code_generator.dart

Issue 2011973002: Add generic types to Sort and Comparable. Fix crasher bug in codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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_sdk.js ('k') | tool/input_sdk/lib/core/comparable.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 import 'dart:collection' show HashMap, HashSet; 5 import 'dart:collection' show HashMap, HashSet;
6 import 'dart:math' show min, max; 6 import 'dart:math' show min, max;
7 7
8 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 8 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3104 if (name != null) { 3104 if (name != null) {
3105 ctor = new JS.PropertyAccess(ctor, _propertyName(name.name)); 3105 ctor = new JS.PropertyAccess(ctor, _propertyName(name.name));
3106 } 3106 }
3107 } else { 3107 } else {
3108 ctor = _emitConstructorName(element, type, name); 3108 ctor = _emitConstructorName(element, type, name);
3109 isFactory = element.isFactory; 3109 isFactory = element.isFactory;
3110 } 3110 }
3111 var args = _visit(argumentList) as List<JS.Expression>; 3111 var args = _visit(argumentList) as List<JS.Expression>;
3112 return isFactory ? new JS.Call(ctor, args) : new JS.New(ctor, args); 3112 return isFactory ? new JS.Call(ctor, args) : new JS.New(ctor, args);
3113 } 3113 }
3114 if (_isObjectLiteral(element.enclosingElement)) { 3114 if (element != null && _isObjectLiteral(element.enclosingElement)) {
Jacob 2016/05/25 16:38:04 this was crashing on some google3 code.
3115 return _emitObjectLiteral(argumentList); 3115 return _emitObjectLiteral(argumentList);
3116 } 3116 }
3117 if (isConst) return _emitConst(emitNew); 3117 if (isConst) return _emitConst(emitNew);
3118 return emitNew(); 3118 return emitNew();
3119 } 3119 }
3120 3120
3121 bool _isObjectLiteral(ClassElement classElem) { 3121 bool _isObjectLiteral(ClassElement classElem) {
3122 return findAnnotation(classElem, isPublicJSAnnotation) != null && 3122 return findAnnotation(classElem, isPublicJSAnnotation) != null &&
3123 findAnnotation(classElem, isJSAnonymousAnnotation) != null; 3123 findAnnotation(classElem, isJSAnonymousAnnotation) != null;
3124 } 3124 }
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 } 4558 }
4559 4559
4560 bool isLibraryPrefix(Expression node) => 4560 bool isLibraryPrefix(Expression node) =>
4561 node is SimpleIdentifier && node.staticElement is PrefixElement; 4561 node is SimpleIdentifier && node.staticElement is PrefixElement;
4562 4562
4563 LibraryElement _getLibrary(AnalysisContext c, String uri) => 4563 LibraryElement _getLibrary(AnalysisContext c, String uri) =>
4564 c.computeLibraryElement(c.sourceFactory.forUri(uri)); 4564 c.computeLibraryElement(c.sourceFactory.forUri(uri));
4565 4565
4566 bool _isDartRuntime(LibraryElement l) => 4566 bool _isDartRuntime(LibraryElement l) =>
4567 l.isInSdk && l.source.uri.toString() == 'dart:_runtime'; 4567 l.isInSdk && l.source.uri.toString() == 'dart:_runtime';
OLDNEW
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/lib/core/comparable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698