Repository navigation
v1.1.0
-
sdk: ^3.13.0
-
ObjectExtension:isJSAny,asJSAny,isJSObject,asJSObject,objectDartify:- Reimplemented with
Object?.isA<T>()(Dart 3.12+), removing theis JSxxxchecks and
invalid_runtime_check_with_js_interop_typesignores. - Fix: a non-JS Dart object (e.g. an instance of a Dart class) is no longer reported as a
JSAnywithdart2js. null(ambiguous) is still returned for JS values that are also a DartList/Map/Function(dart2js).
- Reimplemented with
- Added
isJSFunctionandisJSExportedDartFunction. toJSDeep: Fix:TypedData(e.g. aUint8Listinside aMap) is converted to a JS typed array,
not to a JSArray.
-
Fix:
Int8List,Uint8ClampedList,Int16List,Uint16List,Int32List,Uint32List,Float32Listand
Float64List.toJSreturned a JSArray: the packageIterable<int>/Iterable<double>toJSextensions
shadowed thedart:js_interopones. AddedInt8ListExtension,Uint8ClampedListExtension,
Int16ListExtension,Uint16ListExtension,Int32ListExtension,Uint32ListExtension,
Float32ListExtensionandFloat64ListExtension(asUint8ListExtensionalready did forUint8List). -
IterableExtension:- Added
toJSIterableDeep: lazyJSIterablecounterpart oftoJSDeep(usesIterable.toJSIterable, Dart 3.12+).
- Added
-
Added
JSIterableExtensionwithtoIterableandtoList.- Works around
JSIterable.toDartIterablefailing for a JS string (Reflect.get called on non-object).
- Works around
-
JSObjectExtension:- Added
prototype(JSObject.getPrototypeOf, Dart 3.13+) andisPlainObject. as<T>():- Fix: with
dart2wasmall interop types are erased to one runtime type, so dispatching onTreturned
nullfor valid casts (e.g.JSObject().as<JSObject>()). It now only casts whenTcan't be inspected. - Fix:
as<JSObject>()returnednullwithdart2js. - Added
JSFunctioncheck; removed duplicatedJSInt8Arraybranch and unreachableJSPromisebranch.
- Fix: with
- Added
-
JSArrayExtension:push: usesJSArray.add.- Fix:
toListOfDoublenow returnsList<double>(was aList<int>of only the integer elements). - Fix:
toListOfIntreturned an empty list withdart2wasm(JS numbers are dartified asdouble).
It now returns the integer-valued numbers on all platforms.
-
JSArrayOfJSNumberExtension:- Fix:
toListNumthrew for non-integer numbers (e.g.2.5) withdart2js.
- Fix:
-
Tests:
- Added integration tests (
test/js_integration_test.dart) exchanging values with real JS code
(JSON, iteration protocols,Set/Map/generators, callbacks,BigInt,Date, typed arrays, prototypes). - Added unit tests for the whole public API (
test/js_interop_utils_api_test.dart).
- Added integration tests (
-
JSObjectUtil: addedprototype(Object.prototype). -
lints: ^6.1.0
-
test: ^1.32.0
-
dependency_validator: ^5.1.0