1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
* vim: set ts=8 sw=4 et tw=80:
4
* ***** BEGIN LICENSE BLOCK *****
5
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
7
* The contents of this file are subject to the Mozilla Public License Version
8
* 1.1 (the "License"); you may not use this file except in compliance with
9
* the License. You may obtain a copy of the License at
10
* http://www.mozilla.org/MPL/
12
* Software distributed under the License is distributed on an "AS IS" basis,
13
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14
* for the specific language governing rights and limitations under the
17
* The Original Code is Mozilla Communicator client code, released
20
* The Initial Developer of the Original Code is
21
* Netscape Communications Corporation.
22
* Portions created by the Initial Developer are Copyright (C) 1998
23
* the Initial Developer. All Rights Reserved.
27
* Alternatively, the contents of this file may be used under the terms of
28
* either of the GNU General Public License Version 2 or later (the "GPL"),
29
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
* in which case the provisions of the GPL or the LGPL are applicable instead
31
* of those above. If you wish to allow use of your version of this file only
32
* under the terms of either the GPL or the LGPL, and not to allow others to
33
* use your version of this file under the terms of the MPL, indicate your
34
* decision by deleting the provisions above and replace them with the notice
35
* and other provisions required by the GPL or the LGPL. If you do not delete
36
* the provisions above, a recipient may use your version of this file under
37
* the terms of any one of the MPL, the GPL or the LGPL.
39
* ***** END LICENSE BLOCK ***** */
44
* JS object definitions.
46
* A JS object consists of a possibly-shared object descriptor containing
47
* ordered property names, called the map; and a dense vector of property
48
* values, called slots. The map/slot pointer pair is GC'ed, while the map
49
* is reference counted and the slot vector is malloc'ed.
51
#include "jshash.h" /* Added by JSIFY */
58
jsrefcount nrefs; /* count of all referencing objects */
59
JSObjectOps *ops; /* high level object operation vtable */
60
uint32 nslots; /* length of obj->slots vector */
61
uint32 freeslot; /* index of next free obj->slots element */
64
/* Shorthand macros for frequently-made calls. */
65
#define OBJ_LOOKUP_PROPERTY(cx,obj,id,objp,propp) \
66
(obj)->map->ops->lookupProperty(cx,obj,id,objp,propp)
67
#define OBJ_DEFINE_PROPERTY(cx,obj,id,value,getter,setter,attrs,propp) \
68
(obj)->map->ops->defineProperty(cx,obj,id,value,getter,setter,attrs,propp)
69
#define OBJ_GET_PROPERTY(cx,obj,id,vp) \
70
(obj)->map->ops->getProperty(cx,obj,id,vp)
71
#define OBJ_SET_PROPERTY(cx,obj,id,vp) \
72
(obj)->map->ops->setProperty(cx,obj,id,vp)
73
#define OBJ_GET_ATTRIBUTES(cx,obj,id,prop,attrsp) \
74
(obj)->map->ops->getAttributes(cx,obj,id,prop,attrsp)
75
#define OBJ_SET_ATTRIBUTES(cx,obj,id,prop,attrsp) \
76
(obj)->map->ops->setAttributes(cx,obj,id,prop,attrsp)
77
#define OBJ_DELETE_PROPERTY(cx,obj,id,rval) \
78
(obj)->map->ops->deleteProperty(cx,obj,id,rval)
79
#define OBJ_DEFAULT_VALUE(cx,obj,hint,vp) \
80
(obj)->map->ops->defaultValue(cx,obj,hint,vp)
81
#define OBJ_ENUMERATE(cx,obj,enum_op,statep,idp) \
82
(obj)->map->ops->enumerate(cx,obj,enum_op,statep,idp)
83
#define OBJ_CHECK_ACCESS(cx,obj,id,mode,vp,attrsp) \
84
(obj)->map->ops->checkAccess(cx,obj,id,mode,vp,attrsp)
86
/* These four are time-optimized to avoid stub calls. */
87
#define OBJ_THIS_OBJECT(cx,obj) \
88
((obj)->map->ops->thisObject \
89
? (obj)->map->ops->thisObject(cx,obj) \
91
#define OBJ_DROP_PROPERTY(cx,obj,prop) \
92
((obj)->map->ops->dropProperty \
93
? (obj)->map->ops->dropProperty(cx,obj,prop) \
95
#define OBJ_GET_REQUIRED_SLOT(cx,obj,slot) \
96
((obj)->map->ops->getRequiredSlot \
97
? (obj)->map->ops->getRequiredSlot(cx, obj, slot) \
99
#define OBJ_SET_REQUIRED_SLOT(cx,obj,slot,v) \
100
((obj)->map->ops->setRequiredSlot \
101
? (obj)->map->ops->setRequiredSlot(cx, obj, slot, v) \
104
#define OBJ_TO_INNER_OBJECT(cx,obj) \
106
JSClass *clasp_ = OBJ_GET_CLASS(cx, obj); \
107
if (clasp_->flags & JSCLASS_IS_EXTENDED) { \
108
JSExtendedClass *xclasp_ = (JSExtendedClass*)clasp_; \
109
if (xclasp_->innerObject) \
110
obj = xclasp_->innerObject(cx, obj); \
115
* In the original JS engine design, obj->slots pointed to a vector of length
116
* JS_INITIAL_NSLOTS words if obj->map was shared with a prototype object,
117
* else of length obj->map->nslots. With the advent of JS_GetReservedSlot,
118
* JS_SetReservedSlot, and JSCLASS_HAS_RESERVED_SLOTS (see jsapi.h), the size
119
* of the minimum length slots vector in the case where map is shared cannot
120
* be constant. This length starts at JS_INITIAL_NSLOTS, but may advance to
121
* include all the reserved slots.
123
* Therefore slots must be self-describing. Rather than tag its low order bit
124
* (a bit is all we need) to distinguish initial length from reserved length,
125
* we do "the BSTR thing": over-allocate slots by one jsval, and store the
126
* *net* length (counting usable slots, which have non-negative obj->slots[]
127
* indices) in obj->slots[-1]. All code that sets obj->slots must be aware of
128
* this hack -- you have been warned, and jsobj.c has been updated!
135
#define JSSLOT_PROTO 0
136
#define JSSLOT_PARENT 1
137
#define JSSLOT_CLASS 2
138
#define JSSLOT_PRIVATE 3
139
#define JSSLOT_START(clasp) (((clasp)->flags & JSCLASS_HAS_PRIVATE) \
140
? JSSLOT_PRIVATE + 1 \
143
#define JSSLOT_FREE(clasp) (JSSLOT_START(clasp) \
144
+ JSCLASS_RESERVED_SLOTS(clasp))
146
#define JS_INITIAL_NSLOTS 5
149
#define MAP_CHECK_SLOT(map,slot) \
150
JS_ASSERT((uint32)slot < JS_MIN((map)->freeslot, (map)->nslots))
151
#define OBJ_CHECK_SLOT(obj,slot) \
152
MAP_CHECK_SLOT((obj)->map, slot)
154
#define OBJ_CHECK_SLOT(obj,slot) ((void)0)
157
/* Fast macros for accessing obj->slots while obj is locked (if thread-safe). */
158
#define LOCKED_OBJ_GET_SLOT(obj,slot) \
159
(OBJ_CHECK_SLOT(obj, slot), (obj)->slots[slot])
160
#define LOCKED_OBJ_SET_SLOT(obj,slot,value) \
161
(OBJ_CHECK_SLOT(obj, slot), (obj)->slots[slot] = (value))
162
#define LOCKED_OBJ_GET_PROTO(obj) \
163
JSVAL_TO_OBJECT(LOCKED_OBJ_GET_SLOT(obj, JSSLOT_PROTO))
164
#define LOCKED_OBJ_GET_CLASS(obj) \
165
((JSClass *)JSVAL_TO_PRIVATE(LOCKED_OBJ_GET_SLOT(obj, JSSLOT_CLASS)))
169
/* Thread-safe functions and wrapper macros for accessing obj->slots. */
170
#define OBJ_GET_SLOT(cx,obj,slot) \
171
(OBJ_CHECK_SLOT(obj, slot), \
172
(OBJ_IS_NATIVE(obj) && OBJ_SCOPE(obj)->ownercx == cx) \
173
? LOCKED_OBJ_GET_SLOT(obj, slot) \
174
: js_GetSlotThreadSafe(cx, obj, slot))
176
#define OBJ_SET_SLOT(cx,obj,slot,value) \
177
(OBJ_CHECK_SLOT(obj, slot), \
178
(OBJ_IS_NATIVE(obj) && OBJ_SCOPE(obj)->ownercx == cx) \
179
? (void) LOCKED_OBJ_SET_SLOT(obj, slot, value) \
180
: js_SetSlotThreadSafe(cx, obj, slot, value))
183
* If thread-safe, define an OBJ_GET_SLOT wrapper that bypasses, for a native
184
* object, the lock-free "fast path" test of (OBJ_SCOPE(obj)->ownercx == cx),
185
* to avoid needlessly switching from lock-free to lock-full scope when doing
186
* GC on a different context from the last one to own the scope. The caller
187
* in this case is probably a JSClass.mark function, e.g., fun_mark, or maybe
190
* The GC runs only when all threads except the one on which the GC is active
191
* are suspended at GC-safe points, so there is no hazard in directly accessing
192
* obj->slots[slot] from the GC's thread, once rt->gcRunning has been set. See
193
* jsgc.c for details.
195
#define THREAD_IS_RUNNING_GC(rt, thread) \
196
((rt)->gcRunning && (rt)->gcThread == (thread))
198
#define CX_THREAD_IS_RUNNING_GC(cx) \
199
THREAD_IS_RUNNING_GC((cx)->runtime, (cx)->thread)
201
#define GC_AWARE_GET_SLOT(cx, obj, slot) \
202
((OBJ_IS_NATIVE(obj) && CX_THREAD_IS_RUNNING_GC(cx)) \
203
? (obj)->slots[slot] \
204
: OBJ_GET_SLOT(cx, obj, slot))
206
#else /* !JS_THREADSAFE */
208
#define OBJ_GET_SLOT(cx,obj,slot) LOCKED_OBJ_GET_SLOT(obj,slot)
209
#define OBJ_SET_SLOT(cx,obj,slot,value) LOCKED_OBJ_SET_SLOT(obj,slot,value)
210
#define GC_AWARE_GET_SLOT(cx,obj,slot) LOCKED_OBJ_GET_SLOT(obj,slot)
212
#endif /* !JS_THREADSAFE */
214
/* Thread-safe proto, parent, and class access macros. */
215
#define OBJ_GET_PROTO(cx,obj) \
216
JSVAL_TO_OBJECT(OBJ_GET_SLOT(cx, obj, JSSLOT_PROTO))
217
#define OBJ_SET_PROTO(cx,obj,proto) \
218
OBJ_SET_SLOT(cx, obj, JSSLOT_PROTO, OBJECT_TO_JSVAL(proto))
220
#define OBJ_GET_PARENT(cx,obj) \
221
JSVAL_TO_OBJECT(OBJ_GET_SLOT(cx, obj, JSSLOT_PARENT))
222
#define OBJ_SET_PARENT(cx,obj,parent) \
223
OBJ_SET_SLOT(cx, obj, JSSLOT_PARENT, OBJECT_TO_JSVAL(parent))
225
#define OBJ_GET_CLASS(cx,obj) \
226
((JSClass *)JSVAL_TO_PRIVATE(OBJ_GET_SLOT(cx, obj, JSSLOT_CLASS)))
228
/* Test whether a map or object is native. */
229
#define MAP_IS_NATIVE(map) \
230
((map)->ops == &js_ObjectOps || \
231
((map)->ops && (map)->ops->newObjectMap == js_ObjectOps.newObjectMap))
233
#define OBJ_IS_NATIVE(obj) MAP_IS_NATIVE((obj)->map)
235
extern JS_FRIEND_DATA(JSObjectOps) js_ObjectOps;
236
extern JS_FRIEND_DATA(JSObjectOps) js_WithObjectOps;
237
extern JSClass js_ObjectClass;
238
extern JSClass js_WithClass;
239
extern JSClass js_BlockClass;
242
* Block scope object macros. The slots reserved by js_BlockClass are:
244
* JSSLOT_PRIVATE JSStackFrame * active frame pointer or null
245
* JSSLOT_BLOCK_DEPTH int depth of block slots in frame
247
* After JSSLOT_BLOCK_DEPTH come one or more slots for the block locals.
248
* OBJ_BLOCK_COUNT depends on this arrangement.
250
* A With object is like a Block object, in that both have one reserved slot
251
* telling the stack depth of the relevant slots (the slot whose value is the
252
* object named in the with statement, the slots containing the block's local
253
* variables); and both have a private slot referring to the JSStackFrame in
254
* whose activation they were created (or null if the with or block object
255
* outlives the frame).
257
#define JSSLOT_BLOCK_DEPTH (JSSLOT_PRIVATE + 1)
259
#define OBJ_BLOCK_COUNT(cx,obj) \
260
((obj)->map->freeslot - (JSSLOT_BLOCK_DEPTH + 1))
261
#define OBJ_BLOCK_DEPTH(cx,obj) \
262
JSVAL_TO_INT(OBJ_GET_SLOT(cx, obj, JSSLOT_BLOCK_DEPTH))
263
#define OBJ_SET_BLOCK_DEPTH(cx,obj,depth) \
264
OBJ_SET_SLOT(cx, obj, JSSLOT_BLOCK_DEPTH, INT_TO_JSVAL(depth))
267
* To make sure this slot is well-defined, always call js_NewWithObject to
268
* create a With object, don't call js_NewObject directly. When creating a
269
* With object that does not correspond to a stack slot, pass -1 for depth.
271
* When popping the stack across this object's "with" statement, client code
272
* must call JS_SetPrivate(cx, withobj, NULL).
275
js_NewWithObject(JSContext *cx, JSObject *proto, JSObject *parent, jsint depth);
278
* Create a new block scope object not linked to any proto or parent object.
279
* Blocks are created by the compiler to reify let blocks and comprehensions.
280
* Only when dynamic scope is captured do they need to be cloned and spliced
281
* into an active scope chain.
284
js_NewBlockObject(JSContext *cx);
287
js_CloneBlockObject(JSContext *cx, JSObject *proto, JSObject *parent,
291
js_PutBlockObject(JSContext *cx, JSObject *obj);
293
struct JSSharpObjectMap {
299
#define SHARP_BIT ((jsatomid) 1)
300
#define BUSY_BIT ((jsatomid) 2)
301
#define SHARP_ID_SHIFT 2
302
#define IS_SHARP(he) (JS_PTR_TO_UINT32((he)->value) & SHARP_BIT)
303
#define MAKE_SHARP(he) ((he)->value = JS_UINT32_TO_PTR(JS_PTR_TO_UINT32((he)->value)|SHARP_BIT))
304
#define IS_BUSY(he) (JS_PTR_TO_UINT32((he)->value) & BUSY_BIT)
305
#define MAKE_BUSY(he) ((he)->value = JS_UINT32_TO_PTR(JS_PTR_TO_UINT32((he)->value)|BUSY_BIT))
306
#define CLEAR_BUSY(he) ((he)->value = JS_UINT32_TO_PTR(JS_PTR_TO_UINT32((he)->value)&~BUSY_BIT))
309
js_EnterSharpObject(JSContext *cx, JSObject *obj, JSIdArray **idap,
313
js_LeaveSharpObject(JSContext *cx, JSIdArray **idap);
316
* Mark objects stored in map if GC happens between js_EnterSharpObject
317
* and js_LeaveSharpObject. GC calls this when map->depth > 0.
320
js_GCMarkSharpMap(JSContext *cx, JSSharpObjectMap *map);
323
js_obj_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
327
js_obj_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
331
js_HasOwnPropertyHelper(JSContext *cx, JSObject *obj, JSLookupPropOp lookup,
332
uintN argc, jsval *argv, jsval *rval);
335
js_InitBlockClass(JSContext *cx, JSObject* obj);
338
js_InitObjectClass(JSContext *cx, JSObject *obj);
340
/* Select Object.prototype method names shared between jsapi.c and jsobj.c. */
341
extern const char js_watch_str[];
342
extern const char js_unwatch_str[];
343
extern const char js_hasOwnProperty_str[];
344
extern const char js_isPrototypeOf_str[];
345
extern const char js_propertyIsEnumerable_str[];
346
extern const char js_defineGetter_str[];
347
extern const char js_defineSetter_str[];
348
extern const char js_lookupGetter_str[];
349
extern const char js_lookupSetter_str[];
352
js_InitObjectMap(JSObjectMap *map, jsrefcount nrefs, JSObjectOps *ops,
356
js_NewObjectMap(JSContext *cx, jsrefcount nrefs, JSObjectOps *ops,
357
JSClass *clasp, JSObject *obj);
360
js_DestroyObjectMap(JSContext *cx, JSObjectMap *map);
363
js_HoldObjectMap(JSContext *cx, JSObjectMap *map);
366
js_DropObjectMap(JSContext *cx, JSObjectMap *map, JSObject *obj);
369
js_GetClassId(JSContext *cx, JSClass *clasp, jsid *idp);
372
js_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);
375
* Fast access to immutable standard objects (constructors and prototypes).
378
js_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key,
382
js_SetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject *cobj);
385
js_FindClassObject(JSContext *cx, JSObject *start, jsid id, jsval *vp);
388
js_ConstructObject(JSContext *cx, JSClass *clasp, JSObject *proto,
389
JSObject *parent, uintN argc, jsval *argv);
392
js_FinalizeObject(JSContext *cx, JSObject *obj);
395
js_AllocSlot(JSContext *cx, JSObject *obj, uint32 *slotp);
398
js_FreeSlot(JSContext *cx, JSObject *obj, uint32 slot);
401
* Native property add and lookup variants that hide id in the hidden atom
402
* subspace, so as to avoid collisions between internal properties such as
403
* formal arguments and local variables in function objects, and externally
404
* set properties with the same ids.
406
extern JSScopeProperty *
407
js_AddHiddenProperty(JSContext *cx, JSObject *obj, jsid id,
408
JSPropertyOp getter, JSPropertyOp setter, uint32 slot,
409
uintN attrs, uintN flags, intN shortid);
412
js_LookupHiddenProperty(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
416
* Find or create a property named by id in obj's scope, with the given getter
417
* and setter, slot, attributes, and other members.
419
extern JSScopeProperty *
420
js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
421
JSPropertyOp getter, JSPropertyOp setter, uint32 slot,
422
uintN attrs, uintN flags, intN shortid);
425
* Change sprop to have the given attrs, getter, and setter in scope, morphing
426
* it into a potentially new JSScopeProperty. Return a pointer to the changed
427
* or identical property.
429
extern JSScopeProperty *
430
js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
431
JSScopeProperty *sprop, uintN attrs, uintN mask,
432
JSPropertyOp getter, JSPropertyOp setter);
435
* On error, return false. On success, if propp is non-null, return true with
436
* obj locked and with a held property in *propp; if propp is null, return true
437
* but release obj's lock first. Therefore all callers who pass non-null propp
438
* result parameters must later call OBJ_DROP_PROPERTY(cx, obj, *propp) both to
439
* drop the held property, and to release the lock on obj.
442
js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
443
JSPropertyOp getter, JSPropertyOp setter, uintN attrs,
447
js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
448
JSPropertyOp getter, JSPropertyOp setter, uintN attrs,
449
uintN flags, intN shortid, JSProperty **propp);
452
* Unlike js_DefineProperty, propp must be non-null. On success, and if id was
453
* found, return true with *objp non-null and locked, and with a held property
454
* stored in *propp. If successful but id was not found, return true with both
455
* *objp and *propp null. Therefore all callers who receive a non-null *propp
456
* must later call OBJ_DROP_PROPERTY(cx, *objp, *propp).
458
extern JS_FRIEND_API(JSBool)
459
js_LookupProperty(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
463
* Specialized subroutine that allows caller to preset JSRESOLVE_* flags.
464
* JSRESOLVE_HIDDEN flags hidden function param/local name lookups, just for
465
* internal use by fun_resolve and similar built-ins.
468
js_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, jsid id, uintN flags,
469
JSObject **objp, JSProperty **propp);
471
#define JSRESOLVE_HIDDEN 0x8000
473
extern JS_FRIEND_API(JSBool)
474
js_FindProperty(JSContext *cx, jsid id, JSObject **objp, JSObject **pobjp,
478
js_FindIdentifierBase(JSContext *cx, jsid id);
481
js_FindVariableScope(JSContext *cx, JSFunction **funp);
484
* NB: js_NativeGet and js_NativeSet are called with the scope containing sprop
485
* (pobj's scope for Get, obj's for Set) locked, and on successful return, that
486
* scope is again locked. But on failure, both functions return false with the
487
* scope containing sprop unlocked.
490
js_NativeGet(JSContext *cx, JSObject *obj, JSObject *pobj,
491
JSScopeProperty *sprop, jsval *vp);
494
js_NativeSet(JSContext *cx, JSObject *obj, JSScopeProperty *sprop, jsval *vp);
497
js_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
500
js_SetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
503
js_GetAttributes(JSContext *cx, JSObject *obj, jsid id, JSProperty *prop,
507
js_SetAttributes(JSContext *cx, JSObject *obj, jsid id, JSProperty *prop,
511
js_DeleteProperty(JSContext *cx, JSObject *obj, jsid id, jsval *rval);
514
js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);
517
js_NewIdArray(JSContext *cx, jsint length);
520
* Unlike realloc(3), this function frees ida on failure.
523
js_SetIdArrayLength(JSContext *cx, JSIdArray *ida, jsint length);
526
js_Enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
527
jsval *statep, jsid *idp);
530
js_MarkNativeIteratorStates(JSContext *cx);
533
js_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
534
jsval *vp, uintN *attrsp);
537
js_Call(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
540
js_Construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
544
js_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);
547
js_SetProtoOrParent(JSContext *cx, JSObject *obj, uint32 slot, JSObject *pobj);
550
js_IsDelegate(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);
553
js_GetClassPrototype(JSContext *cx, JSObject *scope, jsid id,
557
js_SetClassPrototype(JSContext *cx, JSObject *ctor, JSObject *proto,
561
js_ValueToObject(JSContext *cx, jsval v, JSObject **objp);
564
js_ValueToNonNullObject(JSContext *cx, jsval v);
567
js_TryValueOf(JSContext *cx, JSObject *obj, JSType type, jsval *rval);
570
js_TryMethod(JSContext *cx, JSObject *obj, JSAtom *atom,
571
uintN argc, jsval *argv, jsval *rval);
574
js_XDRObject(JSXDRState *xdr, JSObject **objp);
577
js_Mark(JSContext *cx, JSObject *obj, void *arg);
580
js_Clear(JSContext *cx, JSObject *obj);
583
js_GetRequiredSlot(JSContext *cx, JSObject *obj, uint32 slot);
586
js_SetRequiredSlot(JSContext *cx, JSObject *obj, uint32 slot, jsval v);
589
js_CheckScopeChainValidity(JSContext *cx, JSObject *scopeobj, const char *caller);
592
js_CheckPrincipalsAccess(JSContext *cx, JSObject *scopeobj,
593
JSPrincipals *principals, JSAtom *caller);
596
#endif /* jsobj_h___ */