mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibJS: Change Value::to_object(Heap& -> Interpreter&)
Passing a Heap& to it only to then call interpreter() on that is weird. Let's just give it the Interpreter& directly, like some of the other to_something() functions.
This commit is contained in:
parent
b8b7f84547
commit
1a1394f7a2
Notes:
sideshowbarker
2024-07-19 06:32:25 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/1a1394f7a2f Pull-request: https://github.com/SerenityOS/serenity/pull/2270 Issue: https://github.com/SerenityOS/serenity/issues/2267
26 changed files with 56 additions and 57 deletions
|
@ -96,7 +96,7 @@ CallExpression::ThisAndCallee CallExpression::compute_this_and_callee(Interprete
|
|||
auto object_value = member_expression.object().execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto* this_value = object_value.to_object(interpreter.heap());
|
||||
auto* this_value = object_value.to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto callee = this_value->get(member_expression.computed_property_name(interpreter)).value_or(js_undefined());
|
||||
|
@ -431,7 +431,7 @@ Reference MemberExpression::to_reference(Interpreter& interpreter) const
|
|||
auto object_value = m_object->execute(interpreter);
|
||||
if (object_value.is_empty())
|
||||
return {};
|
||||
auto* object = object_value.to_object(interpreter.heap());
|
||||
auto* object = object_value.to_object(interpreter);
|
||||
if (!object)
|
||||
return {};
|
||||
auto property_name = computed_property_name(interpreter);
|
||||
|
@ -452,7 +452,7 @@ Value UnaryExpression::execute(Interpreter& interpreter) const
|
|||
ASSERT(!reference.is_local_variable());
|
||||
if (reference.is_global_variable())
|
||||
return interpreter.global_object().delete_property(reference.name());
|
||||
auto* base_object = reference.base().to_object(interpreter.heap());
|
||||
auto* base_object = reference.base().to_object(interpreter);
|
||||
if (!base_object)
|
||||
return {};
|
||||
return base_object->delete_property(reference.name());
|
||||
|
@ -1213,7 +1213,7 @@ Value MemberExpression::execute(Interpreter& interpreter) const
|
|||
auto object_value = m_object->execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto* object_result = object_value.to_object(interpreter.heap());
|
||||
auto* object_result = object_value.to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
return object_result->get(computed_property_name(interpreter)).value_or(js_undefined());
|
||||
|
|
|
@ -51,7 +51,7 @@ Array::~Array()
|
|||
|
||||
Array* array_from(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_array()) {
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace JS {
|
|||
|
||||
static Date* this_date_from_interpreter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
if (!this_object->is_date()) {
|
||||
|
|
|
@ -50,7 +50,7 @@ ErrorPrototype::~ErrorPrototype()
|
|||
|
||||
Value ErrorPrototype::name_getter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_error())
|
||||
|
@ -60,7 +60,7 @@ Value ErrorPrototype::name_getter(Interpreter& interpreter)
|
|||
|
||||
void ErrorPrototype::name_setter(Interpreter& interpreter, Value value)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return;
|
||||
if (!this_object->is_error()) {
|
||||
|
@ -75,7 +75,7 @@ void ErrorPrototype::name_setter(Interpreter& interpreter, Value value)
|
|||
|
||||
Value ErrorPrototype::message_getter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_error())
|
||||
|
|
|
@ -60,7 +60,7 @@ BoundFunction* Function::bind(Value bound_this_value, Vector<Value> arguments)
|
|||
// FIXME: Null or undefined should be passed through in strict mode.
|
||||
return &interpreter().global_object();
|
||||
default:
|
||||
return bound_this_value.to_object(interpreter().heap());
|
||||
return bound_this_value.to_object(interpreter());
|
||||
}
|
||||
}();
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ FunctionPrototype::~FunctionPrototype()
|
|||
|
||||
Value FunctionPrototype::apply(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function())
|
||||
|
@ -86,7 +86,7 @@ Value FunctionPrototype::apply(Interpreter& interpreter)
|
|||
|
||||
Value FunctionPrototype::bind(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function())
|
||||
|
@ -106,7 +106,7 @@ Value FunctionPrototype::bind(Interpreter& interpreter)
|
|||
|
||||
Value FunctionPrototype::call(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function())
|
||||
|
@ -123,7 +123,7 @@ Value FunctionPrototype::call(Interpreter& interpreter)
|
|||
|
||||
Value FunctionPrototype::to_string(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function())
|
||||
|
|
|
@ -71,7 +71,7 @@ Value ObjectConstructor::get_own_property_names(Interpreter& interpreter)
|
|||
{
|
||||
if (!interpreter.argument_count())
|
||||
return {};
|
||||
auto* object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* object = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto* result = Array::create(interpreter.global_object());
|
||||
|
@ -90,7 +90,7 @@ Value ObjectConstructor::get_prototype_of(Interpreter& interpreter)
|
|||
{
|
||||
if (!interpreter.argument_count())
|
||||
return {};
|
||||
auto* object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* object = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
return object->prototype();
|
||||
|
@ -100,7 +100,7 @@ Value ObjectConstructor::set_prototype_of(Interpreter& interpreter)
|
|||
{
|
||||
if (interpreter.argument_count() < 2)
|
||||
return {};
|
||||
auto* object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* object = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
object->set_prototype(&const_cast<Object&>(interpreter.argument(1).as_object()));
|
||||
|
@ -109,7 +109,7 @@ Value ObjectConstructor::set_prototype_of(Interpreter& interpreter)
|
|||
|
||||
Value ObjectConstructor::get_own_property_descriptor(Interpreter& interpreter)
|
||||
{
|
||||
auto* object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* object = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto property_key = interpreter.argument(1).to_string(interpreter);
|
||||
|
@ -143,7 +143,7 @@ Value ObjectConstructor::keys(Interpreter& interpreter)
|
|||
if (!interpreter.argument_count())
|
||||
return interpreter.throw_exception<TypeError>("Can't convert undefined to object");
|
||||
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
||||
|
@ -155,7 +155,7 @@ Value ObjectConstructor::values(Interpreter& interpreter)
|
|||
if (!interpreter.argument_count())
|
||||
return interpreter.throw_exception<TypeError>("Can't convert undefined to object");
|
||||
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
||||
|
@ -167,7 +167,7 @@ Value ObjectConstructor::entries(Interpreter& interpreter)
|
|||
if (!interpreter.argument_count())
|
||||
return interpreter.throw_exception<TypeError>("Can't convert undefined to object");
|
||||
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* obj_arg = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ ObjectPrototype::~ObjectPrototype()
|
|||
|
||||
Value ObjectPrototype::has_own_property(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
auto name = interpreter.argument(0).to_string(interpreter);
|
||||
|
@ -65,7 +65,7 @@ Value ObjectPrototype::has_own_property(Interpreter& interpreter)
|
|||
|
||||
Value ObjectPrototype::to_string(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
return js_string(interpreter, String::format("[object %s]", this_object->class_name()));
|
||||
|
@ -73,7 +73,7 @@ Value ObjectPrototype::to_string(Interpreter& interpreter)
|
|||
|
||||
Value ObjectPrototype::value_of(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
return this_object->value_of();
|
||||
|
|
|
@ -50,7 +50,7 @@ void Reference::put(Interpreter& interpreter, Value value)
|
|||
return;
|
||||
}
|
||||
|
||||
auto* object = base().to_object(interpreter.heap());
|
||||
auto* object = base().to_object(interpreter);
|
||||
if (!object)
|
||||
return;
|
||||
|
||||
|
@ -92,7 +92,7 @@ Value Reference::get(Interpreter& interpreter)
|
|||
return value;
|
||||
}
|
||||
|
||||
auto* object = base().to_object(interpreter.heap());
|
||||
auto* object = base().to_object(interpreter);
|
||||
if (!object)
|
||||
return {};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace JS {
|
|||
|
||||
static ScriptFunction* script_function_from(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
if (!this_object->is_function()) {
|
||||
|
|
|
@ -71,7 +71,7 @@ Value StringConstructor::construct(Interpreter& interpreter)
|
|||
|
||||
Value StringConstructor::raw(Interpreter& interpreter)
|
||||
{
|
||||
auto* template_object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* template_object = interpreter.argument(0).to_object(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
||||
|
@ -83,7 +83,7 @@ Value StringConstructor::raw(Interpreter& interpreter)
|
|||
if (!raw.is_array())
|
||||
return js_string(interpreter, "");
|
||||
|
||||
auto& raw_array_elements = static_cast<Array*>(raw.to_object(interpreter.heap()))->elements();
|
||||
auto& raw_array_elements = static_cast<Array*>(raw.to_object(interpreter))->elements();
|
||||
StringBuilder builder;
|
||||
|
||||
for (size_t i = 0; i < raw_array_elements.size(); ++i) {
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace JS {
|
|||
|
||||
static StringObject* string_object_from(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
if (!this_object->is_string_object()) {
|
||||
|
@ -53,7 +53,7 @@ static StringObject* string_object_from(Interpreter& interpreter)
|
|||
|
||||
static String string_from(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
return Value(this_object).to_string(interpreter);
|
||||
|
|
|
@ -54,7 +54,7 @@ SymbolPrototype::~SymbolPrototype()
|
|||
|
||||
static SymbolObject* this_symbol_from_interpreter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
if (!this_object->is_symbol_object()) {
|
||||
|
|
|
@ -57,7 +57,7 @@ Uint8ClampedArray::~Uint8ClampedArray()
|
|||
|
||||
Value Uint8ClampedArray::length_getter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (StringView(this_object->class_name()) != "Uint8ClampedArray")
|
||||
|
|
|
@ -176,25 +176,25 @@ Value Value::to_primitive(Interpreter&) const
|
|||
return *this;
|
||||
}
|
||||
|
||||
Object* Value::to_object(Heap& heap) const
|
||||
Object* Value::to_object(Interpreter& interpreter) const
|
||||
{
|
||||
if (is_object())
|
||||
return &const_cast<Object&>(as_object());
|
||||
|
||||
if (is_string())
|
||||
return StringObject::create(heap.interpreter().global_object(), *m_value.as_string);
|
||||
return StringObject::create(interpreter.global_object(), *m_value.as_string);
|
||||
|
||||
if (is_symbol())
|
||||
return SymbolObject::create(heap.interpreter().global_object(), *m_value.as_symbol);
|
||||
return SymbolObject::create(interpreter.global_object(), *m_value.as_symbol);
|
||||
|
||||
if (is_number())
|
||||
return NumberObject::create(heap.interpreter().global_object(), m_value.as_double);
|
||||
return NumberObject::create(interpreter.global_object(), m_value.as_double);
|
||||
|
||||
if (is_boolean())
|
||||
return BooleanObject::create(heap.interpreter().global_object(), m_value.as_bool);
|
||||
return BooleanObject::create(interpreter.global_object(), m_value.as_bool);
|
||||
|
||||
if (is_null() || is_undefined()) {
|
||||
heap.interpreter().throw_exception<TypeError>("ToObject on null or undefined.");
|
||||
interpreter.throw_exception<TypeError>("ToObject on null or undefined.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,14 +186,13 @@ public:
|
|||
|
||||
String to_string(Interpreter&) const;
|
||||
PrimitiveString* to_primitive_string(Interpreter&);
|
||||
Value to_primitive(Interpreter&) const;
|
||||
Object* to_object(Interpreter&) const;
|
||||
bool to_boolean() const;
|
||||
Value to_number() const;
|
||||
i32 to_i32() const;
|
||||
double to_double() const;
|
||||
size_t to_size_t() const;
|
||||
Value to_primitive(Interpreter&) const;
|
||||
|
||||
Object* to_object(Heap&) const;
|
||||
|
||||
Value value_or(Value fallback) const
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ CanvasRenderingContext2DWrapper::~CanvasRenderingContext2DWrapper()
|
|||
|
||||
static CanvasRenderingContext2D* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
// FIXME: Verify that it's a CanvasRenderingContext2DWrapper somehow!
|
||||
|
@ -116,7 +116,7 @@ JS::Value CanvasRenderingContext2DWrapper::draw_image(JS::Interpreter& interpret
|
|||
if (arguments.size() < 3)
|
||||
return interpreter.throw_exception<JS::TypeError>("drawImage() needs more arguments");
|
||||
|
||||
auto* image_argument = arguments[0].to_object(interpreter.heap());
|
||||
auto* image_argument = arguments[0].to_object(interpreter);
|
||||
if (!image_argument)
|
||||
return {};
|
||||
if (StringView(image_argument->class_name()) != "HTMLImageElementWrapper")
|
||||
|
@ -307,7 +307,7 @@ JS::Value CanvasRenderingContext2DWrapper::put_image_data(JS::Interpreter& inter
|
|||
if (!impl)
|
||||
return {};
|
||||
|
||||
auto* image_data_object = interpreter.argument(0).to_object(interpreter.heap());
|
||||
auto* image_data_object = interpreter.argument(0).to_object(interpreter);
|
||||
if (!image_data_object)
|
||||
return {};
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ const Document& DocumentWrapper::node() const
|
|||
|
||||
static Document* document_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (StringView("DocumentWrapper") != this_object->class_name()) {
|
||||
|
|
|
@ -58,7 +58,7 @@ const Element& ElementWrapper::node() const
|
|||
|
||||
static Element* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
// FIXME: Verify that it's an ElementWrapper somehow!
|
||||
|
|
|
@ -50,7 +50,7 @@ EventTargetWrapper::~EventTargetWrapper()
|
|||
|
||||
JS::Value EventTargetWrapper::add_event_listener(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
auto& arguments = interpreter.call_frame().arguments;
|
||||
|
|
|
@ -62,7 +62,7 @@ const HTMLCanvasElement& HTMLCanvasElementWrapper::node() const
|
|||
|
||||
static HTMLCanvasElement* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
// FIXME: Verify that it's a HTMLCanvasElementWrapper somehow!
|
||||
|
|
|
@ -55,7 +55,7 @@ ImageDataWrapper::~ImageDataWrapper()
|
|||
|
||||
static ImageData* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object) {
|
||||
ASSERT_NOT_REACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -57,7 +57,7 @@ MouseEvent& MouseEventWrapper::event()
|
|||
|
||||
static MouseEvent* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
// FIXME: Verify that it's a CanvasRenderingContext2DWrapper somehow!
|
||||
|
|
|
@ -80,7 +80,7 @@ void WindowObject::visit_children(Visitor& visitor)
|
|||
|
||||
static Window* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object) {
|
||||
ASSERT_NOT_REACHED();
|
||||
return nullptr;
|
||||
|
@ -129,7 +129,7 @@ JS::Value WindowObject::set_interval(JS::Interpreter& interpreter)
|
|||
auto& arguments = interpreter.call_frame().arguments;
|
||||
if (arguments.size() < 2)
|
||||
return {};
|
||||
auto* callback_object = arguments[0].to_object(interpreter.heap());
|
||||
auto* callback_object = arguments[0].to_object(interpreter);
|
||||
if (!callback_object)
|
||||
return {};
|
||||
if (!callback_object->is_function())
|
||||
|
@ -146,7 +146,7 @@ JS::Value WindowObject::set_timeout(JS::Interpreter& interpreter)
|
|||
auto& arguments = interpreter.call_frame().arguments;
|
||||
if (arguments.size() < 1)
|
||||
return {};
|
||||
auto* callback_object = arguments[0].to_object(interpreter.heap());
|
||||
auto* callback_object = arguments[0].to_object(interpreter);
|
||||
if (!callback_object)
|
||||
return {};
|
||||
if (!callback_object->is_function())
|
||||
|
@ -168,7 +168,7 @@ JS::Value WindowObject::request_animation_frame(JS::Interpreter& interpreter)
|
|||
auto& arguments = interpreter.call_frame().arguments;
|
||||
if (arguments.size() < 1)
|
||||
return {};
|
||||
auto* callback_object = arguments[0].to_object(interpreter.heap());
|
||||
auto* callback_object = arguments[0].to_object(interpreter);
|
||||
if (!callback_object)
|
||||
return {};
|
||||
if (!callback_object->is_function())
|
||||
|
|
|
@ -56,7 +56,7 @@ XMLHttpRequestPrototype::~XMLHttpRequestPrototype()
|
|||
|
||||
static XMLHttpRequest* impl_from(JS::Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
if (!this_object)
|
||||
return nullptr;
|
||||
if (StringView("XMLHttpRequestWrapper") != this_object->class_name()) {
|
||||
|
|
|
@ -701,7 +701,7 @@ int main(int argc, char** argv)
|
|||
if (!variable.is_object())
|
||||
return {};
|
||||
|
||||
const auto* object = variable.to_object(interpreter->heap());
|
||||
const auto* object = variable.to_object(*interpreter);
|
||||
const auto& shape = object->shape();
|
||||
list_all_properties(shape, property_pattern);
|
||||
if (results.size())
|
||||
|
|
Loading…
Add table
Reference in a new issue