Re: [heycam/webidl] How to tell the type of "construct a callback function"? (#557)

> But how can we tell the types of the arguments list for construct?

When would these types be used?  The algorithm at https://heycam.github.io/webidl/#construct-a-callback-function takes a pair of callback function and already-typed argument list; the type information is in the list already, which is how you can tell what the types involved are....

> FYI, CustomElementRegistry.define takes |constructor| of type |Function|

So here is an interesting question.  When is this callback actually used?  It's used in upgrades, which construct it with no arguments.  I don't see any other uses.  And that use more or less ignores the return value (well, it passes it to SameValue, which takes an ES value, so `any` is an appropriate type there).

One could argue that the real type of this thing should be something like `callback Whatever = any ()` or so...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/557#issuecomment-391022440

Received on Tuesday, 22 May 2018 14:58:18 UTC