Skip to content
Snippets Groups Projects
Commit 70ce2ba0 authored by Daniel Di Sarli's avatar Daniel Di Sarli Committed by GitHub
Browse files

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.
parent 58182859
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment