mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
parent
c969b8390d
commit
8e364b9780
Notes:
sideshowbarker
2024-07-19 04:44:44 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/8e364b9780e Pull-request: https://github.com/SerenityOS/serenity/pull/2828 Issue: https://github.com/SerenityOS/serenity/issues/2825
2 changed files with 6 additions and 3 deletions
|
@ -1287,9 +1287,11 @@ RefPtr<Value> Sequence::run(RefPtr<Shell> shell)
|
|||
// If we are to return a job, block on the left one then return the right one.
|
||||
if (would_execute()) {
|
||||
RefPtr<AST::Node> execute_node = create<AST::Execute>(m_left->position(), m_left);
|
||||
auto left_job = execute_node->run(shell);
|
||||
ASSERT(left_job->is_job());
|
||||
shell->block_on_job(static_cast<JobValue*>(left_job.ptr())->job());
|
||||
auto left_value = execute_node->run(shell);
|
||||
// Some nodes are inherently empty, such as Comments and For loops without bodies,
|
||||
// it is not an error for the value not to be a job.
|
||||
if (left_value && left_value->is_job())
|
||||
shell->block_on_job(static_cast<JobValue*>(left_value.ptr())->job());
|
||||
|
||||
if (m_right->would_execute())
|
||||
return m_right->run(shell);
|
||||
|
|
|
@ -589,6 +589,7 @@ private:
|
|||
virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
|
||||
virtual HitTestResult hit_test_position(size_t) override;
|
||||
virtual String class_name() const override { return "ForLoop"; }
|
||||
virtual bool would_execute() const override { return true; }
|
||||
|
||||
String m_variable_name;
|
||||
RefPtr<AST::Node> m_iterated_expression;
|
||||
|
|
Loading…
Reference in a new issue