mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 19:34:59 +00:00

It replaces UnresolvedReference with Variable, FunctionPointer, or SlotName nodes. Also, it gathers all variable names from their declarations.
20 lines
404 B
C++
20 lines
404 B
C++
/*
|
|
* Copyright (c) 2023, Dan Klishch <danilklishch@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "Function.h"
|
|
#include "AST/AST.h"
|
|
|
|
namespace JSSpecCompiler {
|
|
|
|
Function::Function(ExecutionContext* context, StringView name, Tree ast)
|
|
: m_context(context)
|
|
, m_name(name)
|
|
, m_ast(move(ast))
|
|
, m_return_value(make_ref_counted<VariableDeclaration>("$return"sv))
|
|
{
|
|
}
|
|
|
|
}
|