dart:js_interop_unsafe library
Utility methods to manipulate JavaScript objects dynamically.
This library is typically meant to be used when the names of properties ormethods are not known statically. This library is similar todart:js_util,except the methods here are extension methods that use JS types. Thisallows code using these functions to also be compiled to WebAssembly.
In general, prefer to write JS interop interfaces and external staticinterop members usingdart:js_interop. This library is meant to workaround issues and help with migration from older JS interop libraries.
Note
As the name suggests, usage of this librarycan be unsafe. This meansthat safe usage of these methods cannot necessarily be verifiedstatically. Prefer using statically analyzable values like constants orliterals for property or method names so that usage can be verified. Thislibrary should be used cautiously and only when the same effect cannot beachieved with static interop.
Extensions
- JSFunctionUnsafeUtilExtension onJSFunction
- Utility methods to callJSFunctions as constructors.
- JSObjectUnsafeUtilExtension onJSObject
- Utility methods to check, get, set, and call properties on aJSObject.