Engine262 - How to "RUN" the ecmascript specification? | Javascript engine

Published: 28 November 2020
on channel: bendtherules
1,036
37

If you have tried reading the Ecmascript specification (javascript), a common problem is that you can't really run or debug parts of the specification to see how it works. So, you can run the code in a simple js engine like Engine262.

Using engine262, we will debug why `[ ] == ![ ]` evaluates to true.

00:00 Intro
01:11 Why is reading spec hard?
02:44 How to run specification?
02:57 Engine262 Intro
04:28 Setting up engine262
09:53 Run code within engine262
11:44 Parsing and evaluation step
12:53 See AST using astexplorer.net
14:05 How to find releveant sections in code and AST?
19:36 Evalate `![ ]`
21:12 [] == ! ToBoolean(true)
22:50 Evaluate `==`
23:40 From `[] == false` to `[] == 0`
25:51 From `[] == 0` to `"" == 0`
30:51 From `"" == 0` to `0 == 0`
32:34 which returns true
33:22 Using print() to console.log
34:09 Outro

Links -
1. LinkedIn post by Harish - https://www.linkedin.com/feed/update/...
2. Engine262 - https://github.com/engine262/engine262
3. ASTExplorer - https://astexplorer.net/


On this page of the site you can watch the video online Engine262 - How to "RUN" the ecmascript specification? | Javascript engine with a duration of hours minute second in good quality, which was uploaded by the user bendtherules 28 November 2020, share the link with friends and acquaintances, this video has already been watched 1,036 times on youtube and it was liked by 37 viewers. Enjoy your viewing!