| 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 | 8 import '../common/resolution.dart' show |
| 9 Resolution; | 9 Resolution; |
| 10 import '../common/tasks.dart' show | 10 import '../common/tasks.dart' show |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 String get name => 'JavaScript patch resolver'; | 24 String get name => 'JavaScript patch resolver'; |
| 25 | 25 |
| 26 FunctionElement resolveExternalFunction(FunctionElementX element) { | 26 FunctionElement resolveExternalFunction(FunctionElementX element) { |
| 27 if (element.isPatched) { | 27 if (element.isPatched) { |
| 28 FunctionElementX patch = element.patch; | 28 FunctionElementX patch = element.patch; |
| 29 reporter.withCurrentElement(patch, () { | 29 reporter.withCurrentElement(patch, () { |
| 30 patch.computeType(resolution); | 30 patch.computeType(resolution); |
| 31 }); | 31 }); |
| 32 checkMatchingPatchSignatures(element, patch); | 32 checkMatchingPatchSignatures(element, patch); |
| 33 element = patch; | 33 element = patch; |
| 34 } else { | 34 } else if (!element.isJsInterop) { |
| 35 reporter.reportErrorMessage( | 35 reporter.reportErrorMessage( |
| 36 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); | 36 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
| 37 } | 37 } |
| 38 return element; | 38 return element; |
| 39 } | 39 } |
| 40 | 40 |
| 41 void checkMatchingPatchParameters(FunctionElement origin, | 41 void checkMatchingPatchParameters(FunctionElement origin, |
| 42 List<Element> originParameters, | 42 List<Element> originParameters, |
| 43 List<Element> patchParameters) { | 43 List<Element> patchParameters) { |
| 44 | 44 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 'patchParameterCount': patchSignature.optionalParameterCount}); | 159 'patchParameterCount': patchSignature.optionalParameterCount}); |
| 160 }); | 160 }); |
| 161 } else { | 161 } else { |
| 162 checkMatchingPatchParameters(origin, | 162 checkMatchingPatchParameters(origin, |
| 163 originSignature.optionalParameters, | 163 originSignature.optionalParameters, |
| 164 patchSignature.optionalParameters); | 164 patchSignature.optionalParameters); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| OLD | NEW |