fix(utils): handle serializeFunction edge case (#5754)

This commit is contained in:
Aaron Ransley 2019-05-19 11:50:52 -07:00 committed by Pooya Parsa
parent 38fc721f50
commit d86e510563

View File

@ -45,6 +45,7 @@ export function serializeFunction(func) {
}
})
.replace(`${func.name || 'function'}(`, 'function (')
.replace(`function function`, `function`)
}
serializeFunction.internalFunctionRE = /^(\s*)(?!(?:if)|(?:for)|(?:while)|(?:switch))(\w+)\s*\((.*?)\)\s*\{/gm