OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.js_backend.patch_resolver; | 5 library dart2js.js_backend.patch_resolver; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
9 import '../common/tasks.dart' show CompilerTask; | 9 import '../common/tasks.dart' show CompilerTask; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // elsewhere. | 77 // elsewhere. |
78 | 78 |
79 // The node contains the type, so there is a potential overlap. | 79 // The node contains the type, so there is a potential overlap. |
80 // Therefore we only check the text if the types are identical. | 80 // Therefore we only check the text if the types are identical. |
81 String originParameterText = originParameter.node.toString(); | 81 String originParameterText = originParameter.node.toString(); |
82 String patchParameterText = patchParameter.node.toString(); | 82 String patchParameterText = patchParameter.node.toString(); |
83 if (originParameterText != patchParameterText | 83 if (originParameterText != patchParameterText |
84 // We special case the list constructor because of the | 84 // We special case the list constructor because of the |
85 // optional parameter. | 85 // optional parameter. |
86 && | 86 && |
87 origin != compiler.unnamedListConstructor) { | 87 origin != compiler.commonElements.unnamedListConstructor) { |
88 reporter.reportError( | 88 reporter.reportError( |
89 reporter.createMessage( | 89 reporter.createMessage( |
90 originParameter, MessageKind.PATCH_PARAMETER_MISMATCH, { | 90 originParameter, MessageKind.PATCH_PARAMETER_MISMATCH, { |
91 'methodName': origin.name, | 91 'methodName': origin.name, |
92 'originParameter': originParameterText, | 92 'originParameter': originParameterText, |
93 'patchParameter': patchParameterText | 93 'patchParameter': patchParameterText |
94 }), | 94 }), |
95 <DiagnosticMessage>[ | 95 <DiagnosticMessage>[ |
96 reporter.createMessage( | 96 reporter.createMessage( |
97 patchParameter, | 97 patchParameter, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 'originParameterCount': originSignature.optionalParameterCount, | 171 'originParameterCount': originSignature.optionalParameterCount, |
172 'patchParameterCount': patchSignature.optionalParameterCount | 172 'patchParameterCount': patchSignature.optionalParameterCount |
173 }); | 173 }); |
174 }); | 174 }); |
175 } else { | 175 } else { |
176 checkMatchingPatchParameters(origin, originSignature.optionalParameters, | 176 checkMatchingPatchParameters(origin, originSignature.optionalParameters, |
177 patchSignature.optionalParameters); | 177 patchSignature.optionalParameters); |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
OLD | NEW |