Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 2 |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import 'dart:collection' show HashMap, HashSet; | 6 import 'dart:collection' show HashMap, HashSet; |
| 7 import 'dart:math' show min, max; | 7 import 'dart:math' show min, max; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; | 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1255 // the real superclass. | 1255 // the real superclass. |
| 1256 if (basetypes.any((t) => _deferIfNeeded(t, element))) { | 1256 if (basetypes.any((t) => _deferIfNeeded(t, element))) { |
| 1257 // Fall back to raw type | 1257 // Fall back to raw type |
| 1258 basetypes = | 1258 basetypes = |
| 1259 basetypes.map((t) => fillDynamicTypeArgs(t.element.type)).toList(); | 1259 basetypes.map((t) => fillDynamicTypeArgs(t.element.type)).toList(); |
| 1260 _hasDeferredSupertype.add(element); | 1260 _hasDeferredSupertype.add(element); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 // List of "direct" JS superclasses | 1263 // List of "direct" JS superclasses |
| 1264 var baseclasses = | 1264 var baseclasses = |
| 1265 basetypes.map((t) => _emitType(t, nameType: false)).toList(); | 1265 basetypes.map((t) => _emitConstructorAccess(t, nameType: false)).toList( ); |
|
vsm
2017/01/23 20:45:03
nit: run format.
| |
| 1266 assert(baseclasses.isNotEmpty); | 1266 assert(baseclasses.isNotEmpty); |
| 1267 var heritage = (baseclasses.length == 1) | 1267 var heritage = (baseclasses.length == 1) |
| 1268 ? baseclasses.first | 1268 ? baseclasses.first |
| 1269 : _callHelper('mixin(#)', [baseclasses]); | 1269 : _callHelper('mixin(#)', [baseclasses]); |
| 1270 | 1270 |
| 1271 _loader.finishTopLevel(element); | 1271 _loader.finishTopLevel(element); |
| 1272 | 1272 |
| 1273 return heritage; | 1273 return heritage; |
| 1274 } | 1274 } |
| 1275 | 1275 |
| (...skipping 4577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5853 if (targetIdentifier.staticElement is! PrefixElement) return false; | 5853 if (targetIdentifier.staticElement is! PrefixElement) return false; |
| 5854 var prefix = targetIdentifier.staticElement as PrefixElement; | 5854 var prefix = targetIdentifier.staticElement as PrefixElement; |
| 5855 | 5855 |
| 5856 // The library the prefix is referring to must come from a deferred import. | 5856 // The library the prefix is referring to must come from a deferred import. |
| 5857 var containingLibrary = resolutionMap | 5857 var containingLibrary = resolutionMap |
| 5858 .elementDeclaredByCompilationUnit(target.root as CompilationUnit) | 5858 .elementDeclaredByCompilationUnit(target.root as CompilationUnit) |
| 5859 .library; | 5859 .library; |
| 5860 var imports = containingLibrary.getImportsWithPrefix(prefix); | 5860 var imports = containingLibrary.getImportsWithPrefix(prefix); |
| 5861 return imports.length == 1 && imports[0].isDeferred; | 5861 return imports.length == 1 && imports[0].isDeferred; |
| 5862 } | 5862 } |
| OLD | NEW |