Description
A recent change adding constructors to the JSTypedArray subtypes requires a JSArrayBuffer as the buffer argument, however Javascript also allows passing a SharedArrayBuffer.
You can see the change to JSInt32Array here, however it affects all JSTypedArray subtypes.
sdk/sdk/lib/js_interop/js_interop.dart
Line 313 in c008c15
This situation around SharedArrayBuffers vs ArrayBuffers breaks occasionaly and I have had workarounds that I have used in the past after opening related issues, so I test it regularly now with the latest versions to make sure I have a heads up on future breaking changes.
I get that it is hard to test using the current dart test package so I created a repo that can reproduce the issue and test it using a fork of the test package specified in dependency_overrides that sets the correct headers to allow SharedArrayBuffer to work on browser tests.
Here is the repo with minimal tests if you want a reproduction. try it with dart 3.4 (stable) or 3.5 (beta) ( both pass) . dart 3.6 (master) fails.
https://github.com/nullrocket/js_typed_array_with_sab_and_atomics
Metadata
Metadata
Assignees
Labels
Type
Projects
Status