Коммит 89df4807 создал по автору Simon Binder's avatar Simon Binder
Просмотр файлов

Remove js-interop workaround

Dart 3.3 had the problem of some JS-interop methods declared to return
a `JSBoolean` actually returning a Dart `bool`, causing compilation
errors.
Now that https://github.com/dart-lang/sdk/issues/55024 has been fixed
in Dart 3.4, the workarounds introduced to fix the issue can be
reverted.
владелец 6f5aa2d8
...@@ -18,8 +18,7 @@ void main() { ...@@ -18,8 +18,7 @@ void main() {
Future<void> handleEvent(web.MessageEvent event) async { Future<void> handleEvent(web.MessageEvent event) async {
final data = event.data; final data = event.data;
// should be toDart, https://github.com/dart-lang/sdk/issues/55024 if (data.equals('start'.toJS).toDart) {
if (data.equals('start'.toJS) as bool) {
final options = WasmVfs.createOptions(); final options = WasmVfs.createOptions();
final worker = web.Worker(''); // Clone this worker final worker = web.Worker(''); // Clone this worker
worker.postMessage(options); worker.postMessage(options);
......
...@@ -33,10 +33,8 @@ extension type JsBigInt(JSBigInt _jsBigInt) implements JSBigInt { ...@@ -33,10 +33,8 @@ extension type JsBigInt(JSBigInt _jsBigInt) implements JSBigInt {
const maxSafeInteger = 9007199254740992; const maxSafeInteger = 9007199254740992;
const minSafeInteger = -maxSafeInteger; const minSafeInteger = -maxSafeInteger;
// These should use toDart instead of as bool after return minSafeInteger.toJS.lessThanOrEqualTo(_jsBigInt).toDart &&
// https://github.com/dart-lang/sdk/issues/55024 _jsBigInt.lessThanOrEqualTo(maxSafeInteger.toJS).toDart;
return minSafeInteger.toJS.lessThanOrEqualTo(_jsBigInt) as bool &&
_jsBigInt.lessThanOrEqualTo(maxSafeInteger.toJS) as bool;
} }
Object toDart() { Object toDart() {
......
...@@ -5,7 +5,7 @@ homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3 ...@@ -5,7 +5,7 @@ homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3
issue_tracker: https://github.com/simolus3/sqlite3.dart/issues issue_tracker: https://github.com/simolus3/sqlite3.dart/issues
environment: environment:
sdk: '>=3.3.0 <4.0.0' sdk: '>=3.4.0 <4.0.0'
# This package supports all platforms listed below. # This package supports all platforms listed below.
platforms: platforms:
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать