mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
LibJS: Generate bytecode for throw statements
This commit is contained in:
parent
e9bafd768d
commit
b78f1c1261
Notes:
sideshowbarker
2024-07-18 12:32:58 +09:00
Author: https://github.com/gunnarbeutner
Commit: b78f1c1261
Pull-request: https://github.com/SerenityOS/serenity/pull/7952
Reviewed-by: https://github.com/alimpfard
5 changed files with 35 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -395,6 +396,19 @@ public:
|
|||
String to_string(Bytecode::Executable const&) const;
|
||||
};
|
||||
|
||||
class Throw final : public Instruction {
|
||||
public:
|
||||
constexpr static bool IsTerminator = true;
|
||||
|
||||
Throw()
|
||||
: Instruction(Type::Throw)
|
||||
{
|
||||
}
|
||||
|
||||
void execute(Bytecode::Interpreter&) const;
|
||||
String to_string(Bytecode::Executable const&) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace JS::Bytecode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue