| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
| 10 | 10 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 redirection = redirection.patch; | 319 redirection = redirection.patch; |
| 320 } | 320 } |
| 321 redirection = resolver.visitor.resolveConstructorRedirection(redirection); | 321 redirection = resolver.visitor.resolveConstructorRedirection(redirection); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 void checkMatchingPatchParameters(FunctionElement origin, | 325 void checkMatchingPatchParameters(FunctionElement origin, |
| 326 Link<Element> originParameters, | 326 Link<Element> originParameters, |
| 327 Link<Element> patchParameters) { | 327 Link<Element> patchParameters) { |
| 328 while (!originParameters.isEmpty) { | 328 while (!originParameters.isEmpty) { |
| 329 Element originParameter = originParameters.head; | 329 VariableElementX originParameter = originParameters.head; |
| 330 Element patchParameter = patchParameters.head; | 330 VariableElementX patchParameter = patchParameters.head; |
| 331 assert(invariant(originParameter, originParameter.origin == null)); |
| 332 assert(invariant(originParameter, originParameter.patch == null)); |
| 333 originParameter.patch = patchParameter; |
| 334 assert(invariant(patchParameter, patchParameter.origin == null)); |
| 335 assert(invariant(patchParameter, patchParameter.patch == null)); |
| 336 patchParameter.origin = originParameter; |
| 331 // Hack: Use unparser to test parameter equality. This only works because | 337 // Hack: Use unparser to test parameter equality. This only works because |
| 332 // we are restricting patch uses and the approach cannot be used | 338 // we are restricting patch uses and the approach cannot be used |
| 333 // elsewhere. | 339 // elsewhere. |
| 334 String originParameterText = | 340 String originParameterText = |
| 335 originParameter.parseNode(compiler).toString(); | 341 originParameter.parseNode(compiler).toString(); |
| 336 String patchParameterText = | 342 String patchParameterText = |
| 337 patchParameter.parseNode(compiler).toString(); | 343 patchParameter.parseNode(compiler).toString(); |
| 338 if (originParameterText != patchParameterText | 344 if (originParameterText != patchParameterText |
| 339 // We special case the list constructor because of the | 345 // We special case the list constructor because of the |
| 340 // optional parameter. | 346 // optional parameter. |
| (...skipping 4164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4505 return finishConstructorReference(visit(expression), | 4511 return finishConstructorReference(visit(expression), |
| 4506 expression, expression); | 4512 expression, expression); |
| 4507 } | 4513 } |
| 4508 } | 4514 } |
| 4509 | 4515 |
| 4510 /// Looks up [name] in [scope] and unwraps the result. | 4516 /// Looks up [name] in [scope] and unwraps the result. |
| 4511 Element lookupInScope(Compiler compiler, Node node, | 4517 Element lookupInScope(Compiler compiler, Node node, |
| 4512 Scope scope, String name) { | 4518 Scope scope, String name) { |
| 4513 return Elements.unwrap(scope.lookup(name), compiler, node); | 4519 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4514 } | 4520 } |
| OLD | NEW |