| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/tasks.dart'; | 9 import '../common/tasks.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 @override | 502 @override |
| 503 FunctionType getFunctionType(KernelToElementMap elementMap) { | 503 FunctionType getFunctionType(KernelToElementMap elementMap) { |
| 504 return functionType; | 504 return functionType; |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 class ClosureFieldData extends ClosureMemberData implements FieldData { | 508 class ClosureFieldData extends ClosureMemberData implements FieldData { |
| 509 ClosureFieldData(MemberDefinition definition) : super(definition); | 509 ClosureFieldData(MemberDefinition definition) : super(definition); |
| 510 | 510 |
| 511 @override | 511 @override |
| 512 DartType getFieldType(KernelToElementMap elementMap) { | |
| 513 // A closure field doesn't have a Dart type. | |
| 514 return null; | |
| 515 } | |
| 516 | |
| 517 @override | |
| 518 ConstantExpression getFieldConstant( | 512 ConstantExpression getFieldConstant( |
| 519 KernelToElementMap elementMap, FieldEntity field) { | 513 KernelToElementMap elementMap, FieldEntity field) { |
| 520 failedAt( | 514 failedAt( |
| 521 field, | 515 field, |
| 522 "Unexpected field $field in " | 516 "Unexpected field $field in " |
| 523 "ClosureFieldData.getFieldConstant"); | 517 "ClosureFieldData.getFieldConstant"); |
| 524 return null; | 518 return null; |
| 525 } | 519 } |
| 526 } | 520 } |
| 527 | 521 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 543 KernelScopeInfo scopeInfo; | 537 KernelScopeInfo scopeInfo; |
| 544 | 538 |
| 545 /// Collected [CapturedScope] data for nodes. | 539 /// Collected [CapturedScope] data for nodes. |
| 546 Map<ir.Node, KernelCapturedScope> capturedScopesMap = | 540 Map<ir.Node, KernelCapturedScope> capturedScopesMap = |
| 547 <ir.Node, KernelCapturedScope>{}; | 541 <ir.Node, KernelCapturedScope>{}; |
| 548 | 542 |
| 549 /// Collected [ScopeInfo] data for nodes. | 543 /// Collected [ScopeInfo] data for nodes. |
| 550 Map<ir.FunctionNode, KernelScopeInfo> closuresToGenerate = | 544 Map<ir.FunctionNode, KernelScopeInfo> closuresToGenerate = |
| 551 <ir.FunctionNode, KernelScopeInfo>{}; | 545 <ir.FunctionNode, KernelScopeInfo>{}; |
| 552 } | 546 } |
| OLD | NEW |