mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 18:38:12 +00:00
LibJS: Parse labels in continue and break statements
This commit is contained in:
parent
10bf4ba3dc
commit
03615a7872
2 changed files with 32 additions and 6 deletions
|
@ -1048,22 +1048,36 @@ private:
|
|||
|
||||
class BreakStatement final : public Statement {
|
||||
public:
|
||||
BreakStatement() { }
|
||||
BreakStatement(FlyString target_label)
|
||||
: m_target_label(target_label)
|
||||
{
|
||||
}
|
||||
|
||||
virtual Value execute(Interpreter&) const override;
|
||||
|
||||
const FlyString& target_label() const { return m_target_label; }
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "BreakStatement"; }
|
||||
|
||||
FlyString m_target_label;
|
||||
};
|
||||
|
||||
class ContinueStatement final : public Statement {
|
||||
public:
|
||||
ContinueStatement() { }
|
||||
ContinueStatement(FlyString target_label)
|
||||
: m_target_label(target_label)
|
||||
{
|
||||
}
|
||||
|
||||
virtual Value execute(Interpreter&) const override;
|
||||
|
||||
const FlyString& target_label() const { return m_target_label; }
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "ContinueStatement"; }
|
||||
|
||||
FlyString m_target_label;
|
||||
};
|
||||
|
||||
class DebuggerStatement final : public Statement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue