Closed domenic closed 4 years ago
OK, this is ready for review. I've integration-tested it with https://github.com/whatwg/streams/pull/1035 so the generated code works. But the source code could still benefit from review, and maybe we could pretty up the generated code. And if anyone has better ideas than [WebIDL2JSHasReturnSteps]
, please let me know.
I put this on top of #225, but I don't think that's a strict dependency. I also tried to separate this out into semi-logical commits to show my progress and separate the parts I'm sure of from the parts I wasn't, but rebaselining the snapshot file is a pain, so that kind of stopped; it's probably best to just review the whole thing.
OK, this is ready for review. It continues to test well with the corresponding whatwg/streams PR.
This starts to implement async iterables, #215, by following the spec as much as posisble.
This is missing:
Passing arguments to theThis wasn't so bad.utils.asyncIteratorInit
hook. The hard part here is that I'm not sure how to implement convert arguments for an async iterator method, since all our code to implement conversions and handle argument processing seems to be insidegenerateOverloadConversions
which is pretty complicated.Adding the
return
method appropriately. This is tricky because the Web IDL spec says to only add the return method "If an asynchronous iterator return algorithm is defined for the interface". That is, it's unclear how to generate this code without asking the runtime question ofutils.asyncIteratorReturn in Impl.prototype
. The best idea I have here is to add a new extended attribute,[WebIDL2JSHasAsyncIteratorReturnSteps]
.I would appreciate help here, especially on the former.