fix(utils): add catch statement to non function block in serializeFunction (#6776) (#6777)

This commit is contained in:
crutch12 2019-12-17 00:20:28 +03:00 committed by Pooya Parsa
parent 0ef6c72a9c
commit b2a35d21d7

View File

@ -48,5 +48,5 @@ export function serializeFunction (func) {
.replace('function function', 'function')
}
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch))(\w+)\s*\((.*?)\)\s*\{/gm
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch)|(?:catch))(\w+)\s*\((.*?)\)\s*\{/gm
serializeFunction.assignmentRE = /^(\s*):(\w+)\(/gm