Skip to content

Dom API Create throws "Illegal constructor" #47

@olivercoad

Description

@olivercoad

Calling HTMLImageElement.Create (512., 512.) throws "Uncaught TypeError: Illegal constructor".

I came across the same issue as #25 but the fix for that didn't work.
I was going to just submit a PR with the fix @alfonsogarciacaro proposed because I can confirm that changing

[<Emit("new $0($1...)">]

to

[<Emit("new Image($1...)")>]

works.

However I noticed that this pattern is used throughout Browser.Dom.fs so I tried ___.Create for a few other elements types and it looks like they all have the same issue (atleast all the ones I tested).
It's not like it's just a few types that weren't initially tested and happen to have quirks; has something changed about the way fable handles type names or something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions