Skip to content
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

Make attribute Promise<T>[] attr; work. #26

Merged
merged 1 commit into from
Apr 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/webidl2.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@
ret.idlType = type() || error("Error parsing generic type " + value);
all_ws();
if (!consume(OTHER, ">")) error("Unterminated generic type " + value);
all_ws();
if (consume(OTHER, "?")) ret.nullable = true;
type_suffix(ret);
return ret;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion test/syntax/idl/generic.widl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
interface Foo {
Promise<ResponsePromise<sequence<DOMString?>>> bar();
readonly attribute Promise<DOMString>[] baz;
};

// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-08
Expand All @@ -14,4 +15,3 @@ interface ServiceWorkerClients {
interface FetchEvent : Event {
ResponsePromise<any> default();
};

25 changes: 25 additions & 0 deletions test/syntax/json/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@
"name": "bar",
"arguments": [],
"extAttrs": []
},
{
"type": "attribute",
"static": false,
"stringifier": false,
"inherit": false,
"readonly": true,
"idlType": {
"sequence": false,
"generic": "Promise",
"nullable": false,
"array": 1,
"nullableArray": [false],
"union": false,
"idlType": {
"sequence": false,
"generic": null,
"nullable": false,
"array": false,
"union": false,
"idlType": "DOMString"
}
},
"name": "baz",
"extAttrs": []
}
],
"inheritance": null,
Expand Down