Skip to content

Commit 1ab7c49

Browse files
committed
fix bug in hermes parsing
1 parent 5cf402d commit 1ab7c49

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

incubator/tools-babel/src/parse.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ export function hermesParseToAst({
6868
config,
6969
}: TransformerArgs): Node | null {
7070
const { parseDisableHermes } = context;
71-
if (!parseDisableHermes) {
72-
hermesParse(src, {
73-
babel: true,
74-
reactRuntimeTarget: "19",
75-
sourceType: config.sourceType ?? undefined,
76-
});
71+
if (parseDisableHermes) {
72+
return null;
7773
}
78-
return null;
74+
return hermesParse(src, {
75+
babel: true,
76+
reactRuntimeTarget: "19",
77+
sourceType: config.sourceType ?? undefined,
78+
});
7979
}
8080

8181
export function parseToAst(args: TransformerArgs): Node | null {

0 commit comments

Comments
 (0)