summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-15 20:04:26 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-16 09:59:56 +0100
commitc132064ee9976d007bffb592ea8be19dd8584fb0 (patch)
treeb8cb02abd151deda848886ba5516c16cb8e83cc1 /Userland/Libraries/LibJS
parent208be8b86d264c3487f92c8581ca80a183076ac5 (diff)
downloadserenity-c132064ee9976d007bffb592ea8be19dd8584fb0.zip
LibJS: Convert new_private_environment() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/AST.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/AbstractOperations.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp
index 099b21d9c7..17ed5936e5 100644
--- a/Userland/Libraries/LibJS/AST.cpp
+++ b/Userland/Libraries/LibJS/AST.cpp
@@ -1852,7 +1852,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::class_definition_e
MUST(class_environment->create_immutable_binding(vm, binding_name, true));
auto* outer_private_environment = vm.running_execution_context().private_environment;
- auto* class_private_environment = new_private_environment(vm, outer_private_environment);
+ auto class_private_environment = new_private_environment(vm, outer_private_environment);
for (auto const& element : m_elements) {
auto opt_private_name = element.private_bound_identifier();
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
index e84438ac50..f24e6cc3f6 100644
--- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
@@ -435,7 +435,7 @@ NonnullGCPtr<FunctionEnvironment> new_function_environment(ECMAScriptFunctionObj
}
// 9.2.1.1 NewPrivateEnvironment ( outerPrivEnv ), https://tc39.es/ecma262/#sec-newprivateenvironment
-PrivateEnvironment* new_private_environment(VM& vm, PrivateEnvironment* outer)
+NonnullGCPtr<PrivateEnvironment> new_private_environment(VM& vm, PrivateEnvironment* outer)
{
// 1. Let names be a new empty List.
// 2. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: outerPrivEnv, [[Names]]: names }.
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h
index 35daaf4a6c..5d30057397 100644
--- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h
+++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h
@@ -22,7 +22,7 @@ namespace JS {
NonnullGCPtr<DeclarativeEnvironment> new_declarative_environment(Environment&);
NonnullGCPtr<ObjectEnvironment> new_object_environment(Object&, bool is_with_environment, Environment*);
NonnullGCPtr<FunctionEnvironment> new_function_environment(ECMAScriptFunctionObject&, Object* new_target);
-PrivateEnvironment* new_private_environment(VM& vm, PrivateEnvironment* outer);
+NonnullGCPtr<PrivateEnvironment> new_private_environment(VM& vm, PrivateEnvironment* outer);
Environment& get_this_environment(VM&);
bool can_be_held_weakly(Value);
Object* get_super_constructor(VM&);