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:
parent
2774068ca0
commit
db480b1f0c
Notes:
github-actions[bot]
2025-05-06 10:07:32 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: db480b1f0c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4616
Reviewed-by: https://github.com/awesomekling
11 changed files with 83 additions and 40 deletions
25
Libraries/LibJS/LocalVariable.h
Normal file
25
Libraries/LibJS/LocalVariable.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue