mirror of
https://github.com/getify/You-Dont-Know-JS.git
synced 2025-04-07 06:31:16 +08:00
Merge pull request #1559 from sachinmaskalle/patch-1
Typo in Warning section
This commit is contained in:
commit
1e6fe1bb74
@ -117,7 +117,7 @@ The only way the JS engine could know, at the line where the error is thrown, th
|
||||
|
||||
Hopefully you're now convinced that JS programs are parsed before any execution begins. But does that prove they are compiled?
|
||||
|
||||
This is an interesting question to ponder. Could JS parse a program, but then execute that program by *interpreting* the AST node-by-node **without** compiling the program in between? Yes, that is *possible*, but it's extremely unlikely, because it would be highly inefficient performance wise. It's hard to imagine a scenario where a production-quality JS engine would go to all the touble of parsing a program into an AST, but not then convert (aka, "compile") that AST into the most efficient (binary) representation for the engine to then execute.
|
||||
This is an interesting question to ponder. Could JS parse a program, but then execute that program by *interpreting* the AST node-by-node **without** compiling the program in between? Yes, that is *possible*, but it's extremely unlikely, because it would be highly inefficient performance wise. It's hard to imagine a scenario where a production-quality JS engine would go to all the trouble of parsing a program into an AST, but not then convert (aka, "compile") that AST into the most efficient (binary) representation for the engine to then execute.
|
||||
|
||||
Many have endeavored to split hairs with this terminology, as there's plenty of nuance to fuel "well, actually..." interjections. But in spirit and in practice, what the JS engine is doing in processing JS programs is **much more alike compilation** than different.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user