mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
We don't need to return two values; running an executable only ever produces a throw completion, or a normal completion, i.e a Value. This necessitated a few minor changes, such as adding a way to check if a JS::Cell is a GeneratorResult.
26 lines
493 B
C++
26 lines
493 B
C++
/*
|
|
* Copyright (c) 2020-2024, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGC/Cell.h>
|
|
#include <LibJS/Export.h>
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace JS {
|
|
|
|
class JS_API Cell : public GC::Cell {
|
|
GC_CELL(Cell, GC::Cell);
|
|
|
|
public:
|
|
virtual void initialize(Realm&);
|
|
|
|
virtual bool is_generator_result() const { return false; }
|
|
|
|
ALWAYS_INLINE VM& vm() const { return *reinterpret_cast<VM*>(private_data()); }
|
|
};
|
|
|
|
}
|