feat(webkit): roll WebKit to 1246 (#2400)

This commit is contained in:
Pavel Feldman 2020-05-28 22:35:01 -07:00 committed by GitHub
parent 4e8a03cd8b
commit 4ac30f354a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -10,7 +10,7 @@
}, },
{ {
"name": "webkit", "name": "webkit",
"revision": "1242" "revision": "1246"
} }
] ]
} }

View file

@ -40,6 +40,8 @@ async function generateWebKitProtocol(folderPath) {
console.log(`Wrote protocol.ts for WebKit to ${path.relative(process.cwd(), outputPath)}`); console.log(`Wrote protocol.ts for WebKit to ${path.relative(process.cwd(), outputPath)}`);
} }
const conditionFilter = command => command.condition !== 'defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY';
function jsonToTS(json) { function jsonToTS(json) {
return `// This is generated from /utils/protocol-types-generator/index.js return `// This is generated from /utils/protocol-types-generator/index.js
type binary = string; type binary = string;
@ -69,7 +71,7 @@ export module Protocol {${json.domains.map(domain => `${domain.description ? `
${parameter.name}${parameter.optional ? '?' : ''}: ${typeOfProperty(parameter)};`).join(``)} ${parameter.name}${parameter.optional ? '?' : ''}: ${typeOfProperty(parameter)};`).join(``)}
}` : ` }` : `
export type ${event.name}Payload = void;`}`).join('')} export type ${event.name}Payload = void;`}`).join('')}
${(domain.commands || []).map(command => `${command.description ? ` ${(domain.commands || []).filter(conditionFilter).map(command => `${command.description ? `
/** /**
* ${command.description} * ${command.description}
*/` : ''} */` : ''}
@ -90,10 +92,10 @@ export module Protocol {${json.domains.map(domain => `${domain.description ? `
export interface Events {${json.domains.map(domain => (domain.events || []).map(event => ` export interface Events {${json.domains.map(domain => (domain.events || []).map(event => `
"${domain.domain}.${event.name}": ${domain.domain}.${event.name}Payload;`).join('')).join('')} "${domain.domain}.${event.name}": ${domain.domain}.${event.name}Payload;`).join('')).join('')}
} }
export interface CommandParameters {${json.domains.map(domain => (domain.commands || []).map(command => ` export interface CommandParameters {${json.domains.map(domain => (domain.commands || []).filter(conditionFilter).map(command => `
"${domain.domain}.${command.name}": ${domain.domain}.${command.name}Parameters;`).join('')).join('')} "${domain.domain}.${command.name}": ${domain.domain}.${command.name}Parameters;`).join('')).join('')}
} }
export interface CommandReturnValues {${json.domains.map(domain => (domain.commands || []).map(command => ` export interface CommandReturnValues {${json.domains.map(domain => (domain.commands || []).filter(conditionFilter).map(command => `
"${domain.domain}.${command.name}": ${domain.domain}.${command.name}ReturnValue;`).join('')).join('')} "${domain.domain}.${command.name}": ${domain.domain}.${command.name}ReturnValue;`).join('')).join('')}
} }
} }