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 library kernel.transformations.closure.converter; | 5 library kernel.transformations.closure.converter; |
6 | 6 |
7 import '../../ast.dart' | 7 import '../../ast.dart' |
8 show | 8 show |
9 Arguments, | 9 Arguments, |
10 Block, | 10 Block, |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 return parent is ExpressionStatement || | 531 return parent is ExpressionStatement || |
532 parent is ForStatement && parent.condition != node; | 532 parent is ForStatement && parent.condition != node; |
533 } | 533 } |
534 | 534 |
535 DartType visitDartType(DartType node) { | 535 DartType visitDartType(DartType node) { |
536 return substitute(node, typeSubstitution); | 536 return substitute(node, typeSubstitution); |
537 } | 537 } |
538 | 538 |
539 VariableDeclaration getReplacementLoopVariable(VariableDeclaration variable) { | 539 VariableDeclaration getReplacementLoopVariable(VariableDeclaration variable) { |
540 VariableDeclaration newVariable = new VariableDeclaration(variable.name, | 540 VariableDeclaration newVariable = new VariableDeclaration(variable.name, |
541 initializer: variable.initializer, | 541 initializer: variable.initializer, type: variable.type) |
542 type: variable.type)..flags = variable.flags; | 542 ..flags = variable.flags; |
543 variable.initializer = new VariableGet(newVariable); | 543 variable.initializer = new VariableGet(newVariable); |
544 variable.initializer.parent = variable; | 544 variable.initializer.parent = variable; |
545 return newVariable; | 545 return newVariable; |
546 } | 546 } |
547 | 547 |
548 Expression cloneContext() { | 548 Expression cloneContext() { |
549 InvalidExpression placeHolder = new InvalidExpression(); | 549 InvalidExpression placeHolder = new InvalidExpression(); |
550 contextClonePlaceHolders.add(placeHolder); | 550 contextClonePlaceHolders.add(placeHolder); |
551 return placeHolder; | 551 return placeHolder; |
552 } | 552 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 newClassMembers.add(tearOffMethod); | 877 newClassMembers.add(tearOffMethod); |
878 | 878 |
879 resetContext(); | 879 resetContext(); |
880 }); | 880 }); |
881 } finally { | 881 } finally { |
882 currentMember = oldCurrentMember; | 882 currentMember = oldCurrentMember; |
883 currentMemberFunction = oldCurrentMemberFunction; | 883 currentMemberFunction = oldCurrentMemberFunction; |
884 } | 884 } |
885 } | 885 } |
886 } | 886 } |
OLD | NEW |