Skip to content

Specialise dyn_ref to improve value detection #1367

Closed
@RReverser

Description

@RReverser

I think dyn_ref should be specialised where possible to support objects from other realms (for which regular instanceof check would fail).

For example, it's more reliable to use Array::is_array instead of current instanceof Array for .dyn_ref::<js_sys::Array>(), JsValue::is_object for .dyn_ref::<Object>() and probably also existing methods for primitives for conversions to js_sys::Number, js_sys::JsString and so on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions