1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibJS: Implement the SetFunctionName AO

This commit is contained in:
Linus Groh 2022-01-24 19:09:40 +00:00
parent 6fa600fce3
commit 5b04c49762
2 changed files with 62 additions and 2 deletions

View file

@ -1,13 +1,17 @@
/*
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <AK/Optional.h>
#include <AK/StringView.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/PrivateEnvironment.h>
#include <LibJS/Runtime/PropertyKey.h>
namespace JS {
@ -25,6 +29,7 @@ public:
virtual const FlyString& name() const = 0;
void set_function_name(Variant<PropertyKey, PrivateName> const& name_arg, Optional<StringView> const& prefix = {});
ThrowCompletionOr<BoundFunction*> bind(Value bound_this_value, Vector<Value> arguments);
virtual bool is_strict_mode() const { return false; }