OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 super.visitSwitchStatement(node); | 443 super.visitSwitchStatement(node); |
444 } finally { | 444 } finally { |
445 labelScope = outerScope; | 445 labelScope = outerScope; |
446 } | 446 } |
447 return null; | 447 return null; |
448 } | 448 } |
449 | 449 |
450 @Override | 450 @Override |
451 public Void visitVariableDeclaration(VariableDeclaration node) { | 451 public Void visitVariableDeclaration(VariableDeclaration node) { |
| 452 super.visitVariableDeclaration(node); |
452 if (!(node.getParent().getParent() instanceof TopLevelVariableDeclaration) | 453 if (!(node.getParent().getParent() instanceof TopLevelVariableDeclaration) |
453 && !(node.getParent().getParent() instanceof FieldDeclaration)) { | 454 && !(node.getParent().getParent() instanceof FieldDeclaration)) { |
454 VariableElement element = node.getElement(); | 455 VariableElement element = node.getElement(); |
455 if (element != null) { | 456 if (element != null) { |
456 nameScope.define(element); | 457 nameScope.define(element); |
457 } | 458 } |
458 } | 459 } |
459 super.visitVariableDeclaration(node); | |
460 return null; | 460 return null; |
461 } | 461 } |
462 | 462 |
463 @Override | 463 @Override |
464 public Void visitWhileStatement(WhileStatement node) { | 464 public Void visitWhileStatement(WhileStatement node) { |
465 LabelScope outerScope = labelScope; | 465 LabelScope outerScope = labelScope; |
466 try { | 466 try { |
467 labelScope = new LabelScope(outerScope, false, false); | 467 labelScope = new LabelScope(outerScope, false, false); |
468 safelyVisit(node.getCondition()); | 468 safelyVisit(node.getCondition()); |
469 visitStatementInScope(node.getBody()); | 469 visitStatementInScope(node.getBody()); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 641 } |
642 } | 642 } |
643 if (statement instanceof FunctionDeclarationStatement) { | 643 if (statement instanceof FunctionDeclarationStatement) { |
644 FunctionDeclarationStatement fds = (FunctionDeclarationStatement) statem
ent; | 644 FunctionDeclarationStatement fds = (FunctionDeclarationStatement) statem
ent; |
645 Element element = fds.getFunctionDeclaration().getElement(); | 645 Element element = fds.getFunctionDeclaration().getElement(); |
646 scope.hide(element); | 646 scope.hide(element); |
647 } | 647 } |
648 } | 648 } |
649 } | 649 } |
650 } | 650 } |
OLD | NEW |