-
Notifications
You must be signed in to change notification settings - Fork 19
Using any
for the return type of item
may incur a performance hit
#7
Comments
I'm confused - |
Right now in Web IDL the only type that allows |
ah, i misunderstood, thanks for clarifying. does that mean that anything in HTML that returns |
First, very few things in HTML return Second, it's not a matter of "prohibited". It's just that you have no idea what the return type must be, because it's literally With IDL could be extended to allow expressing something like |
Makes sense. Since very few things in JS return |
That seems like a worthy endeavor! Is there a issue tracker for IDL to request that change? |
whatwg/webidl#60 exists already, fwiw. |
Yeah, we just need to fix that issue in WebIDL. It's not hard, just needs to be carried to completion. |
but that PR has opened for 5 years... |
The change to use
any
(to allowundefined
) will mean some deoptimization of the callers ofitem
, because they will not be able to obtain any (JIT) compile-time type information, whereas right now they can do just that.The text was updated successfully, but these errors were encountered: