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 15 matching lines...) Expand all Loading... | |
26 String get name => 'JavaScript patch resolver'; | 26 String get name => 'JavaScript patch resolver'; |
27 | 27 |
28 FunctionElement resolveExternalFunction(FunctionElementX element) { | 28 FunctionElement resolveExternalFunction(FunctionElementX element) { |
29 if (element.isPatched) { | 29 if (element.isPatched) { |
30 FunctionElementX patch = element.patch; | 30 FunctionElementX patch = element.patch; |
31 reporter.withCurrentElement(patch, () { | 31 reporter.withCurrentElement(patch, () { |
32 patch.computeType(resolution); | 32 patch.computeType(resolution); |
33 }); | 33 }); |
34 checkMatchingPatchSignatures(element, patch); | 34 checkMatchingPatchSignatures(element, patch); |
35 element = patch; | 35 element = patch; |
36 } else if (!compiler.backend.nativeData.isJsInterop(element)) { | 36 } else { |
Johnni Winther
2017/03/04 16:34:29
We don't end up here if [element] is js interop.
| |
37 reporter.reportErrorMessage( | 37 reporter.reportErrorMessage( |
38 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); | 38 element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
39 } | 39 } |
40 return element; | 40 return element; |
41 } | 41 } |
42 | 42 |
43 void checkMatchingPatchParameters(FunctionElement origin, | 43 void checkMatchingPatchParameters(FunctionElement origin, |
44 List<Element> originParameters, List<Element> patchParameters) { | 44 List<Element> originParameters, List<Element> patchParameters) { |
45 bool isUnnamedListConstructor = origin is ConstructorElement && | 45 bool isUnnamedListConstructor = origin is ConstructorElement && |
46 compiler.commonElements.isUnnamedListConstructor(origin); | 46 compiler.commonElements.isUnnamedListConstructor(origin); |
(...skipping 129 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 |