Skip to content

Commit

Permalink
[sqlite_common_ffi_web] 0.4.5+3 fix dart sdk beta compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Sep 18, 2024
1 parent 56fcdce commit 12a6b01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages_web/sqflite_common_ffi_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.4.5+2
## 0.4.5+3

* Setup for sqlite3 2.3.6
* Improved Wasm support
Expand Down
9 changes: 5 additions & 4 deletions packages_web/sqflite_common_ffi_web/lib/src/web/js_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -50,7 +51,7 @@ extension SqfliteWebDartifyExtension on JSAny {
return (value as JSUint8Array).toDart;
} else if (value.isA<JSArray>()) {
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;
}
Expand Down
2 changes: 1 addition & 1 deletion packages_web/sqflite_common_ffi_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 12a6b01

Please sign in to comment.