-
Notifications
You must be signed in to change notification settings - Fork 32
Constructors for some DOM types may simply throw. #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would |
Hmm, maybe it would? Would you prefer a magic constructor that calls |
I was just suggesting In any case, I just noticed the language perspective on this question—it would a serious mistake to assume that I can say anything useful about web programming. ;-) |
What if we don't emit them? We may get issues today in our current staticInterop implementation, so we may need to emit a private unaccessible constructor instead? (dart:html does both that and the factory that uses Howevr, once we switch to inline-classes, does this problem go away and we can simply omit a constructor altogether? |
I would think so. |
I ran again into these, so I'd suggest we do make a change to make these stand out more easily:
@staticInterop @JS
class HTMLDivElement ... {
HTMLDivElement._() => throw "unsupported";
}
|
Handled in #185. |
Currently, there are many constructors that throw. For example,
web.HTMLDivElement()
. We should either lower these likedart:html
todocument.createElement
, or we should find some way to disallow invoking the constructor statically, i.e. a lint.The text was updated successfully, but these errors were encountered: