Skip to content

Commit ef0353a

Browse files
authored
Merge pull request #486 from a-tarasyuk/bug/24717-send-method-parameter-must-be-nullable
Emitter ignores nullable arguments
2 parents d48f58c + cc8cb75 commit ef0353a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

baselines/dom.generated.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ interface ExtendableMessageEventInit extends ExtendableEventInit {
422422
lastEventId?: string;
423423
origin?: string;
424424
ports?: MessagePort[];
425-
source?: object | ServiceWorker | MessagePort;
425+
source?: object | ServiceWorker | MessagePort | null;
426426
}
427427

428428
interface FetchEventInit extends ExtendableEventInit {
@@ -501,7 +501,7 @@ interface IDBIndexParameters {
501501

502502
interface IDBObjectStoreParameters {
503503
autoIncrement?: boolean;
504-
keyPath?: string | string[];
504+
keyPath?: string | string[] | null;
505505
}
506506

507507
interface IDBVersionChangeEventInit extends EventInit {
@@ -1250,7 +1250,7 @@ interface PushSubscriptionJSON {
12501250
}
12511251

12521252
interface PushSubscriptionOptionsInit {
1253-
applicationServerKey?: BufferSource | string;
1253+
applicationServerKey?: BufferSource | string | null;
12541254
userVisibleOnly?: boolean;
12551255
}
12561256

@@ -7699,7 +7699,7 @@ interface HTMLOptionsCollection extends HTMLCollectionOf<HTMLOptionElement> {
76997699
* This method will throw a "HierarchyRequestError" DOMException if
77007700
* element is an ancestor of the element into which it is to be inserted.
77017701
*/
7702-
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
7702+
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;
77037703
/**
77047704
* Removes the item with index index from the collection.
77057705
*/
@@ -7964,7 +7964,7 @@ interface HTMLSelectElement extends HTMLElement {
79647964
* @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
79657965
* @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
79667966
*/
7967-
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
7967+
add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;
79687968
/**
79697969
* Returns whether a form will validate when it is submitted, without having to submit it.
79707970
*/
@@ -16414,7 +16414,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
1641416414
* Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.
1641516415
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
1641616416
*/
16417-
send(body?: Document | BodyInit): void;
16417+
send(body?: Document | BodyInit | null): void;
1641816418
/**
1641916419
* Combines a header in author request headers.
1642016420
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.

baselines/webworker.generated.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ interface ExtendableMessageEventInit extends ExtendableEventInit {
109109
lastEventId?: string;
110110
origin?: string;
111111
ports?: MessagePort[];
112-
source?: Client | ServiceWorker | MessagePort;
112+
source?: Client | ServiceWorker | MessagePort | null;
113113
}
114114

115115
interface FetchEventInit extends ExtendableEventInit {
@@ -135,7 +135,7 @@ interface IDBIndexParameters {
135135

136136
interface IDBObjectStoreParameters {
137137
autoIncrement?: boolean;
138-
keyPath?: string | string[];
138+
keyPath?: string | string[] | null;
139139
}
140140

141141
interface IDBVersionChangeEventInit extends EventInit {
@@ -221,7 +221,7 @@ interface PushSubscriptionJSON {
221221
}
222222

223223
interface PushSubscriptionOptionsInit {
224-
applicationServerKey?: BufferSource | string;
224+
applicationServerKey?: BufferSource | string | null;
225225
userVisibleOnly?: boolean;
226226
}
227227

@@ -2458,7 +2458,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
24582458
* Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.
24592459
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
24602460
*/
2461-
send(body?: object | BodyInit): void;
2461+
send(body?: object | BodyInit | null): void;
24622462
/**
24632463
* Combines a header in author request headers.
24642464
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.

src/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
256256
else {
257257
type = {
258258
name: types.map(t => t.name).join(" | "),
259-
nullable: !!types.find(t => t.nullable)
259+
nullable: !!types.find(t => t.nullable) || !!obj.nullable
260260
};
261261
}
262262
}

0 commit comments

Comments
 (0)