--- a/js/ipc/JavaScriptParent.cpp
+++ b/js/ipc/JavaScriptParent.cpp
@@ -57,23 +57,23 @@ class CPOWProxyHandler : public BaseProx
virtual ~CPOWProxyHandler() {}
virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE {
return false;
}
virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;
virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,
AutoIdVector &props) MOZ_OVERRIDE;
virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) MOZ_OVERRIDE;
virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,
@@ -108,24 +108,24 @@ JavaScriptParent::preventExtensions(JSCo
if (!CallPreventExtensions(objId, &status))
return ipcfail(cx);
return ok(cx, status);
}
bool
CPOWProxyHandler::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
return ParentOf(proxy)->getPropertyDescriptor(cx, proxy, id, desc, flags);
}
bool
JavaScriptParent::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
ObjectId objId = idOf(proxy);
nsString idstr;
if (!convertIdToGeckoString(cx, id, &idstr))
return false;
ReturnStatus status;
@@ -135,25 +135,25 @@ JavaScriptParent::getPropertyDescriptor(
if (!ok(cx, status))
return false;
return toDescriptor(cx, result, desc);
}
bool
CPOWProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
return ParentOf(proxy)->getOwnPropertyDescriptor(cx, proxy, id, desc, flags);
}
bool
JavaScriptParent::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
ObjectId objId = idOf(proxy);
nsString idstr;
if (!convertIdToGeckoString(cx, id, &idstr))
return false;
ReturnStatus status;
@@ -163,24 +163,24 @@ JavaScriptParent::getOwnPropertyDescript
if (!ok(cx, status))
return false;
return toDescriptor(cx, result, desc);
}
bool
CPOWProxyHandler::defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc)
+ MutableHandle<JSPropertyDescriptor> desc)
{
return ParentOf(proxy)->defineProperty(cx, proxy, id, desc);
}
bool
JavaScriptParent::defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc)
+ MutableHandle<JSPropertyDescriptor> desc)
{
ObjectId objId = idOf(proxy);
nsString idstr;
if (!convertIdToGeckoString(cx, id, &idstr))
return false;
PPropertyDescriptor descriptor;
--- a/js/src/jsclass.h
+++ b/js/src/jsclass.h
@@ -9,24 +9,24 @@
/*
* A JSClass acts as a vtable for JS objects that allows JSAPI clients to
* control various aspects of the behavior of an object like property lookup.
* js::Class is an engine-private extension that allows more control over
* object behavior and, e.g., allows custom slow layout.
*/
#include "jsapi.h"
-#include "jsprvtd.h"
namespace js {
class Class;
class FreeOp;
class PropertyId;
class PropertyName;
+class Shape;
class SpecialId;
// This is equal to JSFunction::class_. Use it in places where you don't want
// to #include jsfun.h.
extern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;
static JS_ALWAYS_INLINE jsid
SPECIALID_TO_JSID(const SpecialId &sid);
@@ -132,66 +132,66 @@ JSID_TO_SPECIALID(jsid id)
}
typedef JS::Handle<SpecialId> HandleSpecialId;
/* js::Class operation signatures. */
typedef bool
(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,
- MutableHandleObject objp, MutableHandleShape propp);
+ MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
-(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,
- MutableHandleObject objp, MutableHandleShape propp);
+(* LookupPropOp)(JSContext *cx, HandleObject obj, JS::Handle<PropertyName*> name,
+ MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,
- MutableHandleObject objp, MutableHandleShape propp);
+ MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,
- MutableHandleObject objp, MutableHandleShape propp);
+ MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,
- PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+ JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
typedef bool
-(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,
- PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+(* DefinePropOp)(JSContext *cx, HandleObject obj, JS::Handle<PropertyName*> name, HandleValue value,
+ JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
typedef bool
(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,
- PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+ JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
typedef bool
(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,
- PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+ JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
typedef bool
(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);
typedef bool
-(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);
+(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, JS::Handle<PropertyName*> name, MutableHandleValue vp);
typedef bool
(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);
typedef bool
(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);
typedef bool
(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);
typedef bool
(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, bool strict);
typedef bool
-(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, bool strict);
+(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, JS::Handle<PropertyName*> name, MutableHandleValue vp, bool strict);
typedef bool
(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, bool strict);
typedef bool
(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, bool strict);
typedef bool
(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
typedef bool
-(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
+(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, JS::Handle<PropertyName*> name, unsigned *attrsp);
typedef bool
(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
typedef bool
(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
typedef bool
-(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, bool *succeeded);
+(* DeletePropertyOp)(JSContext *cx, HandleObject obj, JS::Handle<PropertyName*> name, bool *succeeded);
typedef bool
(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, bool *succeeded);
typedef bool
(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, bool *succeeded);
typedef JSObject *
(* ObjectOp)(JSContext *cx, HandleObject obj);
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -6,18 +6,20 @@
#ifndef jsdbgapi_h
#define jsdbgapi_h
/*
* JS debugger API.
*/
+#include "jsapi.h"
#include "jsbytecode.h"
-#include "jsprvtd.h"
+
+class JSAtom;
namespace js { class StackFrame; }
namespace JS {
struct FrameDescription
{
JSScript *script;
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -25,16 +25,17 @@
((uintptr_t)(sp) < (limit)+(tolerance))
#else
# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance) \
((uintptr_t)(sp) > (limit)-(tolerance))
#endif
#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)
+class JSAtom;
class JSLinearString;
namespace JS {
template <class T>
class Heap;
} /* namespace JS */
extern JS_FRIEND_API(void)
@@ -167,17 +168,17 @@ js_DumpObject(JSObject *obj);
extern JS_FRIEND_API(void)
js_DumpChars(const jschar *s, size_t n);
#endif
extern JS_FRIEND_API(bool)
JS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);
extern JS_FRIEND_API(bool)
-JS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);
+JS_WrapPropertyDescriptor(JSContext *cx, JSPropertyDescriptor *desc);
extern JS_FRIEND_API(bool)
JS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);
extern JS_FRIEND_API(bool)
JS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,
js::MutableHandleValue statep, js::MutableHandleId idp);
@@ -362,17 +363,17 @@ struct Object {
}
};
struct Function {
Object base;
uint16_t nargs;
uint16_t flags;
/* Used only for natives */
- Native native;
+ JSNative native;
const JSJitInfo *jitinfo;
void *_1;
};
struct Atom {
static const size_t LENGTH_SHIFT = 4;
size_t lengthAndFlags;
const jschar *chars;
@@ -567,26 +568,26 @@ GetAtomLength(JSAtom *atom)
}
inline JSLinearString *
AtomToLinearString(JSAtom *atom)
{
return reinterpret_cast<JSLinearString *>(atom);
}
-static inline js::PropertyOp
+static inline JSPropertyOp
CastAsJSPropertyOp(JSObject *object)
{
- return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);
+ return JS_DATA_TO_FUNC_PTR(JSPropertyOp, object);
}
-static inline js::StrictPropertyOp
+static inline JSStrictPropertyOp
CastAsJSStrictPropertyOp(JSObject *object)
{
- return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);
+ return JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, object);
}
JS_FRIEND_API(bool)
GetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);
JS_FRIEND_API(bool)
AppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);
@@ -1777,17 +1778,17 @@ DefaultValue(JSContext *cx, JS::HandleOb
* but only if obj is native.
*
* The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as
* a sort of extension point, but there is no hook in js::Class,
* js::ProxyHandler, or the JSAPI with precisely the right semantics for it.
*/
extern JS_FRIEND_API(bool)
CheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,
- PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+ JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
class ScriptSource;
// An AsmJSModuleSourceDesc object holds a reference to the ScriptSource
// containing an asm.js module as well as the [begin, end) range of the
// module's chars within the ScriptSource.
class AsmJSModuleSourceDesc
{
@@ -1808,17 +1809,17 @@ class AsmJSModuleSourceDesc
AsmJSModuleSourceDesc(const AsmJSModuleSourceDesc &) MOZ_DELETE;
void operator=(const AsmJSModuleSourceDesc &) MOZ_DELETE;
};
} /* namespace js */
extern JS_FRIEND_API(bool)
js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,
- const js::PropertyDescriptor& descriptor, bool *bp);
+ const JSPropertyDescriptor& descriptor, bool *bp);
extern JS_FRIEND_API(bool)
js_ReportIsNotFunction(JSContext *cx, const JS::Value& v);
#ifdef JSGC_GENERATIONAL
extern JS_FRIEND_API(void)
JS_StoreObjectPostBarrierCallback(JSContext* cx,
void (*callback)(JSTracer *trc, void *key, void *data),
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -8,16 +8,17 @@
#ifndef jsinfer_h
#define jsinfer_h
#include "mozilla/MemoryReporting.h"
#include "jsalloc.h"
#include "jsfriendapi.h"
+#include "jsprvtd.h"
#include "ds/LifoAlloc.h"
#include "gc/Barrier.h"
#include "gc/Heap.h"
#include "js/HashTable.h"
#include "js/Vector.h"
class JSScript;
--- a/js/src/jsproxy.h
+++ b/js/src/jsproxy.h
@@ -102,23 +102,23 @@ class JS_FRIEND_API(BaseProxyHandler)
CALL
};
virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,
bool *bp);
/* ES5 Harmony fundamental proxy traps. */
virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;
virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) = 0;
virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) = 0;
virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc) = 0;
+ MutableHandle<JSPropertyDescriptor> desc) = 0;
virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,
AutoIdVector &props) = 0;
virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;
virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;
/* ES5 Harmony derived proxy traps. */
virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);
virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);
@@ -159,22 +159,22 @@ class JS_FRIEND_API(BaseProxyHandler)
class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler
{
public:
explicit DirectProxyHandler(void *family);
/* ES5 Harmony fundamental proxy traps. */
virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;
virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,
AutoIdVector &props) MOZ_OVERRIDE;
virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,
bool *bp) MOZ_OVERRIDE;
virtual bool enumerate(JSContext *cx, HandleObject proxy,
AutoIdVector &props) MOZ_OVERRIDE;
/* ES5 Harmony derived proxy traps. */
@@ -213,25 +213,25 @@ class JS_PUBLIC_API(DirectProxyHandler)
/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */
class Proxy
{
public:
/* ES5 Harmony fundamental proxy traps. */
static bool preventExtensions(JSContext *cx, HandleObject proxy);
static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags);
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,
MutableHandleValue vp);
static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags);
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,
MutableHandleValue vp);
static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
- MutableHandle<PropertyDescriptor> desc);
+ MutableHandle<JSPropertyDescriptor> desc);
static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);
static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);
static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);
static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);
/* ES5 Harmony derived proxy traps. */
static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);
static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);
--- a/js/src/jswrapper.h
+++ b/js/src/jswrapper.h
@@ -76,23 +76,23 @@ class JS_FRIEND_API(CrossCompartmentWrap
virtual ~CrossCompartmentWrapper();
virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;
/* ES5 Harmony fundamental wrapper traps. */
virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;
virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,
AutoIdVector &props) MOZ_OVERRIDE;
virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;
/* ES5 Harmony derived wrapper traps. */
virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;
@@ -146,17 +146,17 @@ class JS_FRIEND_API(SecurityWrapper) : p
virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,
CallArgs args) MOZ_OVERRIDE;
virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,
MutableHandleValue vp) MOZ_OVERRIDE;
virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,
JSContext *cx) MOZ_OVERRIDE;
virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;
virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
/*
* Allow our subclasses to select the superclass behavior they want without
* needing to specify an exact superclass.
*/
typedef Base Permissive;
typedef SecurityWrapper<Base> Restrictive;
};
@@ -169,23 +169,23 @@ class JS_FRIEND_API(DeadObjectProxy) : p
public:
static int sDeadObjectFamily;
explicit DeadObjectProxy();
/* ES5 Harmony fundamental wrapper traps. */
virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;
virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE;
+ MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,
AutoIdVector &props) MOZ_OVERRIDE;
virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;
virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;
/* Spidermonkey extensions. */
virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;
virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -39,17 +39,16 @@ EXPORTS += [
'jsclist.h',
'jscpucfg.h',
'jsdbgapi.h',
'jsfriendapi.h',
'jslock.h',
'jsprf.h',
'jsprototypes.h',
'jsproxy.h',
- 'jsprvtd.h',
'jspubtd.h',
'jstypes.h',
'jsutil.h',
'jsversion.h',
'jswrapper.h',
'perf/jsperf.h',
]
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -3092,17 +3092,17 @@ WrapCallable(JSContext *cx, JSObject *ca
RootedValue priv(cx, ObjectValue(*callable));
return js::NewProxyObject(cx, &xpc::sandboxCallableProxyHandler,
priv, nullptr,
sandboxProtoProxy, js::ProxyIsCallable);
}
template<typename Op>
-bool BindPropertyOp(JSContext *cx, Op &op, PropertyDescriptor *desc, HandleId id,
+bool BindPropertyOp(JSContext *cx, Op &op, JSPropertyDescriptor *desc, HandleId id,
unsigned attrFlag, HandleObject sandboxProtoProxy)
{
if (!op) {
return true;
}
RootedObject func(cx);
if (desc->attrs & attrFlag) {
@@ -3129,17 +3129,17 @@ extern bool
XPC_WN_Helper_GetProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp);
extern bool
XPC_WN_Helper_SetProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, MutableHandleValue vp);
bool
xpc::SandboxProxyHandler::getPropertyDescriptor(JSContext *cx,
JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
- JS::MutableHandle<PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
JS::RootedObject obj(cx, wrappedObject(proxy));
MOZ_ASSERT(js::GetObjectCompartment(obj) == js::GetObjectCompartment(proxy));
if (!JS_GetPropertyDescriptorById(cx, obj, id,
flags, desc.address()))
return false;
@@ -3177,17 +3177,17 @@ xpc::SandboxProxyHandler::getPropertyDes
return true;
}
bool
xpc::SandboxProxyHandler::getOwnPropertyDescriptor(JSContext *cx,
JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
- JS::MutableHandle<PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
if (!getPropertyDescriptor(cx, proxy, id, desc, flags))
return false;
if (desc.object() != wrappedObject(proxy))
desc.object().set(nullptr);
--- a/js/xpconnect/wrappers/ChromeObjectWrapper.cpp
+++ b/js/xpconnect/wrappers/ChromeObjectWrapper.cpp
@@ -25,17 +25,17 @@ AllowedByBase(JSContext *cx, HandleObjec
MOZ_ASSERT(js::Wrapper::wrapperHandler(wrapper) ==
&ChromeObjectWrapper::singleton);
bool bp;
ChromeObjectWrapper *handler = &ChromeObjectWrapper::singleton;
return handler->ChromeObjectWrapperBase::enter(cx, wrapper, id, act, &bp);
}
static bool
-PropIsFromStandardPrototype(JSContext *cx, JS::MutableHandle<js::PropertyDescriptor> desc)
+PropIsFromStandardPrototype(JSContext *cx, JS::MutableHandle<JSPropertyDescriptor> desc)
{
MOZ_ASSERT(desc.object());
RootedObject unwrapped(cx, js::UncheckedUnwrap(desc.object()));
JSAutoCompartment ac(cx, unwrapped);
return JS_IdentifyClassPrototype(cx, unwrapped) != JSProto_Null;
}
// Note that we're past the policy enforcement stage, here, so we can query
@@ -58,17 +58,17 @@ PropIsFromStandardPrototype(JSContext *c
}
return PropIsFromStandardPrototype(cx, &desc);
}
bool
ChromeObjectWrapper::getPropertyDescriptor(JSContext *cx,
HandleObject wrapper,
HandleId id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
assertEnteredPolicy(cx, wrapper, id);
// First, try a lookup on the base wrapper if permitted.
desc.object().set(NULL);
if (AllowedByBase(cx, wrapper, id, Wrapper::GET) &&
!ChromeObjectWrapperBase::getPropertyDescriptor(cx, wrapper, id,
desc, flags)) {
--- a/js/xpconnect/wrappers/ChromeObjectWrapper.h
+++ b/js/xpconnect/wrappers/ChromeObjectWrapper.h
@@ -26,17 +26,17 @@ namespace xpc {
class ChromeObjectWrapper : public ChromeObjectWrapperBase
{
public:
ChromeObjectWrapper() : ChromeObjectWrapperBase(0) {}
/* Custom traps. */
virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool has(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id, bool *bp) MOZ_OVERRIDE;
virtual bool get(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
virtual bool objectClassIs(JS::Handle<JSObject*> obj, js::ESClassValue classValue,
JSContext *cx) MOZ_OVERRIDE;
--- a/js/xpconnect/wrappers/FilteringWrapper.cpp
+++ b/js/xpconnect/wrappers/FilteringWrapper.cpp
@@ -43,45 +43,45 @@ Filter(JSContext *cx, HandleObject wrapp
return false;
}
props.resize(w);
return true;
}
template <typename Policy>
static bool
-FilterSetter(JSContext *cx, JSObject *wrapper, jsid id, JS::MutableHandle<js::PropertyDescriptor> desc)
+FilterSetter(JSContext *cx, JSObject *wrapper, jsid id, JS::MutableHandle<JSPropertyDescriptor> desc)
{
bool setAllowed = Policy::check(cx, wrapper, id, Wrapper::SET);
if (!setAllowed) {
if (JS_IsExceptionPending(cx))
return false;
desc.setSetter(nullptr);
}
return true;
}
template <typename Base, typename Policy>
bool
FilteringWrapper<Base, Policy>::getPropertyDescriptor(JSContext *cx, HandleObject wrapper,
HandleId id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
assertEnteredPolicy(cx, wrapper, id);
if (!Base::getPropertyDescriptor(cx, wrapper, id, desc, flags))
return false;
return FilterSetter<Policy>(cx, wrapper, id, desc);
}
template <typename Base, typename Policy>
bool
FilteringWrapper<Base, Policy>::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper,
HandleId id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
assertEnteredPolicy(cx, wrapper, id);
if (!Base::getOwnPropertyDescriptor(cx, wrapper, id, desc, flags))
return false;
return FilterSetter<Policy>(cx, wrapper, id, desc);
}
--- a/js/xpconnect/wrappers/FilteringWrapper.h
+++ b/js/xpconnect/wrappers/FilteringWrapper.h
@@ -16,21 +16,21 @@ namespace xpc {
template <typename Base, typename Policy>
class FilteringWrapper : public Base {
public:
FilteringWrapper(unsigned flags);
virtual ~FilteringWrapper();
virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> wrapper,
js::AutoIdVector &props) MOZ_OVERRIDE;
virtual bool enumerate(JSContext *cx, JS::Handle<JSObject*> wrapper,
js::AutoIdVector &props) MOZ_OVERRIDE;
virtual bool keys(JSContext *cx, JS::Handle<JSObject*> wrapper,
js::AutoIdVector &props) MOZ_OVERRIDE;
virtual bool iterate(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned flags,
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
@@ -13,17 +13,17 @@
#include "AccessCheck.h"
#include "WrapperFactory.h"
using namespace JS;
namespace xpc {
static bool
-WaiveAccessors(JSContext *cx, JS::MutableHandle<js::PropertyDescriptor> desc)
+WaiveAccessors(JSContext *cx, JS::MutableHandle<JSPropertyDescriptor> desc)
{
if (desc.hasGetterObject() && desc.getterObject()) {
RootedValue v(cx, JS::ObjectValue(*desc.getterObject()));
if (!WrapperFactory::WaiveXrayAndWrap(cx, v.address()))
return false;
desc.setGetterObject(&v.toObject());
}
@@ -41,26 +41,26 @@ WaiveXrayWrapper::WaiveXrayWrapper(unsig
}
WaiveXrayWrapper::~WaiveXrayWrapper()
{
}
bool
WaiveXrayWrapper::getPropertyDescriptor(JSContext *cx, HandleObject wrapper,
- HandleId id, JS::MutableHandle<js::PropertyDescriptor> desc,
+ HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
return CrossCompartmentWrapper::getPropertyDescriptor(cx, wrapper, id, desc, flags) &&
WrapperFactory::WaiveXrayAndWrap(cx, desc.value().address()) && WaiveAccessors(cx, desc);
}
bool
WaiveXrayWrapper::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper,
- HandleId id, JS::MutableHandle<js::PropertyDescriptor> desc,
+ HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
return CrossCompartmentWrapper::getOwnPropertyDescriptor(cx, wrapper, id, desc, flags) &&
WrapperFactory::WaiveXrayAndWrap(cx, desc.value().address()) && WaiveAccessors(cx, desc);
}
bool
WaiveXrayWrapper::get(JSContext *cx, HandleObject wrapper,
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.h
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h
@@ -17,21 +17,21 @@ namespace xpc {
class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
public:
WaiveXrayWrapper(unsigned flags);
virtual ~WaiveXrayWrapper();
virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool get(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
virtual bool call(JSContext *cx, JS::Handle<JSObject*> wrapper,
const JS::CallArgs &args) MOZ_OVERRIDE;
virtual bool construct(JSContext *cx, JS::Handle<JSObject*> wrapper,
const JS::CallArgs &args) MOZ_OVERRIDE;
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -22,17 +22,16 @@
#include "mozilla/dom/BindingUtils.h"
#include "nsGlobalWindow.h"
using namespace mozilla::dom;
using namespace JS;
using namespace mozilla;
-using js::PropertyDescriptor;
using js::Wrapper;
using js::IsCrossCompartmentWrapper;
using js::UncheckedUnwrap;
using js::CheckedUnwrap;
namespace xpc {
static const uint32_t JSSLOT_RESOLVING = 0;
@@ -129,25 +128,25 @@ class XrayTraits
{
public:
static JSObject* getTargetObject(JSObject *wrapper) {
return js::UncheckedUnwrap(wrapper, /* stopAtOuter = */ false);
}
virtual bool resolveNativeProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
+ MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) = 0;
// NB: resolveOwnProperty may decide whether or not to cache what it finds
// on the holder. If the result is not cached, the lookup will happen afresh
// for each access, which is the right thing for things like dynamic NodeList
// properties.
virtual bool resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper,
HandleObject wrapper, HandleObject holder,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags);
static bool call(JSContext *cx, HandleObject wrapper,
const JS::CallArgs &args, js::Wrapper& baseInstance)
{
MOZ_ASSUME_UNREACHABLE("Call trap currently implemented only for XPCWNs");
}
static bool construct(JSContext *cx, HandleObject wrapper,
@@ -188,32 +187,32 @@ class XPCWrappedNativeXrayTraits : publi
public:
static const XrayType Type = XrayForWrappedNative;
virtual bool resolveNativeProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
virtual bool resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags);
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
static bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
- Handle<PropertyDescriptor> existingDesc, bool *defined);
+ MutableHandle<JSPropertyDescriptor> desc,
+ Handle<JSPropertyDescriptor> existingDesc, bool *defined);
static bool enumerateNames(JSContext *cx, HandleObject wrapper, unsigned flags,
AutoIdVector &props);
static bool call(JSContext *cx, HandleObject wrapper,
const JS::CallArgs &args, js::Wrapper& baseInstance);
static bool construct(JSContext *cx, HandleObject wrapper,
const JS::CallArgs &args, js::Wrapper& baseInstance);
static bool isResolving(JSContext *cx, JSObject *holder, jsid id);
static bool resolveDOMCollectionProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- PropertyDescriptor *desc, unsigned flags);
+ JSPropertyDescriptor *desc, unsigned flags);
static XPCWrappedNative* getWN(JSObject *wrapper) {
return XPCWrappedNative::Get(getTargetObject(wrapper));
}
virtual void preserveWrapper(JSObject *target);
typedef ResolvingId ResolvingIdImpl;
@@ -231,23 +230,23 @@ public:
class DOMXrayTraits : public XrayTraits
{
public:
static const XrayType Type = XrayForDOMObject;
virtual bool resolveNativeProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags);
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
virtual bool resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags);
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
static bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
- Handle<PropertyDescriptor> existingDesc, bool *defined);
+ MutableHandle<JSPropertyDescriptor> desc,
+ Handle<JSPropertyDescriptor> existingDesc, bool *defined);
static bool enumerateNames(JSContext *cx, HandleObject wrapper, unsigned flags,
AutoIdVector &props);
static bool call(JSContext *cx, HandleObject wrapper,
const JS::CallArgs &args, js::Wrapper& baseInstance);
static bool construct(JSContext *cx, HandleObject wrapper,
const JS::CallArgs &args, js::Wrapper& baseInstance);
static bool isResolving(JSContext *cx, JSObject *holder, jsid id)
@@ -611,17 +610,17 @@ private:
// This is called after the resolveNativeProperty could not find any property
// with the given id. At this point we can check for DOM specific collections
// like document["formName"] because we already know that it is not shadowing
// any native property.
bool
XPCWrappedNativeXrayTraits::resolveDOMCollectionProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- PropertyDescriptor *desc, unsigned flags)
+ JSPropertyDescriptor *desc, unsigned flags)
{
// If we are not currently resolving this id and resolveNative is called
// we don't do anything. (see defineProperty in case of shadowing is forbidden).
ResolvingId *rid = ResolvingId::getResolvingId(holder);
if (!rid || rid->mId != id)
return true;
XPCWrappedNative *wn = getWN(wrapper);
@@ -689,17 +688,17 @@ XPCWrappedNativeXrayTraits::preserveWrap
CallQueryInterface(wn->Native(), getter_AddRefs(ci));
if (ci)
ci->PreserveWrapper(wn->Native());
}
bool
XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
MOZ_ASSERT(js::GetObjectJSClass(holder) == &HolderClass);
desc.object().set(NULL);
// This will do verification and the method lookup for us.
RootedObject target(cx, getTargetObject(wrapper));
XPCCallContext ccx(JS_CALLER, cx, target, NullPtr(), id);
@@ -795,17 +794,17 @@ wrappedJSObject_getter(JSContext *cx, Ha
vp.set(OBJECT_TO_JSVAL(wrapper));
return WrapperFactory::WaiveXrayAndWrap(cx, vp.address());
}
bool
XrayTraits::resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper,
HandleObject wrapper, HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
desc.object().set(NULL);
RootedObject target(cx, getTargetObject(wrapper));
RootedObject expando(cx, getExpandoObject(cx, target, wrapper));
// Check for expando properties first. Note that the expando object lives
// in the target compartment.
if (expando) {
@@ -821,17 +820,17 @@ XrayTraits::resolveOwnProperty(JSContext
return true;
}
return true;
}
bool
XPCWrappedNativeXrayTraits::resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper,
HandleObject wrapper, HandleObject holder,
- HandleId id, MutableHandle<PropertyDescriptor> desc,
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
// Call the common code.
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder,
id, desc, flags);
if (!ok || desc.object())
return ok;
@@ -902,18 +901,18 @@ XPCWrappedNativeXrayTraits::resolveOwnPr
// return non-|own| properties from Object.getOwnPropertyDescriptor if
// lookups are performed in a certain order, but we can probably live with
// that until XPCWN Xrays go away with the new DOM bindings.
return JS_GetPropertyDescriptorById(cx, holder, id, 0, desc.address());
}
bool
XPCWrappedNativeXrayTraits::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
- Handle<PropertyDescriptor> existingDesc, bool *defined)
+ MutableHandle<JSPropertyDescriptor> desc,
+ Handle<JSPropertyDescriptor> existingDesc, bool *defined)
{
*defined = false;
JSObject *holder = singleton.ensureHolder(cx, wrapper);
if (isResolving(cx, holder, id)) {
if (!desc.hasAttributes(JSPROP_GETTER | JSPROP_SETTER)) {
if (!desc.getter())
desc.setGetter(holder_get);
if (!desc.setter())
@@ -1024,32 +1023,32 @@ XPCWrappedNativeXrayTraits::construct(JS
return true;
}
bool
DOMXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
RootedObject obj(cx, getTargetObject(wrapper));
if (!XrayResolveNativeProperty(cx, wrapper, obj, id, desc.address()))
return false;
NS_ASSERTION(!desc.object() || desc.object() == wrapper,
"What did we resolve this on?");
return true;
}
bool
DOMXrayTraits::resolveOwnProperty(JSContext *cx, Wrapper &jsWrapper, HandleObject wrapper,
HandleObject holder, HandleId id,
- MutableHandle<PropertyDescriptor> desc, unsigned flags)
+ MutableHandle<JSPropertyDescriptor> desc, unsigned flags)
{
// Call the common code.
bool ok = XrayTraits::resolveOwnProperty(cx, jsWrapper, wrapper, holder,
id, desc, flags);
if (!ok || desc.object())
return ok;
RootedObject obj(cx, getTargetObject(wrapper));
@@ -1059,18 +1058,18 @@ DOMXrayTraits::resolveOwnProperty(JSCont
NS_ASSERTION(!desc.object() || desc.object() == wrapper,
"What did we resolve this on?");
return true;
}
bool
DOMXrayTraits::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
- MutableHandle<PropertyDescriptor> desc,
- Handle<PropertyDescriptor> existingDesc, bool *defined)
+ MutableHandle<JSPropertyDescriptor> desc,
+ Handle<JSPropertyDescriptor> existingDesc, bool *defined)
{
if (!existingDesc.object())
return true;
JS::Rooted<JSObject*> obj(cx, getTargetObject(wrapper));
return XrayDefineProperty(cx, wrapper, obj, id, desc, defined);
}
@@ -1195,17 +1194,17 @@ bool
HasNativeProperty(JSContext *cx, HandleObject wrapper, HandleId id, bool *hasProp)
{
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(wrapper));
XrayTraits *traits = GetXrayTraits(wrapper);
MOZ_ASSERT(traits);
RootedObject holder(cx, traits->ensureHolder(cx, wrapper));
NS_ENSURE_TRUE(holder, false);
*hasProp = false;
- Rooted<PropertyDescriptor> desc(cx);
+ Rooted<JSPropertyDescriptor> desc(cx);
Wrapper *handler = Wrapper::wrapperHandler(wrapper);
// Try resolveOwnProperty.
Maybe<ResolvingId> resolvingId;
if (traits == &XPCWrappedNativeXrayTraits::singleton)
resolvingId.construct(cx, wrapper, id);
if (!traits->resolveOwnProperty(cx, *handler, wrapper, holder, id, &desc, 0))
return false;
@@ -1335,17 +1334,17 @@ XrayWrapper<Base, Traits>::preventExtens
// See above.
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_CHANGE_EXTENSIBILITY);
return false;
}
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- JS::MutableHandle<PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
assertEnteredPolicy(cx, wrapper, id);
RootedObject holder(cx, Traits::singleton.ensureHolder(cx, wrapper));
if (Traits::isResolving(cx, holder, id)) {
desc.object().set(NULL);
return true;
}
@@ -1482,17 +1481,17 @@ XrayWrapper<Base, Traits>::getPropertyDe
MOZ_ASSERT(desc.object());
desc.object().set(wrapper);
return true;
}
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
- JS::MutableHandle<PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags)
{
assertEnteredPolicy(cx, wrapper, id);
RootedObject holder(cx, Traits::singleton.ensureHolder(cx, wrapper));
if (Traits::isResolving(cx, holder, id)) {
desc.object().set(NULL);
return true;
}
@@ -1519,18 +1518,18 @@ XrayWrapper<Base, Traits>::getOwnPropert
// object. Manually re-apply Xrays if necessary.
//
// NB: In order to satisfy the invariants of WaiveXray, we need to pass
// in an object sans security wrapper, which means we need to strip off any
// potential same-compartment security wrapper that may have been applied
// to the content object. This is ok, because the the expando object is only
// ever accessed by code across the compartment boundary.
static bool
-RecreateLostWaivers(JSContext *cx, PropertyDescriptor *orig,
- MutableHandle<PropertyDescriptor> wrapped)
+RecreateLostWaivers(JSContext *cx, JSPropertyDescriptor *orig,
+ MutableHandle<JSPropertyDescriptor> wrapped)
{
// Compute whether the original objects were waived, and implicitly, whether
// they were objects at all.
bool valueWasWaived =
orig->value.isObject() &&
WrapperFactory::HasWaiveXrayFlag(&orig->value.toObject());
bool getterWasWaived =
(orig->attrs & JSPROP_GETTER) &&
@@ -1564,23 +1563,23 @@ RecreateLostWaivers(JSContext *cx, Prope
}
return true;
}
template <typename Base, typename Traits>
bool
XrayWrapper<Base, Traits>::defineProperty(JSContext *cx, HandleObject wrapper,
- HandleId id, MutableHandle<PropertyDescriptor> desc)
+ HandleId id, MutableHandle<JSPropertyDescriptor> desc)
{
assertEnteredPolicy(cx, wrapper, id);
// NB: We still need JSRESOLVE_ASSIGNING here for the time being, because it
// tells things like nodelists whether they should create the property or not.
- Rooted<PropertyDescriptor> existing_desc(cx);
+ Rooted<JSPropertyDescriptor> existing_desc(cx);
if (!getOwnPropertyDescriptor(cx, wrapper, id, &existing_desc, JSRESOLVE_ASSIGNING))
return false;
if (existing_desc.object() && existing_desc.isPermanent())
return true; // silently ignore attempt to overwrite native property
bool defined = false;
if (!Traits::defineProperty(cx, wrapper, id, desc, existing_desc, &defined))
@@ -1595,17 +1594,17 @@ XrayWrapper<Base, Traits>::definePropert
// Grab the relevant expando object.
RootedObject expandoObject(cx, Traits::singleton.ensureExpandoObject(cx, wrapper,
target));
if (!expandoObject)
return false;
// Wrap the property descriptor for the target compartment.
- Rooted<PropertyDescriptor> wrappedDesc(cx, desc);
+ Rooted<JSPropertyDescriptor> wrappedDesc(cx, desc);
if (!JS_WrapPropertyDescriptor(cx, wrappedDesc.address()))
return false;
// Fix up Xray waivers.
if (!RecreateLostWaivers(cx, desc.address(), &wrappedDesc))
return false;
return JS_DefinePropertyById(cx, expandoObject, id, wrappedDesc.value(),
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -68,22 +68,22 @@ class XrayWrapper : public Base {
public:
XrayWrapper(unsigned flags);
virtual ~XrayWrapper();
/* Fundamental proxy traps. */
virtual bool isExtensible(JSContext *cx, JS::Handle<JSObject*> wrapper, bool *extensible) MOZ_OVERRIDE;
virtual bool preventExtensions(JSContext *cx, JS::Handle<JSObject*> wrapper) MOZ_OVERRIDE;
virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc, unsigned flags);
+ JS::MutableHandle<JSPropertyDescriptor> desc, unsigned flags);
virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags);
virtual bool defineProperty(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc);
+ JS::MutableHandle<JSPropertyDescriptor> desc);
virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> wrapper,
js::AutoIdVector &props);
virtual bool delete_(JSContext *cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id, bool *bp);
virtual bool enumerate(JSContext *cx, JS::Handle<JSObject*> wrapper, js::AutoIdVector &props);
/* Derived proxy traps. */
virtual bool get(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<JSObject*> receiver,
@@ -126,21 +126,21 @@ class XrayWrapper : public Base {
class SandboxProxyHandler : public js::Wrapper {
public:
SandboxProxyHandler() : js::Wrapper(0)
{
}
virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> proxy,
JS::Handle<jsid> id,
- JS::MutableHandle<js::PropertyDescriptor> desc,
+ JS::MutableHandle<JSPropertyDescriptor> desc,
unsigned flags) MOZ_OVERRIDE;
// We just forward the derived traps to the BaseProxyHandler versions which
// implement them in terms of the fundamental traps.
virtual bool has(JSContext *cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
bool *bp) MOZ_OVERRIDE;
virtual bool hasOwn(JSContext *cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
bool *bp) MOZ_OVERRIDE;