Remove `Utf8Decoder._convertIntercepted` hook
Fixes #54018.
Tested: existing tests.
Change-Id: I0d0cbc414a239bfc00c023ac8b9313c6f413ba83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337540
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
diff --git a/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart b/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart
index d50fead..234d427 100644
--- a/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart
+++ b/sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart
@@ -13,13 +13,6 @@
Converter<List<int>, T> fuse<T>(Converter<String, T> next) {
return super.fuse(next);
}
-
- // TODO(54018): Deprecate this hook.
- @patch
- static String? _convertIntercepted(
- bool allowMalformed, List<int> codeUnits, int start, int? end) {
- return null; // This call was not intercepted.
- }
}
@patch
diff --git a/sdk/lib/_internal/vm/lib/convert_patch.dart b/sdk/lib/_internal/vm/lib/convert_patch.dart
index a9c2bd9..9a9ee1e 100644
--- a/sdk/lib/_internal/vm/lib/convert_patch.dart
+++ b/sdk/lib/_internal/vm/lib/convert_patch.dart
@@ -49,13 +49,6 @@
// TODO(lrn): Recognize a fused decoder where the next step is JsonDecoder.
return super.fuse<T>(next);
}
-
- // Allow intercepting of UTF-8 decoding when built-in lists are passed.
- @patch
- static String? _convertIntercepted(
- bool allowMalformed, List<int> codeUnits, int start, int? end) {
- return null; // This call was not intercepted.
- }
}
class _JsonUtf8Decoder extends Converter<List<int>, Object?> {
diff --git a/sdk/lib/_internal/wasm/lib/convert_patch.dart b/sdk/lib/_internal/wasm/lib/convert_patch.dart
index 001fcec..68f92dc 100644
--- a/sdk/lib/_internal/wasm/lib/convert_patch.dart
+++ b/sdk/lib/_internal/wasm/lib/convert_patch.dart
@@ -35,12 +35,6 @@
// TODO(lrn): Recognize a fused decoder where the next step is JsonDecoder.
return super.fuse<T>(next);
}
-
- @patch
- static String? _convertIntercepted(
- bool allowMalformed, List<int> codeUnits, int start, int? end) {
- return null;
- }
}
class _JsonUtf8Decoder extends Converter<List<int>, Object?> {
diff --git a/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart b/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart
index 08d920a..1ab6472 100644
--- a/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart
+++ b/sdk/lib/_internal/wasm_js_compatibility/lib/convert_patch.dart
@@ -27,12 +27,6 @@
Converter<List<int>, T> fuse<T>(Converter<String, T> next) {
return super.fuse(next);
}
-
- @patch
- static String? _convertIntercepted(
- bool allowMalformed, List<int> codeUnits, int start, int? end) {
- return null;
- }
}
//// Implementation ///////////////////////////////////////////////////////////
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index 1cbdec4..5bd60d8 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -345,16 +345,8 @@
///
/// If the [codeUnits] start with the encoding of a
/// [unicodeBomCharacterRune], that character is discarded.
- String convert(List<int> codeUnits, [int start = 0, int? end]) {
- // Allow the implementation to intercept and specialize based on the type
- // of codeUnits.
- var result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
- if (result != null) {
- return result;
- }
-
- return _Utf8Decoder(_allowMalformed).convertSingle(codeUnits, start, end);
- }
+ String convert(List<int> codeUnits, [int start = 0, int? end]) =>
+ _Utf8Decoder(_allowMalformed).convertSingle(codeUnits, start, end);
/// Starts a chunked conversion.
///
@@ -374,9 +366,6 @@
Stream<String> bind(Stream<List<int>> stream) => super.bind(stream);
external Converter<List<int>, T> fuse<T>(Converter<String, T> next);
-
- external static String? _convertIntercepted(
- bool allowMalformed, List<int> codeUnits, int start, int? end);
}
// UTF-8 constants.