mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-29 02:57:17 +02:00
LibJS: Convert ordinary_create_from_constructor() to NonnullGCPtr
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 03:09:26 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/1c24b82dd7 Pull-request: https://github.com/SerenityOS/serenity/pull/16498 Reviewed-by: https://github.com/trflynn89 ✅
@@ -203,7 +203,7 @@ ThrowCompletionOr<Object*> ECMAScriptFunctionObject::internal_construct(MarkedVe
|
||||
// 2. Let kind be F.[[ConstructorKind]].
|
||||
auto kind = m_constructor_kind;
|
||||
|
||||
Object* this_argument = nullptr;
|
||||
GCPtr<Object> this_argument;
|
||||
|
||||
// 3. If kind is base, then
|
||||
if (kind == ConstructorKind::Base) {
|
||||
@@ -269,7 +269,7 @@ ThrowCompletionOr<Object*> ECMAScriptFunctionObject::internal_construct(MarkedVe
|
||||
|
||||
// b. If kind is base, return thisArgument.
|
||||
if (kind == ConstructorKind::Base)
|
||||
return this_argument;
|
||||
return this_argument.ptr();
|
||||
|
||||
// c. If result.[[Value]] is not undefined, throw a TypeError exception.
|
||||
if (!result.value()->is_undefined())
|
||||
|
||||
Reference in New Issue
Block a user