-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-dart2wasmIssues for the dart2wasm compiler.Issues for the dart2wasm compiler.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interopIssues that impact all js interop
Description
The code below works as expected on dart2js but produces a run-time error on dart2wasm.
import 'dart:js_interop';
import 'dart:typed_data';
main() {
ByteBuffer buffer = Int16List.fromList([42]).buffer;
JSInt16Array a = JSInt16Array(buffer.toJS); // RangeError (start): Invalid value: Not in inclusive range 0..1: 2
Int16List l = a.toDart;
print(l.toList()); // On dart2js prints [42]
}Am I doing anything wrong here? Or this is an issue?
Dart SDK version: 3.10.0-edge.6be105bb2405a44f5bf579e9387bc5080dee8c6b (main) (Tue Sep 16 19:37:19 2025 -0700) on "linux_x64"
Metadata
Metadata
Assignees
Labels
area-dart2wasmIssues for the dart2wasm compiler.Issues for the dart2wasm compiler.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interopIssues that impact all js interop