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

Normative: Add null type, and allow it as a return type (excl. unions) #950

Closed
wants to merge 1 commit into from

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jan 22, 2021

This complements #906 and makes it possible to specify the legacy PluginArray and MediaTypeArray APIs without using a nullable object? type: whatwg/html#6296 (comment)

 [Exposed=Window]
 interface PluginArray {
 	undefined refresh();
 	readonly attribute unsigned long length;
-	object? item(unsigned long index);
-	object? namedItem(DOMString name);
+	null item(unsigned long index);
+	null namedItem(DOMString name);
 };
 
 [Exposed=Window]
 interface MimeTypeArray {
 	readonly attribute unsigned long length;
-	object? item(unsigned long index);
-	object? namedItem(DOMString name);
+	null item(unsigned long index);
+	null namedItem(DOMString name);
 };

Unlike #866, this keeps nullable types for now.


Preview | Diff

@annevk
Copy link
Member

annevk commented Jan 22, 2021

I think we need a more compelling use case to change IDL.

@domenic
Copy link
Member

domenic commented Aug 2, 2021

Folks generally agree this makes sense, but isn't needed until this comes up again a couple of times. (Especially since the HTML plugin example no longer works.) Something like this might fall out of a larger project to straighten out unions/typedefs, and the relationship between ?, null, and undefined.

@domenic domenic closed this Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants