-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: add support for parsing async iterable<T>
type
#775
Draft
lucacasonato
wants to merge
1
commit into
w3c:main
Choose a base branch
from
lucacasonato:async_iterable_type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
(attr-invalid-type) Validation error at line 3 in invalid-attribute.webidl, inside `interface sequenceAsAttribute -> attribute invalid`: | ||
attribute sequence<short> invalid; | ||
^ Attributes cannot accept sequence types. | ||
(attr-invalid-type) Validation error at line 9 in invalid-attribute.webidl, inside `interface recordAsAttribute -> attribute invalid`: | ||
(attr-invalid-type) Validation error at line 9 in invalid-attribute.webidl, inside `interface asyncIterableAsAttribute -> attribute invalid`: | ||
async iterable<short> invalid; | ||
^ Attributes cannot accept async iterable types. | ||
(attr-invalid-type) Validation error at line 15 in invalid-attribute.webidl, inside `interface recordAsAttribute -> attribute invalid`: | ||
<DOMString, DOMString> invalid; | ||
^ Attributes cannot accept record types. | ||
(attr-invalid-type) Validation error at line 17 in invalid-attribute.webidl, inside `interface dictionaryAsAttribute -> attribute dict`: | ||
(attr-invalid-type) Validation error at line 23 in invalid-attribute.webidl, inside `interface dictionaryAsAttribute -> attribute dict`: | ||
attribute Dict dict; | ||
^ Attributes cannot accept dictionary types. | ||
(attr-invalid-type) Validation error at line 18 in invalid-attribute.webidl, inside `interface dictionaryAsAttribute -> attribute dictUnion`: | ||
(attr-invalid-type) Validation error at line 24 in invalid-attribute.webidl, inside `interface dictionaryAsAttribute -> attribute dictUnion`: | ||
attribute (Dict or boolean) dictUnion | ||
^ Attributes cannot accept dictionary types. | ||
(attr-invalid-type) Validation error at line 28 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr1`: | ||
(attr-invalid-type) Validation error at line 34 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr1`: | ||
readonly attribute [EnforceRange] long readOnlyAttr1; | ||
^ Readonly attributes cannot accept [EnforceRange] extended attribute. | ||
(attr-invalid-type) Validation error at line 29 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr2`: | ||
(attr-invalid-type) Validation error at line 35 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr2`: | ||
readonly attribute [EnforceRange] GPUInt32In readOnlyAttr2; | ||
^ Readonly attributes cannot accept [EnforceRange] extended attribute. | ||
(attr-invalid-type) Validation error at line 30 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr2`: | ||
(attr-invalid-type) Validation error at line 36 in invalid-attribute.webidl, inside `interface EnforceRangeInReadonlyAttribute -> attribute readOnlyAttr2`: | ||
readonly attribute GPUInt32 readOnlyAttr2; | ||
^ Readonly attributes cannot accept [EnforceRange] extended attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(operation-return-invalid-type) Validation error at line 1 in invalid-callback-argument.webidl, inside `callback DoSomething -> argument bool`: | ||
async iterable<DOMString> bool); | ||
^ Callback function arguments can not be async iterable types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(operation-return-invalid-type) Validation error at line 3 in invalid-operation-return.webidl, inside `interface asyncIterableReturn -> operation stream`: | ||
async iterable<short> stream(async iterable< | ||
^ Operations can not return async iterable types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
callback DoSomething = Promise<DOMString> (async iterable<DOMString> bool); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[Exposed=Window] | ||
interface asyncIterableReturn { | ||
async iterable<short> stream(async iterable<short> foo); | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
[ | ||
{ | ||
"type": "interface", | ||
"name": "Canvas", | ||
"inheritance": null, | ||
"members": [ | ||
{ | ||
"type": "operation", | ||
"name": "drawPolygonAsync", | ||
"idlType": { | ||
"type": "return-type", | ||
"extAttrs": [], | ||
"generic": "Promise", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": [ | ||
{ | ||
"type": "return-type", | ||
"extAttrs": [], | ||
"generic": "", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": "undefined" | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "argument", | ||
"name": "coordinates", | ||
"extAttrs": [], | ||
"idlType": { | ||
"type": "argument-type", | ||
"extAttrs": [], | ||
"generic": "async iterable", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": [ | ||
{ | ||
"type": "argument-type", | ||
"extAttrs": [], | ||
"generic": "", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": "float" | ||
} | ||
] | ||
}, | ||
"default": null, | ||
"optional": false, | ||
"variadic": false | ||
} | ||
], | ||
"extAttrs": [], | ||
"special": "" | ||
} | ||
], | ||
"extAttrs": [], | ||
"partial": false | ||
}, | ||
{ | ||
"type": "interface", | ||
"name": "I", | ||
"inheritance": null, | ||
"members": [ | ||
{ | ||
"type": "operation", | ||
"name": "f1", | ||
"idlType": { | ||
"type": "return-type", | ||
"extAttrs": [], | ||
"generic": "Promise", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": [ | ||
{ | ||
"type": "return-type", | ||
"extAttrs": [], | ||
"generic": "", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": "undefined" | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "argument", | ||
"name": "arg", | ||
"extAttrs": [], | ||
"idlType": { | ||
"type": "argument-type", | ||
"extAttrs": [], | ||
"generic": "async iterable", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": [ | ||
{ | ||
"type": "argument-type", | ||
"extAttrs": [ | ||
{ | ||
"type": "extended-attribute", | ||
"name": "XAttr", | ||
"rhs": null, | ||
"arguments": [] | ||
} | ||
], | ||
"generic": "", | ||
"nullable": false, | ||
"union": false, | ||
"idlType": "float" | ||
} | ||
] | ||
}, | ||
"default": null, | ||
"optional": false, | ||
"variadic": false | ||
} | ||
], | ||
"extAttrs": [], | ||
"special": "" | ||
} | ||
], | ||
"extAttrs": [], | ||
"partial": false | ||
}, | ||
{ | ||
"type": "eof", | ||
"value": "" | ||
} | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
interface Canvas { | ||
Promise<undefined> drawPolygonAsync(async iterable<float> coordinates); | ||
}; | ||
|
||
interface I { | ||
Promise<undefined> f1(async iterable<[XAttr] float> arg); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It indeed doesn't make sense but the spec PR does not fix https://whatpr.org/webidl/1397/402a886...0402e85.html#idl-attributes "The type of the attribute ..." part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec PR disallows it outright in any "return to JS position" because it does not define IDL->JS conversion (only JS->IDL).
Should I make this more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes as sequence being attribute is disallowed multiple times in the spec (at the attribute definition and also at the sequence definition).