diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp index c6d42fa818..ef6f085737 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp @@ -40,7 +40,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferPrototype::slice) // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). - auto* array_buffer_object = TRY(typed_this_value(vm)); + auto array_buffer_object = TRY(typed_this_value(vm)); // 3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception. // FIXME: Check for shared buffer @@ -84,7 +84,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferPrototype::slice) auto new_length = max(final - first, 0.0); // 15. Let ctor be ? SpeciesConstructor(O, %ArrayBuffer%). - auto* constructor = TRY(species_constructor(vm, *array_buffer_object, realm.intrinsics().array_buffer_constructor())); + auto* constructor = TRY(species_constructor(vm, array_buffer_object, realm.intrinsics().array_buffer_constructor())); // 16. Let new be ? Construct(ctor, « 𝔽(newLen) »). auto new_array_buffer = TRY(construct(vm, *constructor, Value(new_length))); @@ -129,7 +129,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferPrototype::byte_length_getter) { // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). - auto* array_buffer_object = TRY(typed_this_value(vm)); + auto array_buffer_object = TRY(typed_this_value(vm)); // 3. If IsSharedArrayBuffer(O) is true, throw a TypeError exception. // FIXME: Check for shared buffer diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp index bcdcef447c..89498d7560 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp @@ -38,7 +38,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayIteratorPrototype::next) { auto& realm = *vm.current_realm(); - auto* iterator = TRY(typed_this_value(vm)); + auto iterator = TRY(typed_this_value(vm)); auto target_array = iterator->array(); if (target_array.is_undefined()) return create_iterator_result_object(vm, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp index bd695f72df..b92c604664 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp @@ -58,7 +58,7 @@ static ThrowCompletionOr get_view_value(VM& vm, Value request_index, Valu { // 1. Perform ? RequireInternalSlot(view, [[DataView]]). // 2. Assert: view has a [[ViewedArrayBuffer]] internal slot. - auto* view = TRY(DataViewPrototype::typed_this_value(vm)); + auto view = TRY(DataViewPrototype::typed_this_value(vm)); // 3. Let getIndex be ? ToIndex(requestIndex). auto get_index = TRY(request_index.to_index(vm)); @@ -103,7 +103,7 @@ static ThrowCompletionOr set_view_value(VM& vm, Value request_index, Valu { // 1. Perform ? RequireInternalSlot(view, [[DataView]]). // 2. Assert: view has a [[ViewedArrayBuffer]] internal slot. - auto* view = TRY(DataViewPrototype::typed_this_value(vm)); + auto view = TRY(DataViewPrototype::typed_this_value(vm)); // 3. Let getIndex be ? ToIndex(requestIndex). auto get_index = TRY(request_index.to_index(vm)); @@ -160,7 +160,7 @@ JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::buffer_getter) // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[DataView]]). // 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. - auto* data_view = TRY(typed_this_value(vm)); + auto data_view = TRY(typed_this_value(vm)); // 4. Let buffer be O.[[ViewedArrayBuffer]]. // 5. Return buffer. @@ -173,7 +173,7 @@ JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::byte_length_getter) // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[DataView]]). // 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. - auto* data_view = TRY(typed_this_value(vm)); + auto data_view = TRY(typed_this_value(vm)); // 4. Let buffer be O.[[ViewedArrayBuffer]]. // 5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. @@ -191,7 +191,7 @@ JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::byte_offset_getter) // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[DataView]]). // 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. - auto* data_view = TRY(typed_this_value(vm)); + auto data_view = TRY(typed_this_value(vm)); // 4. Let buffer be O.[[ViewedArrayBuffer]]. // 5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index 5a7b1bae1a..f6ec485482 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -34,7 +34,7 @@ JS_DEFINE_NATIVE_FUNCTION(MapIteratorPrototype::next) { auto& realm = *vm.current_realm(); - auto* map_iterator = TRY(typed_this_value(vm)); + auto map_iterator = TRY(typed_this_value(vm)); if (map_iterator->done()) return create_iterator_result_object(vm, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/PrototypeObject.h b/Userland/Libraries/LibJS/Runtime/PrototypeObject.h index e41832d030..0d78729273 100644 --- a/Userland/Libraries/LibJS/Runtime/PrototypeObject.h +++ b/Userland/Libraries/LibJS/Runtime/PrototypeObject.h @@ -47,12 +47,12 @@ public: } // Use typed_this_value() when the spec does not coerce |this| value to an object. - static ThrowCompletionOr typed_this_value(VM& vm) + static ThrowCompletionOr> typed_this_value(VM& vm) { auto this_value = vm.this_value(); if (!this_value.is_object() || !is(this_value.as_object())) return vm.throw_completion(ErrorType::NotAnObjectOfType, PrototypeType::display_name()); - return static_cast(&this_value.as_object()); + return static_cast(this_value.as_object()); } protected: diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp index 2585fbd7f8..a6b33ab4ba 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp @@ -35,7 +35,7 @@ ThrowCompletionOr RegExpStringIteratorPrototype::initialize(Realm& realm) JS_DEFINE_NATIVE_FUNCTION(RegExpStringIteratorPrototype::next) { // For details, see the 'closure' of: https://tc39.es/ecma262/#sec-createregexpstringiterator - auto* iterator = TRY(typed_this_value(vm)); + auto iterator = TRY(typed_this_value(vm)); if (iterator->done()) return create_iterator_result_object(vm, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp index 85f230bd70..e40cfc74e9 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp @@ -36,7 +36,7 @@ JS_DEFINE_NATIVE_FUNCTION(SetIteratorPrototype::next) { auto& realm = *vm.current_realm(); - auto* set_iterator = TRY(typed_this_value(vm)); + auto set_iterator = TRY(typed_this_value(vm)); if (set_iterator->done()) return create_iterator_result_object(vm, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index d0c1d2ff90..28a7691e63 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -33,7 +33,7 @@ ThrowCompletionOr StringIteratorPrototype::initialize(Realm& realm) // 22.1.5.1.1 %StringIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next JS_DEFINE_NATIVE_FUNCTION(StringIteratorPrototype::next) { - auto* iterator = TRY(typed_this_value(vm)); + auto iterator = TRY(typed_this_value(vm)); if (iterator->done()) return create_iterator_result_object(vm, js_undefined(), true);