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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 for (FunctionElement functionElement in kernel.functions.keys) { | 40 for (FunctionElement functionElement in kernel.functions.keys) { |
41 _nodeToElement[kernel.functions[functionElement]] = functionElement; | 41 _nodeToElement[kernel.functions[functionElement]] = functionElement; |
42 } | 42 } |
43 for (ClassElement classElement in kernel.classes.keys) { | 43 for (ClassElement classElement in kernel.classes.keys) { |
44 _nodeToElement[kernel.classes[classElement]] = classElement; | 44 _nodeToElement[kernel.classes[classElement]] = classElement; |
45 } | 45 } |
46 for (LibraryElement libraryElement in kernel.libraries.keys) { | 46 for (LibraryElement libraryElement in kernel.libraries.keys) { |
47 _nodeToElement[kernel.libraries[libraryElement]] = libraryElement; | 47 _nodeToElement[kernel.libraries[libraryElement]] = libraryElement; |
48 } | 48 } |
| 49 for (LocalFunctionElement localFunction in kernel.localFunctions.keys) { |
| 50 _nodeToElement[kernel.localFunctions[localFunction]] = localFunction; |
| 51 } |
49 _typeConverter = new DartTypeConverter(this); | 52 _typeConverter = new DartTypeConverter(this); |
50 } | 53 } |
51 | 54 |
52 Compiler get _compiler => _backend.compiler; | 55 Compiler get _compiler => _backend.compiler; |
53 TreeElements get _elements => _resolvedAst.elements; | 56 TreeElements get _elements => _resolvedAst.elements; |
54 | 57 |
55 ConstantValue getConstantForSymbol(ir.SymbolLiteral node) { | 58 ConstantValue getConstantForSymbol(ir.SymbolLiteral node) { |
56 ast.Node astNode = getNode(node); | 59 ast.Node astNode = getNode(node); |
57 ConstantValue constantValue = _backend.constants | 60 ConstantValue constantValue = _backend.constants |
58 .getConstantValueForNode(astNode, _resolvedAst.elements); | 61 .getConstantValueForNode(astNode, _resolvedAst.elements); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 @override | 216 @override |
214 DartType visitDynamicType(ir.DynamicType node) { | 217 DartType visitDynamicType(ir.DynamicType node) { |
215 return const DynamicType(); | 218 return const DynamicType(); |
216 } | 219 } |
217 | 220 |
218 @override | 221 @override |
219 DartType visitInvalidType(ir.InvalidType node) { | 222 DartType visitInvalidType(ir.InvalidType node) { |
220 throw new UnimplementedError("Invalid types not currently supported"); | 223 throw new UnimplementedError("Invalid types not currently supported"); |
221 } | 224 } |
222 } | 225 } |
OLD | NEW |