diff options
author | Linus Groh <mail@linusgroh.de> | 2023-04-15 16:06:18 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-15 16:06:18 +0200 |
commit | dd91f1a5a555cd8ebe8926f3215a722ae94d6714 (patch) | |
tree | fed2de781ced2a479e1a03e6f6b50758be48330f /Userland | |
parent | 9c6eba771ad4bf4bd6e26d0002a81ce4baba9a0c (diff) | |
download | serenity-dd91f1a5a555cd8ebe8926f3215a722ae94d6714.zip |
LibJS: Port this_string_value() to NonnullGCPtr
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/StringPrototype.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 630bf0afcf..91f8ec719d 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -228,18 +228,18 @@ ThrowCompletionOr<void> StringPrototype::initialize(Realm& realm) } // thisStringValue ( value ), https://tc39.es/ecma262/#thisstringvalue -static ThrowCompletionOr<PrimitiveString*> this_string_value(VM& vm, Value value) +static ThrowCompletionOr<NonnullGCPtr<PrimitiveString>> this_string_value(VM& vm, Value value) { // 1. If value is a String, return value. if (value.is_string()) - return &value.as_string(); + return value.as_string(); // 2. If value is an Object and value has a [[StringData]] internal slot, then if (value.is_object() && is<StringObject>(value.as_object())) { // a. Let s be value.[[StringData]]. // b. Assert: s is a String. // c. Return s. - return &static_cast<StringObject&>(value.as_object()).primitive_string(); + return static_cast<StringObject&>(value.as_object()).primitive_string(); } // 3. Throw a TypeError exception. |