Chromium Code Reviews| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 while (!originParameters.isEmpty) { | 317 while (!originParameters.isEmpty) { |
| 318 Element originParameter = originParameters.head; | 318 Element originParameter = originParameters.head; |
| 319 Element patchParameter = patchParameters.head; | 319 Element patchParameter = patchParameters.head; |
| 320 // Hack: Use unparser to test parameter equality. This only works because | 320 // Hack: Use unparser to test parameter equality. This only works because |
| 321 // we are restricting patch uses and the approach cannot be used | 321 // we are restricting patch uses and the approach cannot be used |
| 322 // elsewhere. | 322 // elsewhere. |
| 323 String originParameterText = | 323 String originParameterText = |
| 324 originParameter.parseNode(compiler).toString(); | 324 originParameter.parseNode(compiler).toString(); |
| 325 String patchParameterText = | 325 String patchParameterText = |
| 326 patchParameter.parseNode(compiler).toString(); | 326 patchParameter.parseNode(compiler).toString(); |
| 327 if (originParameterText != patchParameterText) { | 327 if (originParameterText != patchParameterText |
| 328 // We special case the list constructor because of the | |
| 329 // optional parameter. | |
| 330 && origin != compiler.unnamedListConstructor) { | |
|
ahe
2013/12/10 18:57:44
Why is a special case needed?
Why can't the publi
ngeoffray
2013/12/10 22:08:31
The patch code says:
factory List([int length = co
| |
| 328 compiler.reportError( | 331 compiler.reportError( |
| 329 originParameter.parseNode(compiler), | 332 originParameter.parseNode(compiler), |
| 330 MessageKind.PATCH_PARAMETER_MISMATCH, | 333 MessageKind.PATCH_PARAMETER_MISMATCH, |
| 331 {'methodName': origin.name, | 334 {'methodName': origin.name, |
| 332 'originParameter': originParameterText, | 335 'originParameter': originParameterText, |
| 333 'patchParameter': patchParameterText}); | 336 'patchParameter': patchParameterText}); |
| 334 compiler.reportMessage( | 337 compiler.reportMessage( |
| 335 compiler.spanFromSpannable(patchParameter), | 338 compiler.spanFromSpannable(patchParameter), |
| 336 MessageKind.PATCH_POINT_TO_PARAMETER.error( | 339 MessageKind.PATCH_POINT_TO_PARAMETER.error( |
| 337 {'parameterName': patchParameter.name}), | 340 {'parameterName': patchParameter.name}), |
| (...skipping 4429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4767 return finishConstructorReference(visit(expression), | 4770 return finishConstructorReference(visit(expression), |
| 4768 expression, expression); | 4771 expression, expression); |
| 4769 } | 4772 } |
| 4770 } | 4773 } |
| 4771 | 4774 |
| 4772 /// Looks up [name] in [scope] and unwraps the result. | 4775 /// Looks up [name] in [scope] and unwraps the result. |
| 4773 Element lookupInScope(Compiler compiler, Node node, | 4776 Element lookupInScope(Compiler compiler, Node node, |
| 4774 Scope scope, String name) { | 4777 Scope scope, String name) { |
| 4775 return Elements.unwrap(scope.lookup(name), compiler, node); | 4778 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4776 } | 4779 } |
| OLD | NEW |