A Trip into the Compiler
summary
Implements the ES private fields proposal that ships in TypeScript 3.8, adding a private identifier token in the scanner, a private field AST node in the parser, and class-scoped symbols in the binder so usages link to declarations. Checker emits targeted errors for shadowing and illegal delete. Transformer converts fields to a WeakMap transformation with runtime brand checks, handles tricky cases like postfix ++ and destructuring, reports a V8 bug fixed and test262 case added, and lands via open GitHub collaboration.
AI-written summary · about
chapters (17)
- 0:00Start
- 0:32Private Fields
- 0:57Typescript Private Keyword
- 3:10The Ecmascript Specification
- 3:27The Scanner
- 3:57Private Identifier
- 5:17Parser
- 5:28Syntactic Grammar
- 6:07Abstract Syntax Tree Mean
- 6:27Typescript Ast Viewer
- 6:39Ast Viewer
- 8:10The Binder
- 13:08Transformer Phase
- 13:55To Transform Private Fields
- 16:53Type Error Exception
- 17:23Postfix Unary Increment
- 18:50To Transform the Structuring Assignment into a Private Field
related talks
33mHidden Gems of TypeScript compiler
36mMinifying Private Fields in TypeScript
24mStatic Analysis and Source Code Manipulation in TypeScript
01h 00mNew Features in TypeScript 2 and beyond
57mTypeScript : More than just another JS transpiler
49mTypescript. Runtime. And in Between.
27mAdvanced TypeScript: elegant solutions to common problems
19mYou don't know TS: often unknown parts of TypeScript
