toJSProxyOrRef property

JSArray<T> get toJSProxyOrRef

Converts this List to a JSArray by either casting, unwrapping, or proxying the List.

Note

Depending on whether code is compiled to JavaScript or Wasm, this conversion will have different semantics. When compiling to JavaScript, the core List is a JavaScript Array, and therefore this method simply casts. User-defined Lists are currently unsupported when compiling to JavaScript. When compiling to Wasm, this List may or may not be a wrapper depending on if it was converted from JavaScript or instantiated in Dart. If it's a wrapper, this method unwraps it. If it's instantiated in Dart, this method proxies the List using a heavyweight Array wrapper. Access to the original List's elements may be very unperformant. Modifications to this List will affect the JSArray and vice versa.

Implementation

external JSArray<T> get toJSProxyOrRef;