Source code

Revision control

Other Tools

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/. */
6
7
#ifndef builtin_WeakSetObject_h
8
#define builtin_WeakSetObject_h
9
10
#include "builtin/WeakMapObject.h"
11
12
namespace js {
13
14
class GlobalObject;
15
16
class WeakSetObject : public WeakCollectionObject {
17
public:
18
static const JSClass class_;
19
static const JSClass protoClass_;
20
21
private:
22
static const ClassSpec classSpec_;
23
24
static const JSPropertySpec properties[];
25
static const JSFunctionSpec methods[];
26
27
static WeakSetObject* create(JSContext* cx, HandleObject proto = nullptr);
28
static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
29
30
static MOZ_MUST_USE MOZ_ALWAYS_INLINE bool is(HandleValue v);
31
32
static MOZ_MUST_USE MOZ_ALWAYS_INLINE bool add_impl(JSContext* cx,
33
const CallArgs& args);
34
static MOZ_MUST_USE bool add(JSContext* cx, unsigned argc, Value* vp);
35
static MOZ_MUST_USE MOZ_ALWAYS_INLINE bool delete_impl(JSContext* cx,
36
const CallArgs& args);
37
static MOZ_MUST_USE bool delete_(JSContext* cx, unsigned argc, Value* vp);
38
static MOZ_MUST_USE MOZ_ALWAYS_INLINE bool has_impl(JSContext* cx,
39
const CallArgs& args);
40
static MOZ_MUST_USE bool has(JSContext* cx, unsigned argc, Value* vp);
41
42
static bool isBuiltinAdd(HandleValue add);
43
};
44
45
} // namespace js
46
47
template <>
48
inline bool JSObject::is<js::WeakCollectionObject>() const {
49
return is<js::WeakMapObject>() || is<js::WeakSetObject>();
50
}
51
52
#endif /* builtin_WeakSetObject_h */