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_Object_h
8
#define builtin_Object_h
9
10
#include "jsapi.h"
11
12
#include "js/Value.h"
13
#include "vm/NativeObject.h"
14
15
namespace js {
16
17
// Object constructor native. Exposed only so the JIT can know its address.
18
MOZ_MUST_USE bool obj_construct(JSContext* cx, unsigned argc, JS::Value* vp);
19
20
PlainObject* ObjectCreateImpl(JSContext* cx, HandleObject proto,
21
NewObjectKind newKind = GenericObject,
22
HandleObjectGroup group = nullptr);
23
24
PlainObject* ObjectCreateWithTemplate(JSContext* cx,
25
HandlePlainObject templateObj);
26
27
// Object methods exposed so they can be installed in the self-hosting global.
28
MOZ_MUST_USE bool obj_propertyIsEnumerable(JSContext* cx, unsigned argc,
29
Value* vp);
30
31
MOZ_MUST_USE bool obj_create(JSContext* cx, unsigned argc, JS::Value* vp);
32
33
MOZ_MUST_USE bool obj_is(JSContext* cx, unsigned argc, JS::Value* vp);
34
35
MOZ_MUST_USE bool obj_getOwnPropertyNames(JSContext* cx, unsigned argc,
36
JS::Value* vp);
37
38
MOZ_MUST_USE bool obj_toString(JSContext* cx, unsigned argc, JS::Value* vp);
39
40
JSString* ObjectClassToString(JSContext* cx, HandleObject obj);
41
42
MOZ_MUST_USE bool GetOwnPropertyKeys(JSContext* cx, HandleObject obj,
43
unsigned flags,
44
JS::MutableHandleValue rval);
45
46
// Exposed for SelfHosting.cpp
47
MOZ_MUST_USE bool GetOwnPropertyDescriptorToArray(JSContext* cx, unsigned argc,
48
JS::Value* vp);
49
50
/*
51
* Like IdToValue, but convert int jsids to strings. This is used when
52
* exposing a jsid to script for Object.getOwnProperty{Names,Symbols}
53
* or scriptable proxy traps.
54
*/
55
MOZ_MUST_USE bool IdToStringOrSymbol(JSContext* cx, JS::HandleId id,
56
JS::MutableHandleValue result);
57
58
// Object.prototype.toSource. Function.prototype.toSource and uneval use this.
59
JSString* ObjectToSource(JSContext* cx, JS::HandleObject obj);
60
61
} /* namespace js */
62
63
#endif /* builtin_Object_h */