From f809105694c34948b279c56d714891a5a67a958d Mon Sep 17 00:00:00 2001 From: Dhikshith Reddy Date: Sun, 8 Dec 2024 22:36:18 +0530 Subject: [PATCH] fix: dart formatting fixes --- pkg/linter/lib/src/rules/null_closures.dart | 2 +- .../js_dev_runtime/private/js_string.dart | 17 +++++++++-------- sdk/lib/_internal/js_runtime/lib/js_string.dart | 2 +- sdk/lib/_internal/vm/lib/string_patch.dart | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pkg/linter/lib/src/rules/null_closures.dart b/pkg/linter/lib/src/rules/null_closures.dart index b3802f1c1e03..88d9f8fcedac 100644 --- a/pkg/linter/lib/src/rules/null_closures.dart +++ b/pkg/linter/lib/src/rules/null_closures.dart @@ -93,7 +93,7 @@ final Map> }, 'splitMap': { NonNullableFunction('dart.core', 'Iterable', 'splitMap', - named: ['onMatch', 'onNonMatch']), + named: ['onMatch', 'onNonMatch']), }, 'takeWhile': { NonNullableFunction('dart.core', 'Iterable', 'takeWhile', positional: [0]), diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_string.dart b/sdk/lib/_internal/js_dev_runtime/private/js_string.dart index ab0a23b16ae5..2c9410e26c41 100644 --- a/sdk/lib/_internal/js_dev_runtime/private/js_string.dart +++ b/sdk/lib/_internal/js_dev_runtime/private/js_string.dart @@ -85,19 +85,20 @@ final class JSString extends Interceptor @notNull Iterable splitMap( - Pattern pattern, { - T Function(Match match)? onMatch, - T Function(String nonMatch)? onNonMatch, - }) { - return stringSplitMapUnchecked(this, pattern, onMatch, onNonMatch); - } + Pattern pattern, { + T Function(Match match)? onMatch, + T Function(String nonMatch)? onNonMatch, + }) { + return stringSplitMapUnchecked(this, pattern, onMatch, onNonMatch); + } - Iterable stringSplitMapUnchecked(String receiver, Pattern pattern, + Iterable stringSplitMapUnchecked(String receiver, Pattern pattern, T Function(Match)? onMatch, T Function(String)? onNonMatch) { onMatch ??= (match) => match[0]! as T; onNonMatch ??= (string) => string as T; if (pattern is String) { - return stringSplitStringMapUnchecked(receiver, pattern, onMatch, onNonMatch); + return stringSplitStringMapUnchecked( + receiver, pattern, onMatch, onNonMatch); } if (pattern is JSSyntaxRegExp) { return stringSplitJSRegExpMapUnchecked(receiver, pattern, onMatch, onNonMatch); diff --git a/sdk/lib/_internal/js_runtime/lib/js_string.dart b/sdk/lib/_internal/js_runtime/lib/js_string.dart index d28a54113868..aec01552886a 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_string.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_string.dart @@ -85,7 +85,7 @@ final class JSString extends Interceptor } Iterable stringSplitMapUnchecked(String receiver, Pattern pattern, - T Function(Match)? onMatch, T Function(String)? onNonMatch) { + T Function(Match)? onMatch, T Function(String)? onNonMatch) { onMatch ??= (match) => match[0]! as T; onNonMatch ??= (string) => string as T; if (pattern is String) { diff --git a/sdk/lib/_internal/vm/lib/string_patch.dart b/sdk/lib/_internal/vm/lib/string_patch.dart index cf2f16802ce3..7bc734a2e470 100644 --- a/sdk/lib/_internal/vm/lib/string_patch.dart +++ b/sdk/lib/_internal/vm/lib/string_patch.dart @@ -888,8 +888,8 @@ abstract final class _StringBase implements String { Iterable splitMap( Pattern pattern, { - T onMatch(Match match)?, - T onNonMatch(String nonMatch)?, + T onMatch(Match match)?, + T onNonMatch(String nonMatch)?, }) { if (pattern == null) { throw new ArgumentError.notNull("pattern");