Skip to content

Commit 6aca9b9

Browse files
committed
fix support for illegal decorators in the TypeScript extractor
1 parent 50734c7 commit 6aca9b9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

javascript/extractor/lib/typescript/src/ast_extractor.ts

+6
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ export function augmentAst(ast: AugmentedSourceFile, code: string, project: Proj
202202
}
203203
}
204204

205+
// This PR: https://github.com/microsoft/TypeScript/pull/50343/ changed how illegal decorators are stored, this hack reverts it.
206+
// Those decorator uses are syntax errors, but people use them anyway.
207+
if ((node as any).illegalDecorators) {
208+
(node as any).decorators = (node as any).illegalDecorators;
209+
}
210+
205211
if (typeChecker != null && insideConditionalTypes === 0) {
206212
if (isTypedNode(node)) {
207213
let contextualType = isContextuallyTypedNode(node)

0 commit comments

Comments
 (0)