Skip to content

Commit 9102a50

Browse files
authored
Manually update to bcd@7.1.24 (microsoft#2276)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 1081d77 commit 9102a50

File tree

7 files changed

+1719
-39
lines changed

7 files changed

+1719
-39
lines changed

baselines/dom.generated.d.ts

Lines changed: 419 additions & 2 deletions
Large diffs are not rendered by default.

baselines/ts5.5/dom.generated.d.ts

Lines changed: 419 additions & 2 deletions
Large diffs are not rendered by default.

baselines/ts5.6/dom.generated.d.ts

Lines changed: 419 additions & 2 deletions
Large diffs are not rendered by default.

baselines/ts5.9/dom.generated.d.ts

Lines changed: 419 additions & 2 deletions
Large diffs are not rendered by default.

inputfiles/patches/html.kdl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ interface-mixin WindowEventHandlers {
1616
// The unload event is not reliable, consider visibilitychange or pagehide events
1717
property onunload deprecated=#true
1818
}
19+
20+
// Blink and Gecko support precommit but BCD is not updated yet
21+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1970123
22+
interface NavigationPrecommitController exposed=Window {
23+
method redirect exposed=Window
24+
}
25+
interface NavigationTransition {
26+
property committed exposed=Window
27+
}

package-lock.json

Lines changed: 7 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build/patches.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,25 +296,38 @@ function handleMethod(child: Node): DeepPartial<OverridableMethod> {
296296
}
297297
}
298298

299-
// Determine the actual signature object
300-
const signatureObj: DeepPartial<Signature> = {
301-
param: params,
302-
...(typeNode
303-
? handleTyped(typeNode)
304-
: {
299+
const type = typeNode
300+
? handleTyped(typeNode)
301+
: child.properties?.returns
302+
? {
305303
type: string(child.properties?.returns),
306304
subtype: undefined,
307-
}),
308-
};
305+
}
306+
: null;
309307

310-
let signature: OverridableMethod["signature"];
311308
const signatureIndex = child.properties?.signatureIndex;
312-
if (typeof signatureIndex == "number") {
313-
signature = { [signatureIndex]: signatureObj };
314-
} else {
315-
signature = [signatureObj];
309+
if ((params.length || signatureIndex) && !type) {
310+
throw new Error("A method signature requires a type");
311+
}
312+
313+
let signature: OverridableMethod["signature"] = [];
314+
if (type) {
315+
// Determine the actual signature object
316+
const signatureObj: DeepPartial<Signature> = {
317+
param: params,
318+
...type,
319+
};
320+
if (typeof signatureIndex == "number") {
321+
signature = { [signatureIndex]: signatureObj };
322+
} else {
323+
signature = [signatureObj];
324+
}
316325
}
317-
return { name, signature };
326+
return {
327+
name,
328+
signature,
329+
...optionalMember("exposed", "string", child.properties.exposed),
330+
};
318331
}
319332

320333
/**

0 commit comments

Comments
 (0)