| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 assert(originParameters.length == patchParameters.length); | 48 assert(originParameters.length == patchParameters.length); |
| 49 for (int index = 0; index < originParameters.length; index++) { | 49 for (int index = 0; index < originParameters.length; index++) { |
| 50 ParameterElementX originParameter = originParameters[index]; | 50 ParameterElementX originParameter = originParameters[index]; |
| 51 ParameterElementX patchParameter = patchParameters[index]; | 51 ParameterElementX patchParameter = patchParameters[index]; |
| 52 // TODO(johnniwinther): Remove the conditional patching when we never | 52 // TODO(johnniwinther): Remove the conditional patching when we never |
| 53 // resolve the same method twice. | 53 // resolve the same method twice. |
| 54 if (!originParameter.isPatched) { | 54 if (!originParameter.isPatched) { |
| 55 originParameter.applyPatch(patchParameter); | 55 originParameter.applyPatch(patchParameter); |
| 56 } else { | 56 } else { |
| 57 assert(invariant(origin, originParameter.patch == patchParameter, | 57 assert(originParameter.patch == patchParameter, |
| 58 message: "Inconsistent repatch of $originParameter.")); | 58 failedAt(origin, "Inconsistent repatch of $originParameter.")); |
| 59 } | 59 } |
| 60 ResolutionDartType originParameterType = | 60 ResolutionDartType originParameterType = |
| 61 originParameter.computeType(resolution); | 61 originParameter.computeType(resolution); |
| 62 ResolutionDartType patchParameterType = | 62 ResolutionDartType patchParameterType = |
| 63 patchParameter.computeType(resolution); | 63 patchParameter.computeType(resolution); |
| 64 if (originParameterType != patchParameterType) { | 64 if (originParameterType != patchParameterType) { |
| 65 reporter.reportError( | 65 reporter.reportError( |
| 66 reporter.createMessage( | 66 reporter.createMessage( |
| 67 originParameter, MessageKind.PATCH_PARAMETER_TYPE_MISMATCH, { | 67 originParameter, MessageKind.PATCH_PARAMETER_TYPE_MISMATCH, { |
| 68 'methodName': origin.name, | 68 'methodName': origin.name, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 'originParameterCount': originSignature.optionalParameterCount, | 176 'originParameterCount': originSignature.optionalParameterCount, |
| 177 'patchParameterCount': patchSignature.optionalParameterCount | 177 'patchParameterCount': patchSignature.optionalParameterCount |
| 178 }); | 178 }); |
| 179 }); | 179 }); |
| 180 } else { | 180 } else { |
| 181 checkMatchingPatchParameters(origin, originSignature.optionalParameters, | 181 checkMatchingPatchParameters(origin, originSignature.optionalParameters, |
| 182 patchSignature.optionalParameters); | 182 patchSignature.optionalParameters); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 } | 185 } |
| OLD | NEW |