Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 61674f4

Browse files
authored
Remove extends JSTypedArray from JSUint8Array1 (#44175)
Any user @staticInterop types should only subtype the dart:js_interop types JSObject and or JSAny as user @staticInterop types erase to JSObject. In the future, the other JS types will be added as extension types, allowing users to implement them with their own extension types. Allows https://dart-review.googlesource.com/c/sdk/+/316865/1 to be landed. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [X] I listed at least one issue that this PR fixes in the description above. - [ ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I signed the [CLA]. - [ ] All existing and new tests are passing.
1 parent 9dae7b7 commit 61674f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/web_ui/lib/src/engine/canvaskit/image.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Future<Uint8List> readChunked(HttpFetchPayload payload, int contentLength, WebOn
204204
final JSUint8Array result = createUint8ArrayFromLength(contentLength);
205205
int position = 0;
206206
int cumulativeBytesLoaded = 0;
207-
await payload.read<JSUint8Array1>((JSUint8Array1 chunk) {
207+
await payload.read<JSUint8Array>((JSUint8Array chunk) {
208208
cumulativeBytesLoaded += chunk.length.toDartInt;
209209
chunkCallback(cumulativeBytesLoaded, contentLength);
210210
result.set(chunk, position.toJS);

lib/web_ui/lib/src/engine/js_interop/js_typed_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension TypedArrayExtension on JSTypedArray {
1515
// the dart sdk yet
1616
@JS('Uint8Array')
1717
@staticInterop
18-
class JSUint8Array1 extends JSTypedArray {
18+
class JSUint8Array1 {
1919
external factory JSUint8Array1._create1(JSAny bufferOrLength);
2020
external factory JSUint8Array1._create3(
2121
JSArrayBuffer buffer,

0 commit comments

Comments
 (0)