To See how js parses scripts ?

Hello & Thanks ,
I am learning javascript from “js101” and it would be a great help
if I understood how js works , Parsing scripts , lexical analysis and syntax tree ,
to actually see what js does with the different objects and elements
as it encounters them .

Pls, where can I read up on this ?

Thanks

Is this what you are looking for ?

No , I want to know what the interpreter does as it encounters
various js statements .
Thanks

Interpreter converts it into bytecode. You can read on V8 internals: http://v8project.blogspot.in/2016/08/firing-up-ignition-interpreter.html

I know what an iterpreter does ,
I want to see/know What and When it does it .
When iterpreter encounters a Function Declaration what does it do , and when .
When iterpreter encounters a Function Expression what does it do , and when .
When iterpreter encounters am IIF Function what does it do , and when .

Thanks

See the source code for lexer, parser for JavaScriptCore at https://github.com/kitsilanosoftware/JavaScriptCore

to actually see what js does with the different objects and elements
as it encounters them .
ie., I want to watch as things are interpreted .
ie., show me , so I can see it happening .
Thanks

Thanks

You can use esprima to see the tokens, AST etc.

1 Like