| 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 dart2js.typechecker; | 5 library dart2js.typechecker; |
| 6 | 6 |
| 7 import 'common.dart'; | 7 import 'common.dart'; |
| 8 import 'common/names.dart' show Identifiers; | 8 import 'common/names.dart' show Identifiers; |
| 9 import 'common/resolution.dart' show Resolution; | 9 import 'common/resolution.dart' show Resolution; |
| 10 import 'common/tasks.dart' show CompilerTask; | 10 import 'common/tasks.dart' show CompilerTask; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 import 'resolution/tree_elements.dart' show TreeElements; | 45 import 'resolution/tree_elements.dart' show TreeElements; |
| 46 import 'resolution/class_members.dart' show MembersCreator; | 46 import 'resolution/class_members.dart' show MembersCreator; |
| 47 import 'tree/tree.dart'; | 47 import 'tree/tree.dart'; |
| 48 import 'util/util.dart' show Link, LinkBuilder; | 48 import 'util/util.dart' show Link, LinkBuilder; |
| 49 | 49 |
| 50 class TypeCheckerTask extends CompilerTask { | 50 class TypeCheckerTask extends CompilerTask { |
| 51 TypeCheckerTask(Compiler compiler) : super(compiler); | 51 TypeCheckerTask(Compiler compiler) : super(compiler); |
| 52 String get name => "Type checker"; | 52 String get name => "Type checker"; |
| 53 | 53 |
| 54 void check(AstElement element) { | 54 void check(AstElement element) { |
| 55 return; |
| 55 if (element.isClass) return; | 56 if (element.isClass) return; |
| 56 if (element.isTypedef) return; | 57 if (element.isTypedef) return; |
| 57 ResolvedAst resolvedAst = element.resolvedAst; | 58 ResolvedAst resolvedAst = element.resolvedAst; |
| 59 if (resolvedAst.node == null) { |
| 60 return; |
| 61 new FiskFisk(); |
| 62 } |
| 58 reporter.withCurrentElement(element.implementation, () { | 63 reporter.withCurrentElement(element.implementation, () { |
| 59 measure(() { | 64 measure(() { |
| 60 TypeCheckerVisitor visitor = new TypeCheckerVisitor( | 65 TypeCheckerVisitor visitor = new TypeCheckerVisitor( |
| 61 compiler, resolvedAst.elements, compiler.types); | 66 compiler, resolvedAst.elements, compiler.types); |
| 62 if (element.isField) { | 67 if (element.isField) { |
| 63 visitor.analyzingInitializer = true; | 68 visitor.analyzingInitializer = true; |
| 64 } | 69 } |
| 65 resolvedAst.node.accept(visitor); | 70 resolvedAst.node.accept(visitor); |
| 66 }); | 71 }); |
| 67 }); | 72 }); |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2018 | 2023 |
| 2019 visitTypedef(Typedef node) { | 2024 visitTypedef(Typedef node) { |
| 2020 // Do not typecheck [Typedef] nodes. | 2025 // Do not typecheck [Typedef] nodes. |
| 2021 } | 2026 } |
| 2022 | 2027 |
| 2023 visitNode(Node node) { | 2028 visitNode(Node node) { |
| 2024 reporter.internalError(node, | 2029 reporter.internalError(node, |
| 2025 'Unexpected node ${node.getObjectDescription()} in the type checker.'); | 2030 'Unexpected node ${node.getObjectDescription()} in the type checker.'); |
| 2026 } | 2031 } |
| 2027 } | 2032 } |
| OLD | NEW |