Modern Javascript has been steadily evolving, and in 2020 we saw the advent of optional chaining - a small but mighty language feature that found lightning quick adoption.
The syntax is simple - const errorMessage = res.body.error?.message
Once a spec for a language feature is agreed upon, how exactly does it get implemented? For NodeJS, Deno, and modern Chrome-powered browsers, we look to Google’s v8 Javascript engine for a ~250 LoC implementation.
This commit is essentially a quick tour through compiler design - v8’s scanners, tokens, parsers, ASTs, and bytecode generation all get small adjustments to make room for Token::QUESTION_PERIOD.
Links references:
Share this post