| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 closureToClassMapper; | 5 library closureToClassMapper; |
| 6 | 6 |
| 7 import "elements/elements.dart"; | 7 import "elements/elements.dart"; |
| 8 import "dart2jslib.dart"; | 8 import "dart2jslib.dart"; |
| 9 import "dart_types.dart"; | 9 import "dart_types.dart"; |
| 10 import "scanner/scannerlib.dart" show Token; | 10 import "scanner/scannerlib.dart" show Token; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 class ClosureFieldElement extends ElementX { | 64 class ClosureFieldElement extends ElementX { |
| 65 ClosureFieldElement(SourceString name, ClassElement enclosing) | 65 ClosureFieldElement(SourceString name, ClassElement enclosing) |
| 66 : super(name, ElementKind.FIELD, enclosing); | 66 : super(name, ElementKind.FIELD, enclosing); |
| 67 | 67 |
| 68 bool isInstanceMember() => true; | 68 bool isInstanceMember() => true; |
| 69 bool isAssignable() => false; | 69 bool isAssignable() => false; |
| 70 // The names of closure variables don't need renaming, since their use is very | 70 // The names of closure variables don't need renaming, since their use is very |
| 71 // simple and they have 1-character names in the minified mode. | 71 // simple and they have 1-character names in the minified mode. |
| 72 bool hasFixedBackendName() => true; | 72 bool hasFixedBackendName() => true; |
| 73 bool fieldAccessNeverThrows() => true; |
| 73 String fixedBackendName() => name.slowToString(); | 74 String fixedBackendName() => name.slowToString(); |
| 74 | 75 |
| 75 DartType computeType(Compiler compiler) => compiler.types.dynamicType; | 76 DartType computeType(Compiler compiler) => compiler.types.dynamicType; |
| 76 | 77 |
| 77 String toString() => "ClosureFieldElement($name)"; | 78 String toString() => "ClosureFieldElement($name)"; |
| 78 } | 79 } |
| 79 | 80 |
| 80 class ClosureClassElement extends ClassElementX { | 81 class ClosureClassElement extends ClassElementX { |
| 81 ClosureClassElement(SourceString name, | 82 ClosureClassElement(SourceString name, |
| 82 Compiler compiler, | 83 Compiler compiler, |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 } | 655 } |
| 655 | 656 |
| 656 visitTryStatement(TryStatement node) { | 657 visitTryStatement(TryStatement node) { |
| 657 // TODO(ngeoffray): implement finer grain state. | 658 // TODO(ngeoffray): implement finer grain state. |
| 658 bool oldInTryStatement = inTryStatement; | 659 bool oldInTryStatement = inTryStatement; |
| 659 inTryStatement = true; | 660 inTryStatement = true; |
| 660 node.visitChildren(this); | 661 node.visitChildren(this); |
| 661 inTryStatement = oldInTryStatement; | 662 inTryStatement = oldInTryStatement; |
| 662 } | 663 } |
| 663 } | 664 } |
| OLD | NEW |