Index: pkg/compiler/lib/src/js_backend/patch_resolver.dart |
diff --git a/pkg/compiler/lib/src/js_backend/patch_resolver.dart b/pkg/compiler/lib/src/js_backend/patch_resolver.dart |
index 60573ed2c9a36f116e7b26e60ad1c4c059236eca..521dd2dccba435e26b86b232c691e8445a3c5f26 100644 |
--- a/pkg/compiler/lib/src/js_backend/patch_resolver.dart |
+++ b/pkg/compiler/lib/src/js_backend/patch_resolver.dart |
@@ -5,12 +5,9 @@ |
library dart2js.js_backend.patch_resolver; |
import '../common.dart'; |
-import '../common/resolution.dart' show |
- Resolution; |
-import '../common/tasks.dart' show |
- CompilerTask; |
-import '../compiler.dart' show |
- Compiler; |
+import '../common/resolution.dart' show Resolution; |
+import '../common/tasks.dart' show CompilerTask; |
+import '../compiler.dart' show Compiler; |
import '../dart_types.dart'; |
import '../elements/elements.dart'; |
import '../elements/modelx.dart'; |
@@ -33,15 +30,13 @@ class PatchResolverTask extends CompilerTask { |
element = patch; |
} else if (!compiler.backend.isJsInterop(element)) { |
reporter.reportErrorMessage( |
- element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
+ element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION); |
} |
return element; |
} |
void checkMatchingPatchParameters(FunctionElement origin, |
- List<Element> originParameters, |
- List<Element> patchParameters) { |
- |
+ List<Element> originParameters, List<Element> patchParameters) { |
assert(originParameters.length == patchParameters.length); |
for (int index = 0; index < originParameters.length; index++) { |
ParameterElementX originParameter = originParameters[index]; |
@@ -52,19 +47,19 @@ class PatchResolverTask extends CompilerTask { |
originParameter.applyPatch(patchParameter); |
} else { |
assert(invariant(origin, originParameter.patch == patchParameter, |
- message: "Inconsistent repatch of $originParameter.")); |
+ message: "Inconsistent repatch of $originParameter.")); |
} |
DartType originParameterType = originParameter.computeType(resolution); |
DartType patchParameterType = patchParameter.computeType(resolution); |
if (originParameterType != patchParameterType) { |
reporter.reportError( |
reporter.createMessage( |
- originParameter, |
- MessageKind.PATCH_PARAMETER_TYPE_MISMATCH, |
- {'methodName': origin.name, |
- 'parameterName': originParameter.name, |
- 'originParameterType': originParameterType, |
- 'patchParameterType': patchParameterType}), |
+ originParameter, MessageKind.PATCH_PARAMETER_TYPE_MISMATCH, { |
+ 'methodName': origin.name, |
+ 'parameterName': originParameter.name, |
+ 'originParameterType': originParameterType, |
+ 'patchParameterType': patchParameterType |
+ }), |
<DiagnosticMessage>[ |
reporter.createMessage( |
patchParameter, |
@@ -83,28 +78,28 @@ class PatchResolverTask extends CompilerTask { |
if (originParameterText != patchParameterText |
// We special case the list constructor because of the |
// optional parameter. |
- && origin != compiler.unnamedListConstructor) { |
+ && |
+ origin != compiler.unnamedListConstructor) { |
reporter.reportError( |
reporter.createMessage( |
- originParameter, |
- MessageKind.PATCH_PARAMETER_MISMATCH, |
- {'methodName': origin.name, |
- 'originParameter': originParameterText, |
- 'patchParameter': patchParameterText}), |
+ originParameter, MessageKind.PATCH_PARAMETER_MISMATCH, { |
+ 'methodName': origin.name, |
+ 'originParameter': originParameterText, |
+ 'patchParameter': patchParameterText |
+ }), |
<DiagnosticMessage>[ |
- reporter.createMessage( |
- patchParameter, |
- MessageKind.PATCH_POINT_TO_PARAMETER, |
- {'parameterName': patchParameter.name}), |
+ reporter.createMessage( |
+ patchParameter, |
+ MessageKind.PATCH_POINT_TO_PARAMETER, |
+ {'parameterName': patchParameter.name}), |
]); |
- |
} |
} |
} |
} |
- void checkMatchingPatchSignatures(FunctionElement origin, |
- FunctionElement patch) { |
+ void checkMatchingPatchSignatures( |
+ FunctionElement origin, FunctionElement patch) { |
// TODO(johnniwinther): Show both origin and patch locations on errors. |
FunctionSignature originSignature = origin.functionSignature; |
FunctionExpression patchTree = patch.node; |
@@ -115,26 +110,26 @@ class PatchResolverTask extends CompilerTask { |
Node errorNode = |
patchTree.returnType != null ? patchTree.returnType : patchTree; |
reporter.reportErrorMessage( |
- errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH, |
- {'methodName': origin.name, |
- 'originReturnType': originSignature.type.returnType, |
- 'patchReturnType': patchSignature.type.returnType}); |
+ errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH, { |
+ 'methodName': origin.name, |
+ 'originReturnType': originSignature.type.returnType, |
+ 'patchReturnType': patchSignature.type.returnType |
+ }); |
}); |
} |
if (originSignature.requiredParameterCount != |
patchSignature.requiredParameterCount) { |
reporter.withCurrentElement(patch, () { |
reporter.reportErrorMessage( |
- patchTree, |
- MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH, |
- {'methodName': origin.name, |
- 'originParameterCount': originSignature.requiredParameterCount, |
- 'patchParameterCount': patchSignature.requiredParameterCount}); |
+ patchTree, MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH, { |
+ 'methodName': origin.name, |
+ 'originParameterCount': originSignature.requiredParameterCount, |
+ 'patchParameterCount': patchSignature.requiredParameterCount |
+ }); |
}); |
} else { |
- checkMatchingPatchParameters(origin, |
- originSignature.requiredParameters, |
- patchSignature.requiredParameters); |
+ checkMatchingPatchParameters(origin, originSignature.requiredParameters, |
+ patchSignature.requiredParameters); |
} |
if (originSignature.optionalParameterCount != 0 && |
patchSignature.optionalParameterCount != 0) { |
@@ -152,17 +147,15 @@ class PatchResolverTask extends CompilerTask { |
patchSignature.optionalParameterCount) { |
reporter.withCurrentElement(patch, () { |
reporter.reportErrorMessage( |
- patchTree, |
- MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH, |
- {'methodName': origin.name, |
- 'originParameterCount': originSignature.optionalParameterCount, |
- 'patchParameterCount': patchSignature.optionalParameterCount}); |
+ patchTree, MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH, { |
+ 'methodName': origin.name, |
+ 'originParameterCount': originSignature.optionalParameterCount, |
+ 'patchParameterCount': patchSignature.optionalParameterCount |
+ }); |
}); |
} else { |
- checkMatchingPatchParameters(origin, |
- originSignature.optionalParameters, |
- patchSignature.optionalParameters); |
+ checkMatchingPatchParameters(origin, originSignature.optionalParameters, |
+ patchSignature.optionalParameters); |
} |
} |
- |
} |