mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
JSSpecCompiler: Adopt more C++ terminology
Let's not use strange names like `ExecutionContext`, which nobody will understand in the future.
This commit is contained in:
parent
4578004ad6
commit
567b1f6e7c
Notes:
sideshowbarker
2024-07-16 23:13:25 +09:00
Author: https://github.com/DanShaders
Commit: 567b1f6e7c
Pull-request: https://github.com/SerenityOS/serenity/pull/21263
Reviewed-by: https://github.com/gmta ✅
9 changed files with 51 additions and 21 deletions
|
@ -9,9 +9,23 @@
|
|||
|
||||
namespace JSSpecCompiler {
|
||||
|
||||
Function::Function(ExecutionContext* context, StringView name, Tree ast)
|
||||
: m_context(context)
|
||||
, m_name(name)
|
||||
FunctionDefinitionRef TranslationUnit::adopt_function(NonnullRefPtr<FunctionDefinition>&& function)
|
||||
{
|
||||
function->m_translation_unit = this;
|
||||
function_index.set(function->m_name, make_ref_counted<FunctionPointer>(function));
|
||||
|
||||
FunctionDefinitionRef result = function.ptr();
|
||||
function_definitions.append(move(function));
|
||||
return result;
|
||||
}
|
||||
|
||||
FunctionDeclaration::FunctionDeclaration(StringView name)
|
||||
: m_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionDefinition::FunctionDefinition(StringView name, Tree ast)
|
||||
: FunctionDeclaration(name)
|
||||
, m_ast(move(ast))
|
||||
, m_return_value(make_ref_counted<VariableDeclaration>("$return"sv))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue