Skip to content

Commit 0e02b36

Browse files
committed
fix(compiler): add missing return statement for matchAll
1 parent 7880055 commit 0e02b36

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/compiler.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,12 @@ function compileRouteMatch(
102102
staticNodes,
103103
matchAll,
104104
);
105+
const returnStmt = matchAll ? "return r;" : "";
105106
return (
106107
str +
107108
(existsTail
108-
? "let s=p.split('/'),l=s.length-1;" +
109-
tail +
110-
(matchAll ? ";return r" : "")
111-
: "")
109+
? "let s=p.split('/'),l=s.length-1;" + tail + returnStmt
110+
: returnStmt)
112111
);
113112
}
114113

0 commit comments

Comments
 (0)