| 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 library kernel.checks; | 4 library kernel.checks; |
| 5 | 5 |
| 6 import 'ast.dart'; | 6 import 'ast.dart'; |
| 7 import 'transformations/flags.dart'; | 7 import 'transformations/flags.dart'; |
| 8 | 8 |
| 9 void verifyProgram(Program program) { | 9 void verifyProgram(Program program) { |
| 10 VerifyingVisitor.check(program); | 10 VerifyingVisitor.check(program); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 visitWithLocalScope(node); | 231 visitWithLocalScope(node); |
| 232 } | 232 } |
| 233 | 233 |
| 234 visitVariableDeclaration(VariableDeclaration node) { | 234 visitVariableDeclaration(VariableDeclaration node) { |
| 235 visitChildren(node); | 235 visitChildren(node); |
| 236 declareVariable(node); | 236 declareVariable(node); |
| 237 } | 237 } |
| 238 | 238 |
| 239 visitVariableGet(VariableGet node) { | 239 visitVariableGet(VariableGet node) { |
| 240 checkVariableInScope(node.variable, node); | 240 checkVariableInScope(node.variable, node); |
| 241 visitChildren(node); |
| 241 } | 242 } |
| 242 | 243 |
| 243 visitVariableSet(VariableSet node) { | 244 visitVariableSet(VariableSet node) { |
| 244 checkVariableInScope(node.variable, node); | 245 checkVariableInScope(node.variable, node); |
| 245 visitChildren(node); | 246 visitChildren(node); |
| 246 } | 247 } |
| 247 | 248 |
| 248 @override | 249 @override |
| 249 visitStaticGet(StaticGet node) { | 250 visitStaticGet(StaticGet node) { |
| 250 visitChildren(node); | 251 visitChildren(node); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 throw 'Parent pointer on ${node.runtimeType} ' | 442 throw 'Parent pointer on ${node.runtimeType} ' |
| 442 'is ${node.parent.runtimeType} ' | 443 'is ${node.parent.runtimeType} ' |
| 443 'but should be ${parent.runtimeType}'; | 444 'but should be ${parent.runtimeType}'; |
| 444 } | 445 } |
| 445 var oldParent = parent; | 446 var oldParent = parent; |
| 446 parent = node; | 447 parent = node; |
| 447 node.visitChildren(this); | 448 node.visitChildren(this); |
| 448 parent = oldParent; | 449 parent = oldParent; |
| 449 } | 450 } |
| 450 } | 451 } |
| OLD | NEW |