Skip to content

Commit 56292ca

Browse files
committed
don't modify the TypeScript nodes, instead forward illegalDecorators to the java extractor
1 parent 6aca9b9 commit 56292ca

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,6 @@ 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-
211205
if (typeChecker != null && insideConditionalTypes === 0) {
212206
if (isTypedNode(node)) {
213207
let contextualType = isContextuallyTypedNode(node)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const astProperties: string[] = [
241241
"constructor",
242242
"declarationList",
243243
"declarations",
244-
"decorators",
244+
"illegalDecorators",
245245
"default",
246246
"delete",
247247
"dotDotDotToken",

javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ private Node convertEnumDeclaration(JsonObject node, SourceLocation loc) throws
11511151
loc,
11521152
hasModifier(node, "ConstKeyword"),
11531153
hasModifier(node, "DeclareKeyword"),
1154-
convertChildrenNotNull(node, "decorators"),
1154+
convertChildrenNotNull(node, "illegalDecorators"), // as of https://github.com/microsoft/TypeScript/pull/50343/ the property is called `illegalDecorators` instead of `decorators`
11551155
convertChild(node, "name"),
11561156
convertChildren(node, "members"));
11571157
attachSymbolInformation(enumDeclaration, node);

0 commit comments

Comments
 (0)