Skip to content

Added a few lines of code to src/widlprocess.ts in order to fix issue #903 #904

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

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions src/widlprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function convert(text: string, commentMap: Record<string, string>) {
browser.namespaces!.push(convertNamespace(rootType, commentMap));
}
else if (rootType.type === "callback interface") {
browser["callback-interfaces"]!.interface[rootType.name] = convertInterface(rootType, commentMap);
browser["callback-interfaces"]!.interface[rootType.name] = convertCallbackInterface(rootType, commentMap);
}
else if (rootType.type === "callback") {
browser["callback-functions"]!["callback-function"][rootType.name]
Expand Down Expand Up @@ -92,6 +92,10 @@ function convertInterface(i: webidl2.InterfaceType, commentMap: Record<string, s
return result;
}

function convertCallbackInterface(i: webidl2.CallbackInterfaceType, commentMap: Record<string, string>) {
return convertInterfaceCommon(i, commentMap);
}

function convertInterfaceMixin(i: webidl2.InterfaceMixinType, commentMap: Record<string, string>) {
const result = convertInterfaceCommon(i, commentMap);
result.mixin = true;
Expand All @@ -109,7 +113,7 @@ function addComments(obj: any, commentMap: Record<string, string>, container: st
}
}

function convertInterfaceCommon(i: webidl2.InterfaceType | webidl2.InterfaceMixinType, commentMap: Record<string, string>) {
function convertInterfaceCommon(i: webidl2.InterfaceType | webidl2.CallbackInterfaceType | webidl2.InterfaceMixinType, commentMap: Record<string, string>) {
const result: Browser.Interface = {
name: i.name,
extends: "Object",
Expand Down