| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 import 'package:kernel/frontend/accessors.dart' | 6 import 'package:kernel/frontend/accessors.dart' |
| 7 show | 7 show |
| 8 Accessor, | 8 Accessor, |
| 9 IndexAccessor, | 9 IndexAccessor, |
| 10 NullAwarePropertyAccessor, | 10 NullAwarePropertyAccessor, |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // arguments of [supertype] corresponds to T, and the type variables of | 290 // arguments of [supertype] corresponds to T, and the type variables of |
| 291 // its element correspond to S. | 291 // its element correspond to S. |
| 292 type = | 292 type = |
| 293 type.subst(supertype.typeArguments, supertype.element.typeVariables); | 293 type.subst(supertype.typeArguments, supertype.element.typeVariables); |
| 294 } | 294 } |
| 295 return kernel.typeToIr(type); | 295 return kernel.typeToIr(type); |
| 296 } | 296 } |
| 297 | 297 |
| 298 // TODO(ahe): Hack. Fix dart2js instead. | 298 // TODO(ahe): Hack. Fix dart2js instead. |
| 299 ir.Name nameToIrName(Name name) { | 299 ir.Name nameToIrName(Name name) { |
| 300 assert(!name.isPrivate || | 300 assert(!name.isPrivate || name.library == currentElement.library); |
| 301 name.library.implementation == currentElement.library.implementation); | |
| 302 return kernel.irName(name.text, currentElement); | 301 return kernel.irName(name.text, currentElement); |
| 303 } | 302 } |
| 304 | 303 |
| 305 List<ir.DartType> computeTypesFromTypes(NodeList nodes, {int expected}) { | 304 List<ir.DartType> computeTypesFromTypes(NodeList nodes, {int expected}) { |
| 306 if (expected == null) { | 305 if (expected == null) { |
| 307 throw "[expected] is null"; | 306 throw "[expected] is null"; |
| 308 } | 307 } |
| 309 List<ir.DartType> types = new List<ir.DartType>(expected); | 308 List<ir.DartType> types = new List<ir.DartType>(expected); |
| 310 Iterator<Node> iterator = nodes?.iterator; | 309 Iterator<Node> iterator = nodes?.iterator; |
| 311 for (int i = 0; i < expected; i++) { | 310 for (int i = 0; i < expected; i++) { |
| (...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2857 : this(null, true, node, initializers); | 2856 : this(null, true, node, initializers); |
| 2858 | 2857 |
| 2859 accept(ir.Visitor v) => throw "unsupported"; | 2858 accept(ir.Visitor v) => throw "unsupported"; |
| 2860 | 2859 |
| 2861 visitChildren(ir.Visitor v) => throw "unsupported"; | 2860 visitChildren(ir.Visitor v) => throw "unsupported"; |
| 2862 | 2861 |
| 2863 String toString() { | 2862 String toString() { |
| 2864 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2863 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
| 2865 } | 2864 } |
| 2866 } | 2865 } |
| OLD | NEW |