Skip to content

Commit 3152537

Browse files
committed
Fix toString application on js big ints
1 parent a686c52 commit 3152537

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

sqlite3/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.4.6
2+
3+
- Fix selecting large integers (being represented as a `BigInt` in Dart)
4+
not working when compiled with dartdevc.
5+
16
## 2.4.5
27

38
- Fix a bug in the OPFS-locks implementation causing a deadlock when the `xSleep`

sqlite3/lib/src/wasm/js_interop/core.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ external JSBigInt _bigInt(JSAny? s);
88
@JS('Number')
99
external JSNumber _number(JSAny? obj);
1010

11-
@JS('Object')
12-
extension type WrappedJSObject._(JSObject _) implements JSObject {
13-
external WrappedJSObject(JSBigInt _);
14-
11+
extension type WrappedJSAny._(JSAny _) implements JSAny {
1512
external static JSArray<JSAny?> keys(JSObject o);
1613

1714
@JS('toString')
1815
external JSString _toString();
1916
}
2017

18+
@JS('Object')
19+
extension type WrappedJSObject._(JSObject _) implements JSObject {
20+
external static JSArray<JSAny?> keys(JSObject o);
21+
}
22+
2123
extension type JsBigInt(JSBigInt _jsBigInt) implements JSBigInt {
2224
factory JsBigInt.parse(String s) => JsBigInt(_bigInt(s.toJS));
2325
factory JsBigInt.fromInt(int i) => JsBigInt(_bigInt(i.toJS));
@@ -42,7 +44,7 @@ extension type JsBigInt(JSBigInt _jsBigInt) implements JSBigInt {
4244
}
4345

4446
String jsToString() {
45-
return (WrappedJSObject(_jsBigInt))._toString().toDart;
47+
return (_jsBigInt as WrappedJSAny)._toString().toDart;
4648
}
4749
}
4850

sqlite3/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sqlite3
22
description: Provides lightweight yet convenient bindings to SQLite by using dart:ffi
3-
version: 2.4.5
3+
version: 2.4.6
44
homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3
55
issue_tracker: https://github.com/simolus3/sqlite3.dart/issues
66

0 commit comments

Comments
 (0)