OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library fasta.verifier; |
| 6 |
| 7 import 'package:kernel/ast.dart' show |
| 8 ExpressionStatement, |
| 9 Program; |
| 10 |
| 11 import 'package:kernel/verifier.dart' show |
| 12 VerifyingVisitor; |
| 13 |
| 14 import 'redirecting_factory_body.dart' show |
| 15 RedirectingFactoryBody; |
| 16 |
| 17 void verifyProgram(Program program, {bool isOutline: false}) { |
| 18 program.accept(new FastaVerifyingVisitor(isOutline)); |
| 19 } |
| 20 |
| 21 class FastaVerifyingVisitor extends VerifyingVisitor { |
| 22 FastaVerifyingVisitor(bool isOutline) { |
| 23 this.isOutline = isOutline; |
| 24 } |
| 25 |
| 26 @override |
| 27 visitExpressionStatement(ExpressionStatement node) { |
| 28 // Bypass verification of the [StaticGet] in [RedirectingFactoryBody] as |
| 29 // this is a static get without a getter. |
| 30 if (node is! RedirectingFactoryBody) { |
| 31 super.visitExpressionStatement(node); |
| 32 } |
| 33 } |
| 34 } |
OLD | NEW |