Fix crash with minified functions
This is an example of a valid minified function that doesn't work with the regex in toFunction: function profileModelWorkerRunner(){var Moment=eval("require")("moment-timezone");self.onmessage=function(event){var profileModelClass=eval("require")(event.data.profileModelPath).default,profileModelWorker=new profileModelClass(Moment,event.data.timezone),params=event.data.params;var result=profileModelWorker.check(params);postMessage(result)}} I've replaced that code with an eval, which is safer than parsing JS code (which is not a context-free grammar) with regular expressions.
Loading
Please register or sign in to comment