Closed Bug 1659158 Opened 4 years ago Closed 2 years ago

WebIDL's 'void' type is changing to 'undefined'

Categories

(Core :: DOM: Bindings (WebIDL), task, P2)

task

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: jackalmage, Assigned: peterv)

References

Details

Attachments

(3 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36

Steps to reproduce:

As part of efforts to finally add an 'undefined' type to WebIDL (so methods/etc don't have to generalize their type to 'any'), it was decided to actually add 'undefined' as the type name, and so the previous function return signature 'void' is being removed for redundancy.

See https://github.com/heycam/webidl/pull/906 for details on the change.

This change will be merged shortly; this bug is a heads-up to adjust your IDL parser (see the PR for the changes to the grammar; it's quite small). You may wish to have a transitional period where you recognize 'void' and 'undefined' as synonyms, as specifications are moved over to the new syntax.

Severity: -- → S3
Type: defect → task
Priority: -- → P2
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → peterv
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:peterv, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(peterv)
Flags: needinfo?(echen)
Flags: needinfo?(echen)

This is blocked on figuring out the spec part (https://github.com/heycam/webidl/issues/962) and implementing the union support (which I have mostly done).

Flags: needinfo?(peterv)

This does not add union support for undefined yet. Still, it should allow devs to copy-paste IDL from the spec without manually replacing undefined to void.

I don't think we should do this without the union support. I pushed my patches to try: https://treeherder.mozilla.org/jobs?repo=try&revision=8dabab23487a9aba857ac35b9dd9d07e7bcef2ef

Attachment #9257357 - Attachment is obsolete: true

Depends on D107108

Attached patch Diff of generated binding code (obsolete) — Splinter Review
Attachment #9274125 - Attachment description: 1659158.patch → Diff of generated binding code

Seems like this should be fairly close to landable, and would make people adding new code match the specs, which is nice...

Attachment #9274125 - Attachment is obsolete: true
Flags: needinfo?(peterv)
Pushed by pvanderbeken@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8a62d45d03cf
Switch WebIDL from void to undefined. r=edgar
https://hg.mozilla.org/integration/autoland/rev/d65760500d06
Support undefined in union. r=edgar
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
See Also: → 1792444
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: