Bug 580128 - Small cleanups in XrayWrapper and first stab at enumeration. r=mrbkap

This commit is contained in:
Andreas Gal
2010-10-10 15:37:22 -07:00
parent 2d2e42a896
commit 4e3d539ae9
5 changed files with 35 additions and 14 deletions

View File

@@ -372,6 +372,8 @@ Snapshot(JSContext *cx, JSObject *obj, uintN flags, typename EnumPolicy::ResultV
return true;
}
namespace js {
bool
VectorToIdArray(JSContext *cx, AutoIdVector &props, JSIdArray **idap)
{
@@ -389,12 +391,14 @@ VectorToIdArray(JSContext *cx, AutoIdVector &props, JSIdArray **idap)
return true;
}
bool
JS_FRIEND_API(bool)
GetPropertyNames(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector *props)
{
return Snapshot<KeyEnumeration>(cx, obj, flags & (JSITER_OWNONLY | JSITER_HIDDEN), props);
}
}
static inline bool
GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
{
@@ -559,6 +563,8 @@ VectorToKeyIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &key
return true;
}
namespace js {
bool
VectorToKeyIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &props, Value *vp)
{
@@ -725,6 +731,8 @@ GetIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
return true;
}
}
static JSObject *
iterator_iterator(JSContext *cx, JSObject *obj, JSBool keysonly)
{