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 Identifiers; | 10 import '../common/names.dart' show Identifiers; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 ResolutionRegistry registry = visitor.registry; | 240 ResolutionRegistry registry = visitor.registry; |
241 registry.defineFunction(tree, element); | 241 registry.defineFunction(tree, element); |
242 visitor.setupFunction(tree, element); // Modifies the scope. | 242 visitor.setupFunction(tree, element); // Modifies the scope. |
243 processAsyncMarker(resolution, element, registry); | 243 processAsyncMarker(resolution, element, registry); |
244 | 244 |
245 if (element.isGenerativeConstructor) { | 245 if (element.isGenerativeConstructor) { |
246 // Even if there is no initializer list we still have to do the | 246 // Even if there is no initializer list we still have to do the |
247 // resolution in case there is an implicit super constructor call. | 247 // resolution in case there is an implicit super constructor call. |
248 InitializerResolver resolver = | 248 InitializerResolver resolver = |
249 new InitializerResolver(visitor, element, tree); | 249 new InitializerResolver(visitor, element, tree); |
250 FunctionElement redirection = resolver.resolveInitializers( | 250 FunctionElement redirection = resolver.resolveInitializers(); |
251 enableInitializingFormalAccess: | |
252 options.enableInitializingFormalAccess); | |
253 if (redirection != null) { | 251 if (redirection != null) { |
254 resolveRedirectingConstructor(resolver, tree, element, redirection); | 252 resolveRedirectingConstructor(resolver, tree, element, redirection); |
255 } | 253 } |
256 } else if (tree.initializers != null) { | 254 } else if (tree.initializers != null) { |
257 reporter.reportErrorMessage( | 255 reporter.reportErrorMessage( |
258 tree, MessageKind.FUNCTION_WITH_INITIALIZER); | 256 tree, MessageKind.FUNCTION_WITH_INITIALIZER); |
259 } | 257 } |
260 | 258 |
261 if (!options.analyzeSignaturesOnly || tree.isRedirectingFactory) { | 259 if (!options.analyzeSignaturesOnly || tree.isRedirectingFactory) { |
262 // We need to analyze the redirecting factory bodies to ensure that | 260 // We need to analyze the redirecting factory bodies to ensure that |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 TreeElements get treeElements { | 1136 TreeElements get treeElements { |
1139 assert(invariant(this, _treeElements != null, | 1137 assert(invariant(this, _treeElements != null, |
1140 message: "TreeElements have not been computed for $this.")); | 1138 message: "TreeElements have not been computed for $this.")); |
1141 return _treeElements; | 1139 return _treeElements; |
1142 } | 1140 } |
1143 | 1141 |
1144 void reuseElement() { | 1142 void reuseElement() { |
1145 _treeElements = null; | 1143 _treeElements = null; |
1146 } | 1144 } |
1147 } | 1145 } |
OLD | NEW |