diff --git a/scripts/globals-extractor.mjs b/scripts/globals-extractor.mjs index 3728a4dfe4..07f3470e77 100644 --- a/scripts/globals-extractor.mjs +++ b/scripts/globals-extractor.mjs @@ -16,14 +16,17 @@ const SPECIALS = ['global', 'globalThis', 'InternalError', 'process', 'undefined const get_url = (name) => `https://raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.${name}.d.ts`; const extract_name = (split) => split.match(/^[a-zA-Z0-9_$]+/)[0]; -const extract_functions_and_references = (data) => { +const extract_functions_and_references = (name, data) => { const functions = []; const references = []; data.split('\n').forEach(line => { const trimmed = line.trim(); const split = trimmed.replace(/[\s+]/, ' ').split(' '); - if (split[0] === 'declare') functions.push(extract_name(split[2])); - else if (trimmed.startsWith('/// { if (fetched_names.has(name)) return res; fetched_names.add(name); const body = await do_get(get_url(name)); - const { functions, references } = extract_functions_and_references(body); + const { functions, references } = extract_functions_and_references(name, body); res.push(...functions); const chile_functions = await Promise.all(references.map(get_functions)); chile_functions.forEach(i => res.push(...i)); diff --git a/src/compiler/utils/globals.ts b/src/compiler/utils/globals.ts index 4ddcfea2cd..e95f18db3d 100644 --- a/src/compiler/utils/globals.ts +++ b/src/compiler/utils/globals.ts @@ -1,6 +1,6 @@ /** ---------------------------------------------------------------------- This file is automatically generated by `scripts/globals-extractor.mjs`. -Generated At: 2022-08-14T15:28:31.556Z +Generated At: 2022-08-14T16:40:42.472Z ---------------------------------------------------------------------- */ export default new Set([ @@ -75,7 +75,6 @@ export default new Set([ 'ChannelMergerNode', 'ChannelSplitterNode', 'CharacterData', - 'ClassDecorator', 'ClientRect', 'Clipboard', 'ClipboardEvent', @@ -294,7 +293,6 @@ export default new Set([ 'MessageChannel', 'MessageEvent', 'MessagePort', - 'MethodDecorator', 'MimeType', 'MimeTypeArray', 'MouseEvent', @@ -319,7 +317,6 @@ export default new Set([ 'OverconstrainedError', 'PageTransitionEvent', 'PannerNode', - 'ParameterDecorator', 'Path2D', 'PaymentAddress', 'PaymentMethodChangeEvent', @@ -350,10 +347,7 @@ export default new Set([ 'ProcessingInstruction', 'ProgressEvent', 'Promise', - 'PromiseConstructorLike', 'PromiseRejectionEvent', - 'PropertyDecorator', - 'PropertyKey', 'Proxy', 'PublicKeyCredential', 'PushManager',