With browsers which use the
V8 JavaScript engine (JIT compilation)
, how much of the code is actually compiled into machine code and executed directly? Does it pick out bits or is the wholeJavaScript
compiled?Also, during the execution of the compiled code what would happen if I was to assign a function to an object in
JavaScript
? In typical languages this would be illegal, but I thought this flexibility withinJavaScript
came from the fact that it was interpreted so no illegal actions were technically executed? But if its compiled what happens in that scenario?
P.S
Sorry, what I mean is what would happen is this compiled code was executed "myObject = myFunction", assuming those variables were declared elsewhere. Would this be a legal assignment?
Many thanks in advance.