1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00
serenity/Libraries/LibJS
Andreas Kling ac7459cb40 LibJS: Hoist variable declarations to the nearest relevant scope
"var" declarations are hoisted to the nearest function scope, while
"let" and "const" are hoisted to the nearest block scope.

This is done by the parser, which keeps two scope stacks, one stack
for the current var scope and one for the current let/const scope.

When the interpreter enters a scope, we walk all of the declarations
and insert them into the variable environment.

We don't support the temporal dead zone for let/const yet.
2020-04-13 17:22:23 +02:00
..
Heap LibJS: Throw real TypeError, ReferenceError, etc objects 2020-04-10 13:09:35 +02:00
Runtime LibJS: Implement Error.prototype.name setter (#1776) 2020-04-13 11:19:53 +02:00
Tests LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
AST.cpp LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
AST.h LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
Forward.h LibJS: Use enumerator macros for boilerplate code around native types 2020-04-10 14:06:52 +02:00
Interpreter.cpp LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
Interpreter.h LibJS: Add console.trace() 2020-04-11 14:10:42 +02:00
Lexer.cpp LibJS: Parse "this" as ThisExpression 2020-04-13 00:45:25 +02:00
Lexer.h LibJS: Allow lexer to run without logging errors 2020-04-05 16:11:13 +02:00
Makefile LibJS: Add String constructor :^) 2020-04-10 14:14:02 +02:00
Parser.cpp LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
Parser.h LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
Token.cpp LibJS: Add numeric literal parsing for different bases and exponents 2020-04-05 16:01:22 +02:00
Token.h LibJS: Parse "this" as ThisExpression 2020-04-13 00:45:25 +02:00