| 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/resolution.dart' show | 7 import '../common/resolution.dart' show |
| 8 Resolution; | 8 Resolution; |
| 9 import '../common/tasks.dart' show | 9 import '../common/tasks.dart' show |
| 10 CompilerTask; | 10 CompilerTask; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 String get name => 'JavaScript patch resolver'; | 29 String get name => 'JavaScript patch resolver'; |
| 30 | 30 |
| 31 FunctionElement resolveExternalFunction(FunctionElementX element) { | 31 FunctionElement resolveExternalFunction(FunctionElementX element) { |
| 32 if (element.isPatched) { | 32 if (element.isPatched) { |
| 33 FunctionElementX patch = element.patch; | 33 FunctionElementX patch = element.patch; |
| 34 compiler.withCurrentElement(patch, () { | 34 compiler.withCurrentElement(patch, () { |
| 35 patch.computeType(resolution); | 35 patch.computeType(resolution); |
| 36 }); | 36 }); |
| 37 checkMatchingPatchSignatures(element, patch); | 37 checkMatchingPatchSignatures(element, patch); |
| 38 element = patch; | 38 element = patch; |
| 39 } else { | 39 } else if (!element.isJsInterop) { |
| 40 compiler.reportErrorMessage( | 40 compiler.reportErrorMessage( |
| 41 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); | 41 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
| 42 } | 42 } |
| 43 return element; | 43 return element; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void checkMatchingPatchParameters(FunctionElement origin, | 46 void checkMatchingPatchParameters(FunctionElement origin, |
| 47 List<Element> originParameters, | 47 List<Element> originParameters, |
| 48 List<Element> patchParameters) { | 48 List<Element> patchParameters) { |
| 49 | 49 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 'patchParameterCount': patchSignature.optionalParameterCount}); | 164 'patchParameterCount': patchSignature.optionalParameterCount}); |
| 165 }); | 165 }); |
| 166 } else { | 166 } else { |
| 167 checkMatchingPatchParameters(origin, | 167 checkMatchingPatchParameters(origin, |
| 168 originSignature.optionalParameters, | 168 originSignature.optionalParameters, |
| 169 patchSignature.optionalParameters); | 169 patchSignature.optionalParameters); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 } | 173 } |
| OLD | NEW |