JS run trilogy
- Gramma analysis
- Precompiled
- Interpreted
Enhance the overall function declarations
variable declarations upgrade
Precompiled prelude
Precompiled
- AO create objects
- Get parameter and variable declarations (including variable declarations inside an if statement), and the variable name as the parameter AO attribute name, value is undefined
- The parameter argument value and unified
- Find a function declaration in the function body, the value assigned to the function body
Step procedure as follows:
3.
4.
execution
added:
function expression: var a = function () { }
function declarations (lift): function a () {}
Precompiled not only in the function body also occur in the global
Global:
1. objects GO generated} {GO
2. invisible parameter; only variable declaration undefined
X-invisible parameter argument unified 3.
4. The function declaration and the function imparting member
GO === window
Example A:
execution
Example B:
Example C:
lifting Example D:
lifting Example E:
Supplementary typeof
Only one case (typeof) defined without error, returning undefined
Example: