Chromium Code Reviews| 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 { | |
| 40 compiler.reportErrorMessage( | |
| 41 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); | |
|
Siggi Cherem (dart-lang)
2015/10/06 22:38:02
rather than completely removing this, maybe we sho
Jacob
2015/10/13 01:19:23
discussed offline. added comment explaining why we
| |
| 42 } | 39 } |
| 43 return element; | 40 return element; |
| 44 } | 41 } |
| 45 | 42 |
| 46 void checkMatchingPatchParameters(FunctionElement origin, | 43 void checkMatchingPatchParameters(FunctionElement origin, |
| 47 List<Element> originParameters, | 44 List<Element> originParameters, |
| 48 List<Element> patchParameters) { | 45 List<Element> patchParameters) { |
| 49 | 46 |
| 50 assert(originParameters.length == patchParameters.length); | 47 assert(originParameters.length == patchParameters.length); |
| 51 for (int index = 0; index < originParameters.length; index++) { | 48 for (int index = 0; index < originParameters.length; index++) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 'patchParameterCount': patchSignature.optionalParameterCount}); | 161 'patchParameterCount': patchSignature.optionalParameterCount}); |
| 165 }); | 162 }); |
| 166 } else { | 163 } else { |
| 167 checkMatchingPatchParameters(origin, | 164 checkMatchingPatchParameters(origin, |
| 168 originSignature.optionalParameters, | 165 originSignature.optionalParameters, |
| 169 patchSignature.optionalParameters); | 166 patchSignature.optionalParameters); |
| 170 } | 167 } |
| 171 } | 168 } |
| 172 | 169 |
| 173 } | 170 } |
| OLD | NEW |