From 12a6b01ee5b9ad5e3a2584e7dc9a12053ef0607a Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 18 Sep 2024 18:29:53 +0200 Subject: [PATCH] [sqlite_common_ffi_web] 0.4.5+3 fix dart sdk beta compilation --- packages_web/sqflite_common_ffi_web/CHANGELOG.md | 2 +- .../sqflite_common_ffi_web/lib/src/web/js_utils.dart | 9 +++++---- packages_web/sqflite_common_ffi_web/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages_web/sqflite_common_ffi_web/CHANGELOG.md b/packages_web/sqflite_common_ffi_web/CHANGELOG.md index ae4a8f06..53a0ad7d 100644 --- a/packages_web/sqflite_common_ffi_web/CHANGELOG.md +++ b/packages_web/sqflite_common_ffi_web/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.4.5+2 +## 0.4.5+3 * Setup for sqlite3 2.3.6 * Improved Wasm support diff --git a/packages_web/sqflite_common_ffi_web/lib/src/web/js_utils.dart b/packages_web/sqflite_common_ffi_web/lib/src/web/js_utils.dart index 772ca327..cbce40f5 100644 --- a/packages_web/sqflite_common_ffi_web/lib/src/web/js_utils.dart +++ b/packages_web/sqflite_common_ffi_web/lib/src/web/js_utils.dart @@ -30,9 +30,10 @@ extension SqfliteWebJSNumberExt on JSNumber { } /// JavaScript Array extension. -extension SqfliteWebJJSArrayExt on JSArray { - /// Get the length of the array - external int get length; +extension SqfliteWebJSArrayExt on JSArray { + /// Get the length of the array missing up to 3.6 + @JS('length') + external int get compatLength; } /// dartify helper for JavaScript objects (handle Uint8List, DateTime, Map, List, String, num, bool) @@ -50,7 +51,7 @@ extension SqfliteWebDartifyExtension on JSAny { return (value as JSUint8Array).toDart; } else if (value.isA()) { var jsArray = value as JSArray; - var list = List.generate(jsArray.length, + var list = List.generate(jsArray.compatLength, (index) => jsArray.getProperty(index.toJS)?.dartifyValueStrict()); return list; } diff --git a/packages_web/sqflite_common_ffi_web/pubspec.yaml b/packages_web/sqflite_common_ffi_web/pubspec.yaml index c8d981a6..cd540d94 100644 --- a/packages_web/sqflite_common_ffi_web/pubspec.yaml +++ b/packages_web/sqflite_common_ffi_web/pubspec.yaml @@ -1,7 +1,7 @@ name: sqflite_common_ffi_web repository: https://github.com/tekartik/sqflite/tree/master/packages_web/sqflite_common_ffi_web description: Sqflite web implementation using sqlite3 ffi and sqlite3 wasm. -version: 0.4.5+2 +version: 0.4.5+3 funding: - https://github.com/sponsors/alextekartik