mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibJS: Implement import.meta for bytecode
This commit is contained in:
parent
a1692931af
commit
d29bd55b48
Notes:
sideshowbarker
2024-07-17 09:48:50 +09:00
Author: https://github.com/gabydd
Commit: d29bd55b48
Pull-request: https://github.com/SerenityOS/serenity/pull/19959
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/alimpfard
8 changed files with 78 additions and 49 deletions
|
@ -26,6 +26,7 @@
|
|||
#include <LibJS/Runtime/Reference.h>
|
||||
#include <LibJS/Runtime/RegExpObject.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
#include <LibJS/SourceTextModule.h>
|
||||
|
||||
namespace JS::Bytecode {
|
||||
|
||||
|
@ -762,6 +763,12 @@ ThrowCompletionOr<void> GetNewTarget::execute_impl(Bytecode::Interpreter& interp
|
|||
return {};
|
||||
}
|
||||
|
||||
ThrowCompletionOr<void> GetImportMeta::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
interpreter.accumulator() = interpreter.vm().get_import_meta();
|
||||
return {};
|
||||
}
|
||||
|
||||
void Jump::replace_references_impl(BasicBlock const& from, BasicBlock const& to)
|
||||
{
|
||||
if (m_true_target.has_value() && &m_true_target->block() == &from)
|
||||
|
@ -1896,6 +1903,11 @@ DeprecatedString GetNewTarget::to_deprecated_string_impl(Bytecode::Executable co
|
|||
return "GetNewTarget"sv;
|
||||
}
|
||||
|
||||
DeprecatedString GetImportMeta::to_deprecated_string_impl(Bytecode::Executable const&) const
|
||||
{
|
||||
return "GetImportMeta"sv;
|
||||
}
|
||||
|
||||
DeprecatedString TypeofVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const
|
||||
{
|
||||
return DeprecatedString::formatted("TypeofVariable {} ({})", m_identifier, executable.identifier_table->get(m_identifier));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue