The JavaScript standard states that a JavaScript execution environment must parse the function and produce early errors refusing to execute any code in the script if they exist (such as missing close quotes, unmatched curly braces etc.). It says nothing about what happens after than.
However, all modern engines will produce native code corresponding to the function prior to executing it. All subsequent invocations will use the code generated earlier. There are times where an engine will regenerate the code by using information it collected by execution or it might inline the code of the function if it can determine that would result in better execution time.