Skip to content

Commit f8d826b

Browse files
committed
fix: avoid TS type strip errors
returnType for example can itself contain other AST-like nodes, which would be traversed by context.next(), leading to "cannot override across a split point" magic string errors
1 parent 41476c1 commit f8d826b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/repl/src/lib/workers/typescript-strip-types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ const visitors: Visitors<any, { ms: MagicString }> = {
8383
ts_blank_space(context, { start: node.start, end: node.start + node.accessibility.length });
8484
}
8585

86+
delete node.typeAnnotation;
87+
delete node.typeParameters;
88+
delete node.typeArguments;
89+
delete node.returnType;
90+
delete node.accessibility;
91+
8692
context.next();
8793
},
8894
Decorator(node, context) {

0 commit comments

Comments
 (0)