| 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 "tree/tree.dart"; | 9 import "tree/tree.dart"; |
| 10 import "util/util.dart"; | 10 import "util/util.dart"; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 visitSendSet(SendSet node) { | 360 visitSendSet(SendSet node) { |
| 361 Element element = elements[node]; | 361 Element element = elements[node]; |
| 362 if (Elements.isLocal(element)) { | 362 if (Elements.isLocal(element)) { |
| 363 mutatedVariables.add(element); | 363 mutatedVariables.add(element); |
| 364 } | 364 } |
| 365 super.visitSendSet(node); | 365 super.visitSendSet(node); |
| 366 } | 366 } |
| 367 | 367 |
| 368 visitNewExpression(NewExpression node) { | 368 visitNewExpression(NewExpression node) { |
| 369 TypeAnnotation annotation = node.send.getTypeAnnotation(); | 369 DartType type = elements.getType(node); |
| 370 DartType type = elements.getType(annotation); | |
| 371 | 370 |
| 372 bool hasTypeVariable(DartType type) { | 371 bool hasTypeVariable(DartType type) { |
| 373 if (type is TypeVariableType) { | 372 if (type is TypeVariableType) { |
| 374 return true; | 373 return true; |
| 375 } else if (type is InterfaceType) { | 374 } else if (type is InterfaceType) { |
| 376 InterfaceType ifcType = type; | 375 InterfaceType ifcType = type; |
| 377 for (DartType argument in ifcType.arguments) { | 376 for (DartType argument in ifcType.arguments) { |
| 378 if (hasTypeVariable(argument)) { | 377 if (hasTypeVariable(argument)) { |
| 379 return true; | 378 return true; |
| 380 } | 379 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 } | 623 } |
| 625 | 624 |
| 626 visitTryStatement(TryStatement node) { | 625 visitTryStatement(TryStatement node) { |
| 627 // TODO(ngeoffray): implement finer grain state. | 626 // TODO(ngeoffray): implement finer grain state. |
| 628 bool oldInTryStatement = inTryStatement; | 627 bool oldInTryStatement = inTryStatement; |
| 629 inTryStatement = true; | 628 inTryStatement = true; |
| 630 node.visitChildren(this); | 629 node.visitChildren(this); |
| 631 inTryStatement = oldInTryStatement; | 630 inTryStatement = oldInTryStatement; |
| 632 } | 631 } |
| 633 } | 632 } |
| OLD | NEW |