diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart index 3c50f920f2f..6bc124e019f 100644 --- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart +++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart @@ -214,7 +214,7 @@ String? _argumentErrors(Object type, @notNull List actuals, namedActuals) { var requiredCount = JS('!', '#.length', requiredPositional); var actualsCount = actuals.length; if (actualsCount < requiredCount) { - return 'Dynamic call with too few required positional arguments. ' + return 'Dynamic call with missing positional arguments. ' 'Expected: $requiredCount Actual: $actualsCount'; } // Check for too many positional arguments. @@ -293,15 +293,15 @@ String? _argumentErrors(Object type, @notNull List actuals, namedActuals) { var required = fType.args; int requiredCount = JS('!', '#.length', required); if (actualsCount < requiredCount) { - return 'Dynamic call with too few arguments. ' + return 'Dynamic call with missing positional arguments. ' 'Expected: $requiredCount Actual: $actualsCount'; } - // Check for too many postional arguments. + // Check for too many positional arguments. var extras = actualsCount - requiredCount; var optionals = fType.optionals; if (extras > JS('!', '#.length', optionals)) { - return 'Dynamic call with too many arguments. ' + return 'Dynamic call with too many positional arguments. ' 'Expected: $requiredCount Actual: $actualsCount'; } diff --git a/tests/dartdevc/no_such_method_errors_test.dart b/tests/dartdevc/no_such_method_errors_test.dart index 271b3c61214..5a185305858 100644 --- a/tests/dartdevc/no_such_method_errors_test.dart +++ b/tests/dartdevc/no_such_method_errors_test.dart @@ -194,7 +194,8 @@ void main() { expectThrowsNSMWithExactError( () => Function.apply(arity1Tearoff, [42, false]), "NoSuchMethodError: 'arity1'\n" - "Dynamic call with too many arguments. Expected: 1 Actual: 2\n" + "Dynamic call with too many positional arguments. " + "Expected: 1 Actual: 2\n" "Receiver: ${Error.safeToString(arity1Tearoff)}\n" "Arguments: [42, false]"); }); @@ -202,7 +203,8 @@ void main() { expectThrowsNSMWithExactError( () => Function.apply(arity1Tearoff, []), "NoSuchMethodError: 'arity1'\n" - "Dynamic call with too few arguments. Expected: 1 Actual: 0\n" + "Dynamic call with missing positional arguments. " + "Expected: 1 Actual: 0\n" "Receiver: ${Error.safeToString(arity1Tearoff)}\n" "Arguments: []"); });