No bug - tagging b4d3227540c9ebc43d64aac6168fdca7019c22d8 with FIREFOX_BETA_126_BASE...
[gecko.git] / js / src / builtin / WeakSetObject.h
blobe374ff688bcf17446e4ff1697d7de55082b786a5
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef builtin_WeakSetObject_h
8 #define builtin_WeakSetObject_h
10 #include "builtin/WeakMapObject.h"
12 namespace js {
14 class WeakSetObject : public WeakCollectionObject {
15 public:
16 static const JSClass class_;
17 static const JSClass protoClass_;
19 private:
20 static const ClassSpec classSpec_;
22 static const JSPropertySpec properties[];
23 static const JSFunctionSpec methods[];
25 static WeakSetObject* create(JSContext* cx, HandleObject proto = nullptr);
26 [[nodiscard]] static bool construct(JSContext* cx, unsigned argc, Value* vp);
28 [[nodiscard]] static MOZ_ALWAYS_INLINE bool is(HandleValue v);
30 [[nodiscard]] static MOZ_ALWAYS_INLINE bool add_impl(JSContext* cx,
31 const CallArgs& args);
32 [[nodiscard]] static bool add(JSContext* cx, unsigned argc, Value* vp);
33 [[nodiscard]] static MOZ_ALWAYS_INLINE bool delete_impl(JSContext* cx,
34 const CallArgs& args);
35 [[nodiscard]] static bool delete_(JSContext* cx, unsigned argc, Value* vp);
36 [[nodiscard]] static MOZ_ALWAYS_INLINE bool has_impl(JSContext* cx,
37 const CallArgs& args);
38 [[nodiscard]] static bool has(JSContext* cx, unsigned argc, Value* vp);
40 static bool isBuiltinAdd(HandleValue add);
43 } // namespace js
45 template <>
46 inline bool JSObject::is<js::WeakCollectionObject>() const {
47 return is<js::WeakMapObject>() || is<js::WeakSetObject>();
50 #endif /* builtin_WeakSetObject_h */