Skip to content

Commit b2a35d2

Browse files
crutch12pi0
authored andcommitted
fix(utils): add catch statement to non function block in serializeFunction (nuxt#6776) (nuxt#6777)
1 parent 0ef6c72 commit b2a35d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utils/src/serialize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ export function serializeFunction (func) {
4848
.replace('function function', 'function')
4949
}
5050

51-
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch))(\w+)\s*\((.*?)\)\s*\{/gm
51+
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch)|(?:catch))(\w+)\s*\((.*?)\)\s*\{/gm
5252
serializeFunction.assignmentRE = /^(\s*):(\w+)\(/gm

0 commit comments

Comments
 (0)