Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Passing a Dart Type to interop lends a WrappedType instead of the real class #633

Description

@dam0vm3nt

Any reference to a dart type like in :

  var x = MyTag

gets translated in

let x = dart.wrapType(index.MyTag);

So when passing a type to an interop call like in new JsObject.fromBrowserObject(h.document).callMethod("registerElement",['my-tag', x]); the native call receives a WrappedType instead of the actual Dart translated JS class.

Trying to "jsify" in the hope that the type will get unrwapped will ends up in an exception.

There should be a way to pass the actual class to native calls.

Activity

  1. jmesserly commented on Aug 26, 2016

    @jmesserly
    Contributor

    @jacob314 -- should JS interop to provide some way to go from a Type to the corresponding JS constructor function? It seems like it, IMO.

    @dam0vm3nt -- a workaround for now is to call dart.unwrapType(x) from JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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