1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

LibJS: Preserve information about local variables declaration kind

This is required for upcoming change where we want to emit ThrowIfTDZ
for assignment expressions only for lexical declarations.
This commit is contained in:
Aliaksandr Kalenik 2025-05-05 21:53:19 +03:00 committed by Andreas Kling
parent 2774068ca0
commit db480b1f0c
Notes: github-actions[bot] 2025-05-06 10:07:32 +00:00
11 changed files with 83 additions and 40 deletions

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
namespace JS {
struct LocalVariable {
FlyString name;
enum class DeclarationKind {
Var,
LetOrConst,
Function,
ArgumentsObject,
CatchClauseParameter
};
DeclarationKind declaration_kind;
};
}