-
-
Couldn't load subscription status.
- Fork 68
feat: add support for parsing async_sequence<T> type
#775
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
Changes from 2 commits
88cb13f
25d01c0
6f9191f
7d78f2c
bff4eb0
21c5f8b
7e1b0bf
3e1098a
31fa8f9
c29c1d5
9ec2360
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,9 @@ export class Attribute extends Base { | |
| yield* this.extAttrs.validate(defs); | ||
| yield* this.idlType.validate(defs); | ||
|
|
||
| if (["sequence", "record"].includes(this.idlType.generic)) { | ||
| if ( | ||
| ["async iterable", "sequence", "record"].includes(this.idlType.generic) | ||
|
||
| ) { | ||
| const message = `Attributes cannot accept ${this.idlType.generic} types.`; | ||
| yield validationError( | ||
| this.tokens.name, | ||
|
|
||
| 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. |
| 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. |
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| callback DoSomething = Promise<DOMString> (async iterable<DOMString> bool); |
| 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); | ||
| }; |
| 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": "" | ||
| } | ||
| ] |
| 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); | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.