Skip to content

Commit 1e6fe1b

Browse files
authoredDec 8, 2019
Merge pull request getify#1559 from sachinmaskalle/patch-1
Typo in Warning section
2 parents 978f800 + b536b0e commit 1e6fe1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎scope-closures/ch1.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The only way the JS engine could know, at the line where the error is thrown, th
117117

118118
Hopefully you're now convinced that JS programs are parsed before any execution begins. But does that prove they are compiled?
119119

120-
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.
120+
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.
121121

122122
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.
123123

0 commit comments

Comments
 (0)
Please sign in to comment.