| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): import from its own package | 5 // TODO(jmesserly): import from its own package |
| 6 import '../js_ast/js_ast.dart'; | 6 import '../js_ast/js_ast.dart'; |
| 7 import '../js_ast/precedence.dart'; | 7 import '../js_ast/precedence.dart'; |
| 8 | 8 |
| 9 import 'js_names.dart' show TemporaryId; | 9 import 'js_names.dart' show TemporaryId; |
| 10 | 10 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 visitFunctionExpression(FunctionExpression node) { | 343 visitFunctionExpression(FunctionExpression node) { |
| 344 var savedNested = _nestedFunction; | 344 var savedNested = _nestedFunction; |
| 345 _nestedFunction = true; | 345 _nestedFunction = true; |
| 346 super.visitFunctionExpression(node); | 346 super.visitFunctionExpression(node); |
| 347 _nestedFunction = savedNested; | 347 _nestedFunction = savedNested; |
| 348 } | 348 } |
| 349 | 349 |
| 350 @override | 350 @override |
| 351 visitYield(Yield node) { | 351 visitYield(Yield node) { |
| 352 if (!_nestedFunction) hasYield = true; | 352 if (!_nestedFunction) hasYield = true; |
| 353 super.visitYield(node); |
| 353 } | 354 } |
| 354 | 355 |
| 355 @override | 356 @override |
| 356 visitNode(Node node) { | 357 visitNode(Node node) { |
| 357 if (hasYield && hasThis) return; // found both, nothing more to do. | 358 if (hasYield && hasThis) return; // found both, nothing more to do. |
| 358 super.visitNode(node); | 359 super.visitNode(node); |
| 359 } | 360 } |
| 360 } | 361 } |
| OLD | NEW |