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.resolution; | 5 library dart2js.resolution; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart' show | 10 import '../common/names.dart' show |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 232 } |
233 if (element.isConstructor) { | 233 if (element.isConstructor) { |
234 if (tree.returnType != null) { | 234 if (tree.returnType != null) { |
235 reporter.reportErrorMessage( | 235 reporter.reportErrorMessage( |
236 tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); | 236 tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE); |
237 } | 237 } |
238 if (element.isConst && | 238 if (element.isConst && |
239 tree.hasBody() && | 239 tree.hasBody() && |
240 !tree.isRedirectingFactory) { | 240 !tree.isRedirectingFactory) { |
241 reporter.reportErrorMessage( | 241 reporter.reportErrorMessage( |
242 tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY); | 242 tree, MessageKind.CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY); |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
246 ResolverVisitor visitor = visitorFor(element); | 246 ResolverVisitor visitor = visitorFor(element); |
247 ResolutionRegistry registry = visitor.registry; | 247 ResolutionRegistry registry = visitor.registry; |
248 registry.defineFunction(tree, element); | 248 registry.defineFunction(tree, element); |
249 visitor.setupFunction(tree, element); | 249 visitor.setupFunction(tree, element); |
250 processAsyncMarker(compiler, element, registry); | 250 processAsyncMarker(compiler, element, registry); |
251 | 251 |
252 if (element.isGenerativeConstructor) { | 252 if (element.isGenerativeConstructor) { |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 TreeElements get treeElements { | 1127 TreeElements get treeElements { |
1128 assert(invariant(this, _treeElements !=null, | 1128 assert(invariant(this, _treeElements !=null, |
1129 message: "TreeElements have not been computed for $this.")); | 1129 message: "TreeElements have not been computed for $this.")); |
1130 return _treeElements; | 1130 return _treeElements; |
1131 } | 1131 } |
1132 | 1132 |
1133 void reuseElement() { | 1133 void reuseElement() { |
1134 _treeElements = null; | 1134 _treeElements = null; |
1135 } | 1135 } |
1136 } | 1136 } |
OLD | NEW |