author | Jason Orendorff <jorendorff@mozilla.com> |
Fri, 25 Apr 2014 16:11:01 -0500 | |
changeset 198840 | e0741f7815ffce0ee1fc5344ec928223b34ae7ab |
parent 198839 | 96ed2ff9305d491bff11043641aa837e2078f6a7 |
child 198841 | 7dc397393c83815e891258298e02d2e9e5db3ccc |
push id | 3624 |
push user | asasaki@mozilla.com |
push date | Mon, 09 Jun 2014 21:49:01 +0000 |
treeherder | mozilla-beta@b1a5da15899a [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Waldo |
bugs | 547140 |
milestone | 31.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -5845,17 +5845,17 @@ nsDocument::RegisterElement(JSContext* a const js::Class* clasp = js::GetObjectClass(protoObject); if (IsDOMIfaceAndProtoClass(clasp)) { rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return nullptr; } JS::Rooted<JSPropertyDescriptor> descRoot(aCx); JS::MutableHandle<JSPropertyDescriptor> desc(&descRoot); - if(!JS_GetPropertyDescriptor(aCx, protoObject, "constructor", 0, desc)) { + if (!JS_GetPropertyDescriptor(aCx, protoObject, "constructor", desc)) { rv.Throw(NS_ERROR_UNEXPECTED); return nullptr; } // Check if non-configurable if (desc.isPermanent()) { rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return nullptr;
--- a/dom/base/WindowNamedPropertiesHandler.cpp +++ b/dom/base/WindowNamedPropertiesHandler.cpp @@ -81,18 +81,17 @@ GetWindowFromGlobal(JSObject* aGlobal) MOZ_ASSERT(piWin); return static_cast<nsGlobalWindow*>(piWin.get()); } bool WindowNamedPropertiesHandler::getOwnPropertyDescriptor(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<jsid> aId, - JS::MutableHandle<JSPropertyDescriptor> aDesc, - unsigned aFlags) + JS::MutableHandle<JSPropertyDescriptor> aDesc) { if (!JSID_IS_STRING(aId)) { // Nothing to do if we're resolving a non-string property. return true; } JS::Rooted<JSObject*> global(aCx, JS_GetGlobalForObject(aCx, aProxy)); if (HasPropertyOnPrototype(aCx, aProxy, aId)) {
--- a/dom/base/WindowNamedPropertiesHandler.h +++ b/dom/base/WindowNamedPropertiesHandler.h @@ -25,18 +25,17 @@ public: // Throw a TypeError, per WebIDL. JS_ReportErrorNumber(aCx, js_GetErrorMessage, nullptr, JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } virtual bool getOwnPropertyDescriptor(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<jsid> aId, - JS::MutableHandle<JSPropertyDescriptor> aDesc, - unsigned aFlags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> aDesc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<jsid> aId, JS::MutableHandle<JSPropertyDescriptor> aDesc) MOZ_OVERRIDE; virtual bool ownPropNames(JSContext* aCx, JS::Handle<JSObject*> aProxy, unsigned flags, JS::AutoIdVector& aProps) MOZ_OVERRIDE; virtual bool
--- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -610,23 +610,21 @@ public: // Fundamental traps virtual bool isExtensible(JSContext *cx, JS::Handle<JSObject*> proxy, bool *extensible) MOZ_OVERRIDE; virtual bool preventExtensions(JSContext *cx, JS::Handle<JSObject*> proxy) MOZ_OVERRIDE; virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> proxy, JS::AutoIdVector &props) MOZ_OVERRIDE; virtual bool delete_(JSContext *cx, JS::Handle<JSObject*> proxy, @@ -743,52 +741,50 @@ nsOuterWindowProxy::finalize(JSFreeOp *f global->PoisonOuterWindowProxy(proxy); } } bool nsOuterWindowProxy::getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { // The only thing we can do differently from js::Wrapper is shadow stuff with // our indexed properties, so we can just try getOwnPropertyDescriptor and if // that gives us nothing call on through to js::Wrapper. desc.object().set(nullptr); - if (!getOwnPropertyDescriptor(cx, proxy, id, desc, flags)) { + if (!getOwnPropertyDescriptor(cx, proxy, id, desc)) { return false; } if (desc.object()) { return true; } - return js::Wrapper::getPropertyDescriptor(cx, proxy, id, desc, flags); + return js::Wrapper::getPropertyDescriptor(cx, proxy, id, desc); } bool nsOuterWindowProxy::getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { bool found; if (!GetSubframeWindow(cx, proxy, id, desc.value(), found)) { return false; } if (found) { FillPropertyDescriptor(desc, proxy, true); return true; } // else fall through to js::Wrapper - return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc, flags); + return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc); } bool nsOuterWindowProxy::defineProperty(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, JS::MutableHandle<JSPropertyDescriptor> desc) {
--- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -8642,32 +8642,31 @@ class CGResolveOwnProperty(CGAbstractSta Argument('JS::MutableHandle<JSPropertyDescriptor>', 'desc'), Argument('unsigned', 'flags'), ] CGAbstractStaticMethod.__init__(self, descriptor, "ResolveOwnProperty", "bool", args) def definition_body(self): # BOGUS extra blank line at end of function - return " return js::GetProxyHandler(obj)->getOwnPropertyDescriptor(cx, wrapper, id, desc, flags);\n\n" + return " return js::GetProxyHandler(obj)->getOwnPropertyDescriptor(cx, wrapper, id, desc);\n\n" class CGResolveOwnPropertyViaNewresolve(CGAbstractBindingMethod): """ An implementation of Xray ResolveOwnProperty stuff for things that have a newresolve hook. """ def __init__(self, descriptor): args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'wrapper'), Argument('JS::Handle<JSObject*>', 'obj'), Argument('JS::Handle<jsid>', 'id'), Argument('JS::MutableHandle<JSPropertyDescriptor>', 'desc'), - Argument('unsigned', 'flags'), - ] + Argument('unsigned', 'flags')] CGAbstractBindingMethod.__init__(self, descriptor, "ResolveOwnPropertyViaNewresolve", args, getThisObj="", callArgs="") def generate_code(self): return CGGeneric(indent(dedent(""" { @@ -9062,18 +9061,17 @@ class CGProxyUnwrap(CGAbstractMethod): type=self.descriptor.nativeType)) class CGDOMJSProxyHandler_getOwnPropertyDescriptor(ClassMethod): def __init__(self, descriptor): args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'proxy'), Argument('JS::Handle<jsid>', 'id'), - Argument('JS::MutableHandle<JSPropertyDescriptor>', 'desc'), - Argument('unsigned', 'flags')] + Argument('JS::MutableHandle<JSPropertyDescriptor>', 'desc')] ClassMethod.__init__(self, "getOwnPropertyDescriptor", "bool", args, virtual=True, override=True) self.descriptor = descriptor def getBody(self): indexedGetter = self.descriptor.operations['IndexedGetter'] indexedSetter = self.descriptor.operations['IndexedSetter'] @@ -9095,17 +9093,17 @@ class CGDOMJSProxyHandler_getOwnProperty """, callGetter=CGProxyIndexedGetter(self.descriptor, templateValues).define()) else: getIndexed = "" if UseHolderForUnforgeable(self.descriptor): tryHolder = dedent(""" - if (!JS_GetPropertyDescriptorById(cx, ${holder}, id, flags, desc)) { + if (!JS_GetPropertyDescriptorById(cx, ${holder}, id, desc)) { return false; } MOZ_ASSERT_IF(desc.object(), desc.object() == ${holder}); """) # We don't want to look at the unforgeable holder at all # in the xray case; that part got handled already. getUnforgeable = fill( @@ -9150,17 +9148,17 @@ class CGDOMJSProxyHandler_getOwnProperty return fill( """ bool isXray = xpc::WrapperFactory::IsXrayWrapper(proxy); $*{getIndexed} $*{getUnforgeable} JS::Rooted<JSObject*> expando(cx); if (!isXray && (expando = GetExpandoObject(proxy))) { - if (!JS_GetPropertyDescriptorById(cx, expando, id, flags, desc)) { + if (!JS_GetPropertyDescriptorById(cx, expando, id, desc)) { return false; } if (desc.object()) { // Pretend the property lives on the wrapper. desc.object().set(proxy); return true; } }
--- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -161,36 +161,35 @@ DOMProxyHandler::preventExtensions(JSCon JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } bool BaseDOMProxyHandler::getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + MutableHandle<JSPropertyDescriptor> desc) { - if (!getOwnPropertyDescriptor(cx, proxy, id, desc, flags)) { + if (!getOwnPropertyDescriptor(cx, proxy, id, desc)) { return false; } if (desc.object()) { return true; } JS::Rooted<JSObject*> proto(cx); if (!js::GetObjectProto(cx, proxy, &proto)) { return false; } if (!proto) { desc.object().set(nullptr); return true; } - return JS_GetPropertyDescriptorById(cx, proto, id, 0, desc); + return JS_GetPropertyDescriptorById(cx, proto, id, desc); } bool DOMProxyHandler::defineProperty(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, MutableHandle<JSPropertyDescriptor> desc, bool* defined) { if (desc.hasGetterObject() && desc.setter() == JS_StrictPropertyStub) { return JS_ReportErrorFlagsAndNumber(cx,
--- a/dom/bindings/DOMJSProxyHandler.h +++ b/dom/bindings/DOMJSProxyHandler.h @@ -45,18 +45,17 @@ public: {} // Implementations of traps that can be implemented in terms of // fundamental traps. bool enumerate(JSContext* cx, JS::Handle<JSObject*> proxy, JS::AutoIdVector& props) MOZ_OVERRIDE; bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; bool watch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, JS::Handle<JSObject*> callable) MOZ_OVERRIDE; bool unwatch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id) MOZ_OVERRIDE; virtual bool getOwnPropertyNames(JSContext* cx, JS::Handle<JSObject*> proxy, JS::AutoIdVector &props) MOZ_OVERRIDE; // We override keys() and implement it directly instead of using the
--- a/dom/xbl/nsXBLProtoImpl.cpp +++ b/dom/xbl/nsXBLProtoImpl.cpp @@ -228,17 +228,17 @@ nsXBLProtoImpl::CompilePrototypeMembers( bool nsXBLProtoImpl::LookupMember(JSContext* aCx, nsString& aName, JS::Handle<jsid> aNameAsId, JS::MutableHandle<JSPropertyDescriptor> aDesc, JS::Handle<JSObject*> aClassObject) { for (nsXBLProtoImplMember* m = mMembers; m; m = m->GetNext()) { if (aName.Equals(m->GetName())) { - return JS_GetPropertyDescriptorById(aCx, aClassObject, aNameAsId, 0, aDesc); + return JS_GetPropertyDescriptorById(aCx, aClassObject, aNameAsId, aDesc); } } return true; } void nsXBLProtoImpl::Trace(const TraceCallbacks& aCallbacks, void *aClosure) {
--- a/js/ipc/JavaScriptChild.cpp +++ b/js/ipc/JavaScriptChild.cpp @@ -169,18 +169,17 @@ EmptyDesc(PPropertyDescriptor *desc) desc->attrs() = 0; desc->value() = void_t(); desc->getter() = 0; desc->setter() = 0; } bool JavaScriptChild::AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id, - const uint32_t &flags, ReturnStatus *rs, - PPropertyDescriptor *out) + ReturnStatus *rs, PPropertyDescriptor *out) { AutoSafeJSContext cx; JSAutoRequest request(cx); EmptyDesc(out); RootedObject obj(cx, findObject(objId)); if (!obj) @@ -188,32 +187,31 @@ JavaScriptChild::AnswerGetPropertyDescri JSAutoCompartment comp(cx, obj); RootedId internedId(cx); if (!convertGeckoStringToId(cx, id, &internedId)) return fail(cx, rs); Rooted<JSPropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, obj, internedId, flags, &desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, internedId, &desc)) return fail(cx, rs); if (!desc.object()) return ok(rs); if (!fromDescriptor(cx, desc, out)) return fail(cx, rs); return ok(rs); } bool JavaScriptChild::AnswerGetOwnPropertyDescriptor(const ObjectId &objId, const nsString &id, - const uint32_t &flags, ReturnStatus *rs, - PPropertyDescriptor *out) + ReturnStatus *rs, PPropertyDescriptor *out) { AutoSafeJSContext cx; JSAutoRequest request(cx); EmptyDesc(out); RootedObject obj(cx, findObject(objId)); if (!obj) @@ -221,17 +219,17 @@ JavaScriptChild::AnswerGetOwnPropertyDes JSAutoCompartment comp(cx, obj); RootedId internedId(cx); if (!convertGeckoStringToId(cx, id, &internedId)) return fail(cx, rs); Rooted<JSPropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, obj, internedId, flags, &desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, internedId, &desc)) return fail(cx, rs); if (desc.object() != obj) return ok(rs); if (!fromDescriptor(cx, desc, out)) return fail(cx, rs); @@ -339,17 +337,17 @@ JavaScriptChild::AnswerHasOwn(const Obje JSAutoCompartment comp(cx, obj); RootedId internedId(cx); if (!convertGeckoStringToId(cx, id, &internedId)) return fail(cx, rs); Rooted<JSPropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, obj, internedId, 0, &desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, internedId, &desc)) return fail(cx, rs); *bp = (desc.object() == obj); return ok(rs); } bool JavaScriptChild::AnswerGet(const ObjectId &objId, const ObjectId &receiverId, const nsString &id,
--- a/js/ipc/JavaScriptChild.h +++ b/js/ipc/JavaScriptChild.h @@ -24,21 +24,20 @@ class JavaScriptChild bool init(); void trace(JSTracer *trc); bool RecvDropObject(const ObjectId &objId) MOZ_OVERRIDE; bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs) MOZ_OVERRIDE; bool AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id, - const uint32_t &flags, ReturnStatus *rs, + ReturnStatus *rs, PPropertyDescriptor *out) MOZ_OVERRIDE; bool AnswerGetOwnPropertyDescriptor(const ObjectId &objId, const nsString &id, - const uint32_t &flags, ReturnStatus *rs, PPropertyDescriptor *out) MOZ_OVERRIDE; bool AnswerDefineProperty(const ObjectId &objId, const nsString &id, const PPropertyDescriptor &flags, ReturnStatus *rs) MOZ_OVERRIDE; bool AnswerDelete(const ObjectId &objId, const nsString &id, ReturnStatus *rs, bool *success) MOZ_OVERRIDE;
--- a/js/ipc/JavaScriptParent.cpp +++ b/js/ipc/JavaScriptParent.cpp @@ -59,21 +59,19 @@ 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, - HandleId id, MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, 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; @@ -118,62 +116,61 @@ JavaScriptParent::preventExtensions(JSCo if (!CallPreventExtensions(objId, &status)) return ipcfail(cx); return ok(cx, status); } bool CPOWProxyHandler::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, unsigned flags) + MutableHandle<JSPropertyDescriptor> desc) { - FORWARD(getPropertyDescriptor, (cx, proxy, id, desc, flags)); + FORWARD(getPropertyDescriptor, (cx, proxy, id, desc)); } bool JavaScriptParent::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, unsigned flags) + MutableHandle<JSPropertyDescriptor> desc) { ObjectId objId = idOf(proxy); nsString idstr; if (!convertIdToGeckoString(cx, id, &idstr)) return false; ReturnStatus status; PPropertyDescriptor result; - if (!CallGetPropertyDescriptor(objId, idstr, flags, &status, &result)) + if (!CallGetPropertyDescriptor(objId, idstr, &status, &result)) return ipcfail(cx); if (!ok(cx, status)) return false; return toDescriptor(cx, result, desc); } bool CPOWProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, - HandleId id, MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + HandleId id, MutableHandle<JSPropertyDescriptor> desc) { - FORWARD(getOwnPropertyDescriptor, (cx, proxy, id, desc, flags)); + FORWARD(getOwnPropertyDescriptor, (cx, proxy, id, desc)); } bool JavaScriptParent::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, unsigned flags) + MutableHandle<JSPropertyDescriptor> desc) { ObjectId objId = idOf(proxy); nsString idstr; if (!convertIdToGeckoString(cx, id, &idstr)) return false; ReturnStatus status; PPropertyDescriptor result; - if (!CallGetOwnPropertyDescriptor(objId, idstr, flags, &status, &result)) + if (!CallGetOwnPropertyDescriptor(objId, idstr, &status, &result)) return ipcfail(cx); if (!ok(cx, status)) return false; return toDescriptor(cx, result, desc); } bool
--- a/js/ipc/JavaScriptParent.h +++ b/js/ipc/JavaScriptParent.h @@ -29,19 +29,19 @@ class JavaScriptParent bool init(); public: // Fundamental proxy traps. These are required. // (The traps should be in the same order like js/src/jsproxy.h) bool preventExtensions(JSContext *cx, JS::HandleObject proxy); bool getPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle<JSPropertyDescriptor> desc, unsigned flags); + JS::MutableHandle<JSPropertyDescriptor> desc); bool getOwnPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle<JSPropertyDescriptor> desc, unsigned flags); + JS::MutableHandle<JSPropertyDescriptor> desc); bool defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc); bool getOwnPropertyNames(JSContext *cx, JS::HandleObject proxy, JS::AutoIdVector &props); bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp); bool enumerate(JSContext *cx, JS::HandleObject proxy, JS::AutoIdVector &props); // Derived proxy traps. Implementing these is useful for perfomance. bool has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp);
--- a/js/ipc/PJavaScript.ipdl +++ b/js/ipc/PJavaScript.ipdl @@ -19,18 +19,18 @@ intr protocol PJavaScript manager PContent; child: // The parent process no longer holds any references to the child object. async DropObject(uint64_t objId); // These roughly map to the ProxyHandler hooks that CPOWs need. rpc PreventExtensions(uint64_t objId) returns (ReturnStatus rs); - rpc GetPropertyDescriptor(uint64_t objId, nsString id, uint32_t flags) returns (ReturnStatus rs, PPropertyDescriptor result); - rpc GetOwnPropertyDescriptor(uint64_t objId, nsString id, uint32_t flags) returns (ReturnStatus rs, PPropertyDescriptor result); + rpc GetPropertyDescriptor(uint64_t objId, nsString id) returns (ReturnStatus rs, PPropertyDescriptor result); + rpc GetOwnPropertyDescriptor(uint64_t objId, nsString id) returns (ReturnStatus rs, PPropertyDescriptor result); rpc DefineProperty(uint64_t objId, nsString id, PPropertyDescriptor descriptor) returns (ReturnStatus rs); rpc Delete(uint64_t objId, nsString id) returns (ReturnStatus rs, bool successful); rpc Has(uint64_t objId, nsString id) returns (ReturnStatus rs, bool has); rpc HasOwn(uint64_t objId, nsString id) returns (ReturnStatus rs, bool has); rpc Get(uint64_t objId, uint64_t receiverId, nsString id) returns (ReturnStatus rs, JSVariant result); rpc Set(uint64_t objId, uint64_t receiverId, nsString id, bool strict, JSVariant value) returns (ReturnStatus rs, JSVariant result);
--- a/js/jsd/jsd_val.cpp +++ b/js/jsd/jsd_val.cpp @@ -510,17 +510,17 @@ jsd_GetValueProperty(JSDContext* jsdc, J JS::Rooted<JSPropertyDescriptor> desc(cx); { JSAutoCompartment ac(cx, obj); JS::RootedId id(cx, nameid); if(!JS_WrapId(cx, &id)) return nullptr; - if(!JS_GetOwnPropertyDescriptorById(cx, obj, id, 0, &desc)) + if(!JS_GetOwnPropertyDescriptorById(cx, obj, id, &desc)) return nullptr; if(!desc.object()) return nullptr; JS_ClearPendingException(cx); if(!JS_GetPropertyById(cx, obj, id, &val)) {
--- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -437,17 +437,17 @@ obj_lookupGetter(JSContext *cx, unsigned RootedObject obj(cx, ToObject(cx, args.thisv())); if (!obj) return false; if (obj->is<ProxyObject>()) { // The vanilla getter lookup code below requires that the object is // native. Handle proxies separately. args.rval().setUndefined(); Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getPropertyDescriptor(cx, obj, id, &desc, 0)) + if (!Proxy::getPropertyDescriptor(cx, obj, id, &desc)) return false; if (desc.object() && desc.hasGetterObject() && desc.getterObject()) args.rval().setObject(*desc.getterObject()); return true; } RootedObject pobj(cx); RootedShape shape(cx); if (!JSObject::lookupGeneric(cx, obj, id, &pobj, &shape)) @@ -473,17 +473,17 @@ obj_lookupSetter(JSContext *cx, unsigned RootedObject obj(cx, ToObject(cx, args.thisv())); if (!obj) return false; if (obj->is<ProxyObject>()) { // The vanilla setter lookup code below requires that the object is // native. Handle proxies separately. args.rval().setUndefined(); Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getPropertyDescriptor(cx, obj, id, &desc, 0)) + if (!Proxy::getPropertyDescriptor(cx, obj, id, &desc)) return false; if (desc.object() && desc.hasSetterObject() && desc.setterObject()) args.rval().setObject(*desc.setterObject()); return true; } RootedObject pobj(cx); RootedShape shape(cx); if (!JSObject::lookupGeneric(cx, obj, id, &pobj, &shape))
--- a/js/src/jit/AsmJSLink.cpp +++ b/js/src/jit/AsmJSLink.cpp @@ -158,17 +158,17 @@ static bool GetDataProperty(JSContext *cx, HandleValue objVal, HandlePropertyName field, MutableHandleValue v) { if (!objVal.isObject()) return LinkFail(cx, "accessing property of non-object"); Rooted<JSPropertyDescriptor> desc(cx); RootedObject obj(cx, &objVal.toObject()); RootedId id(cx, NameToId(field)); - if (!JS_GetPropertyDescriptorById(cx, obj, id, 0, &desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, id, &desc)) return false; if (!desc.object()) return LinkFail(cx, "property not present on object"); if (desc.hasGetterOrSetterObject()) return LinkFail(cx, "property is not a data property");
--- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp +++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp @@ -41,17 +41,17 @@ BEGIN_TEST(testDefineGetterSetterNonEnum CHECK(JS_DefineProperty(cx, vObject, PROPERTY_NAME, JS::UndefinedHandleValue, JSPROP_GETTER | JSPROP_SETTER | JSPROP_PERMANENT, JS_DATA_TO_FUNC_PTR(JSPropertyOp, (JSObject*) funGetObj), JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, (JSObject*) funSetObj))); JS::Rooted<JSPropertyDescriptor> desc(cx); - CHECK(JS_GetOwnPropertyDescriptor(cx, vObject, PROPERTY_NAME, 0, &desc)); + CHECK(JS_GetOwnPropertyDescriptor(cx, vObject, PROPERTY_NAME, &desc)); CHECK(desc.object()); CHECK(desc.hasGetterObject()); CHECK(desc.hasSetterObject()); CHECK(desc.isPermanent()); CHECK(!desc.isEnumerable()); return true; }
--- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -2700,17 +2700,17 @@ LookupResult(JSContext *cx, HandleObject /* XXX bad API: no way to tell "not defined" from "void value" */ vp.setUndefined(); return true; } if (!obj2->isNative()) { if (obj2->is<ProxyObject>()) { Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getPropertyDescriptor(cx, obj2, id, &desc, 0)) + if (!Proxy::getPropertyDescriptor(cx, obj2, id, &desc)) return false; if (!desc.isShared()) { vp.set(desc.value()); return true; } } } else if (IsImplicitDenseOrTypedArrayElement(shape)) { vp.set(obj2->getDenseOrTypedArrayElement(JSID_TO_INT(id))); @@ -3290,27 +3290,27 @@ JS_DefineProperties(JSContext *cx, Handl } if (!ok) break; } return ok; } static bool -GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, - bool own, MutableHandle<PropertyDescriptor> desc) +GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, + MutableHandle<PropertyDescriptor> desc) { RootedObject obj2(cx); RootedShape shape(cx); - if (!LookupPropertyById(cx, obj, id, flags, &obj2, &shape)) + if (!LookupPropertyById(cx, obj, id, 0, &obj2, &shape)) return false; desc.clear(); - if (!shape || (own && obj != obj2)) + if (!shape) return true; desc.object().set(obj2); if (obj2->isNative()) { if (IsImplicitDenseOrTypedArrayElement(shape)) { desc.setEnumerable(); desc.value().set(obj2->getDenseOrTypedArrayElement(JSID_TO_INT(id))); } else { @@ -3318,67 +3318,65 @@ GetPropertyDescriptorById(JSContext *cx, desc.setGetter(shape->getter()); desc.setSetter(shape->setter()); JS_ASSERT(desc.value().isUndefined()); if (shape->hasSlot()) desc.value().set(obj2->nativeGetSlot(shape->slot())); } } else { if (obj2->is<ProxyObject>()) { - JSAutoResolveFlags rf(cx, flags); - return own - ? Proxy::getOwnPropertyDescriptor(cx, obj2, id, desc, 0) - : Proxy::getPropertyDescriptor(cx, obj2, id, desc, 0); + JSAutoResolveFlags rf(cx, 0); + return Proxy::getPropertyDescriptor(cx, obj2, id, desc); } if (!JSObject::getGenericAttributes(cx, obj2, id, &desc.attributesRef())) return false; JS_ASSERT(desc.getter() == nullptr); JS_ASSERT(desc.setter() == nullptr); JS_ASSERT(desc.value().isUndefined()); } return true; } JS_PUBLIC_API(bool) -JS_GetOwnPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, +JS_GetOwnPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, MutableHandle<JSPropertyDescriptor> desc) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); - return GetPropertyDescriptorById(cx, obj, id, flags, true, desc); -} - -JS_PUBLIC_API(bool) -JS_GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, const char *name, unsigned flags, + return GetOwnPropertyDescriptor(cx, obj, id, desc); +} + +JS_PUBLIC_API(bool) +JS_GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, const char *name, MutableHandle<JSPropertyDescriptor> desc) { JSAtom *atom = Atomize(cx, name, strlen(name)); if (!atom) return false; RootedId id(cx, AtomToId(atom)); - return JS_GetOwnPropertyDescriptorById(cx, obj, id, flags, desc); -} - -JS_PUBLIC_API(bool) -JS_GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, + return JS_GetOwnPropertyDescriptorById(cx, obj, id, desc); +} + +JS_PUBLIC_API(bool) +JS_GetPropertyDescriptorById(JSContext *cx, HandleObject obj, HandleId id, MutableHandle<JSPropertyDescriptor> desc) { - return GetPropertyDescriptorById(cx, obj, id, flags, false, desc); -} - -JS_PUBLIC_API(bool) -JS_GetPropertyDescriptor(JSContext *cx, HandleObject obj, const char *name, unsigned flags, + return GetPropertyDescriptorById(cx, obj, id, desc); +} + +JS_PUBLIC_API(bool) +JS_GetPropertyDescriptor(JSContext *cx, HandleObject obj, const char *name, MutableHandle<JSPropertyDescriptor> desc) { JSAtom *atom = Atomize(cx, name, strlen(name)); if (!atom) return false; RootedId id(cx, AtomToId(atom)); - return atom && JS_GetPropertyDescriptorById(cx, obj, id, flags, desc); + return atom && JS_GetPropertyDescriptorById(cx, obj, id, desc); } JS_PUBLIC_API(bool) JS_GetPropertyById(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) { return JS_ForwardGetPropertyTo(cx, obj, id, obj, vp); }
--- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3017,33 +3017,33 @@ class MutableHandleBase<JSPropertyDescri return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address(); } }; } /* namespace js */ extern JS_PUBLIC_API(bool) JS_GetOwnPropertyDescriptorById(JSContext *cx, JS::HandleObject obj, JS::HandleId id, - unsigned flags, JS::MutableHandle<JSPropertyDescriptor> desc); + JS::MutableHandle<JSPropertyDescriptor> desc); extern JS_PUBLIC_API(bool) -JS_GetOwnPropertyDescriptor(JSContext *cx, JS::HandleObject obj, const char *name, unsigned flags, +JS_GetOwnPropertyDescriptor(JSContext *cx, JS::HandleObject obj, const char *name, JS::MutableHandle<JSPropertyDescriptor> desc); /* * Like JS_GetOwnPropertyDescriptorById but will return a property on * an object on the prototype chain (returned in desc->obj). If desc->obj is null, * then this property was not found on the prototype chain. */ extern JS_PUBLIC_API(bool) -JS_GetPropertyDescriptorById(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags, +JS_GetPropertyDescriptorById(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc); extern JS_PUBLIC_API(bool) -JS_GetPropertyDescriptor(JSContext *cx, JS::HandleObject obj, const char *name, unsigned flags, +JS_GetPropertyDescriptor(JSContext *cx, JS::HandleObject obj, const char *name, JS::MutableHandle<JSPropertyDescriptor> desc); extern JS_PUBLIC_API(bool) JS_GetProperty(JSContext *cx, JS::HandleObject obj, const char *name, JS::MutableHandleValue vp); extern JS_PUBLIC_API(bool) JS_GetPropertyById(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp);
--- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -215,17 +215,17 @@ PropDesc::makeObject(JSContext *cx) } bool js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, MutableHandle<PropertyDescriptor> desc) { // FIXME: Call TrapGetOwnProperty directly once ScriptedIndirectProxies is removed if (obj->is<ProxyObject>()) - return Proxy::getOwnPropertyDescriptor(cx, obj, id, desc, 0); + return Proxy::getOwnPropertyDescriptor(cx, obj, id, desc); RootedObject pobj(cx); RootedShape shape(cx); if (!HasOwnProperty<CanGC>(cx, obj->getOps()->lookupGeneric, obj, id, &pobj, &shape)) return false; if (!shape) { desc.object().set(nullptr); return true; @@ -4886,17 +4886,17 @@ baseops::SetPropertyHelper(typename Exec if (shape) { if (!pobj->isNative()) { if (pobj->is<ProxyObject>()) { if (mode == ParallelExecution) return false; JSContext *cx = cxArg->asJSContext(); Rooted<PropertyDescriptor> pd(cx); - if (!Proxy::getPropertyDescriptor(cx, pobj, id, &pd, 0)) + if (!Proxy::getPropertyDescriptor(cx, pobj, id, &pd)) return false; if ((pd.attributes() & (JSPROP_SHARED | JSPROP_SHADOWABLE)) == JSPROP_SHARED) { return !pd.setter() || CallSetter(cx, receiver, id, pd.setter(), pd.attributes(), strict, vp); } if (pd.isReadonly()) {
--- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -98,43 +98,43 @@ BaseProxyHandler::enter(JSContext *cx, H return true; } bool BaseProxyHandler::has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) { assertEnteredPolicy(cx, proxy, id, GET); Rooted<PropertyDescriptor> desc(cx); - if (!getPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getPropertyDescriptor(cx, proxy, id, &desc)) return false; *bp = !!desc.object(); return true; } bool BaseProxyHandler::hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) { // Note: Proxy::set needs to invoke hasOwn to determine where the setter // lives, so we allow SET operations to invoke us. assertEnteredPolicy(cx, proxy, id, GET | SET); Rooted<PropertyDescriptor> desc(cx); - if (!getOwnPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getOwnPropertyDescriptor(cx, proxy, id, &desc)) return false; *bp = !!desc.object(); return true; } bool BaseProxyHandler::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, MutableHandleValue vp) { assertEnteredPolicy(cx, proxy, id, GET); Rooted<PropertyDescriptor> desc(cx); - if (!getPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getPropertyDescriptor(cx, proxy, id, &desc)) return false; if (!desc.object()) { vp.setUndefined(); return true; } if (!desc.getter() || (!desc.hasGetterObject() && desc.getter() == JS_PropertyStub)) { @@ -154,17 +154,17 @@ BaseProxyHandler::get(JSContext *cx, Han bool BaseProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, bool strict, MutableHandleValue vp) { assertEnteredPolicy(cx, proxy, id, SET); Rooted<PropertyDescriptor> desc(cx); - if (!getOwnPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getOwnPropertyDescriptor(cx, proxy, id, &desc)) return false; /* The control-flow here differs from ::get() because of the fall-through case below. */ if (desc.object()) { // Check for read-only properties. if (desc.isReadonly()) return strict ? Throw(cx, id, JSMSG_CANT_REDEFINE_PROP) : true; if (!desc.setter()) { // Be wary of the odd explicit undefined setter case possible through @@ -182,17 +182,17 @@ BaseProxyHandler::set(JSContext *cx, Han if (!desc.getter()) { // Same as above for the null setter case. if (!desc.hasGetterObject()) desc.setGetter(JS_PropertyStub); } desc.value().set(vp.get()); return defineProperty(cx, receiver, id, &desc); } - if (!getPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getPropertyDescriptor(cx, proxy, id, &desc)) return false; if (desc.object()) { // Check for read-only properties. if (desc.isReadonly()) return strict ? Throw(cx, id, JSMSG_CANT_REDEFINE_PROP) : true; if (!desc.setter()) { // Be wary of the odd explicit undefined setter case possible through // Object.defineProperty. @@ -235,17 +235,17 @@ BaseProxyHandler::keys(JSContext *cx, Ha /* Select only the enumerable properties through in-place iteration. */ Rooted<PropertyDescriptor> desc(cx); RootedId id(cx); size_t i = 0; for (size_t j = 0, len = props.length(); j < len; j++) { JS_ASSERT(i <= j); id = props[j]; AutoWaivePolicy policy(cx, proxy, id, BaseProxyHandler::GET); - if (!getOwnPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!getOwnPropertyDescriptor(cx, proxy, id, &desc)) return false; if (desc.object() && desc.isEnumerable()) props[i++] = id; } JS_ASSERT(i <= props.length()); props.resize(i); @@ -380,48 +380,31 @@ BaseProxyHandler::slice(JSContext *cx, H { assertEnteredPolicy(cx, proxy, JSID_VOID, GET); return js::SliceSlowly(cx, proxy, proxy, begin, end, result); } bool DirectProxyHandler::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { assertEnteredPolicy(cx, proxy, id, GET | SET); JS_ASSERT(!hasPrototype()); // Should never be called if there's a prototype. RootedObject target(cx, proxy->as<ProxyObject>().target()); - return JS_GetPropertyDescriptorById(cx, target, id, 0, desc); -} - -static bool -GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, - MutableHandle<PropertyDescriptor> desc) -{ - // If obj is a proxy, we can do better than just guessing. This is - // important for certain types of wrappers that wrap other wrappers. - if (obj->is<ProxyObject>()) - return Proxy::getOwnPropertyDescriptor(cx, obj, id, desc, flags); - - if (!JS_GetPropertyDescriptorById(cx, obj, id, flags, desc)) - return false; - if (desc.object() != obj) - desc.object().set(nullptr); - return true; + return JS_GetPropertyDescriptorById(cx, target, id, desc); } bool -DirectProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, - HandleId id, MutableHandle<PropertyDescriptor> desc, - unsigned flags) +DirectProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, + MutableHandle<PropertyDescriptor> desc) { assertEnteredPolicy(cx, proxy, id, GET | SET); RootedObject target(cx, proxy->as<ProxyObject>().target()); - return GetOwnPropertyDescriptor(cx, target, id, 0, desc); + return js::GetOwnPropertyDescriptor(cx, target, id, desc); } bool DirectProxyHandler::defineProperty(JSContext *cx, HandleObject proxy, HandleId id, MutableHandle<PropertyDescriptor> desc) { assertEnteredPolicy(cx, proxy, id, SET); RootedObject target(cx, proxy->as<ProxyObject>().target()); @@ -573,17 +556,17 @@ DirectProxyHandler::has(JSContext *cx, H bool DirectProxyHandler::hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) { // Note: Proxy::set needs to invoke hasOwn to determine where the setter // lives, so we allow SET operations to invoke us. assertEnteredPolicy(cx, proxy, id, GET | SET); RootedObject target(cx, proxy->as<ProxyObject>().target()); Rooted<PropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, target, id, 0, &desc)) + if (!JS_GetPropertyDescriptorById(cx, target, id, &desc)) return false; *bp = (desc.object() == target); return true; } bool DirectProxyHandler::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, MutableHandleValue vp) @@ -759,21 +742,19 @@ class ScriptedIndirectProxyHandler : pub { public: ScriptedIndirectProxyHandler(); virtual ~ScriptedIndirectProxyHandler(); /* 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<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props); 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. */ virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE; @@ -861,32 +842,30 @@ ReturnedValueMustNotBePrimitive(JSContex static JSObject * GetIndirectProxyHandlerObject(JSObject *proxy) { return proxy->as<ProxyObject>().private_().toObjectOrNull(); } bool ScriptedIndirectProxyHandler::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) + MutableHandle<PropertyDescriptor> desc) { RootedObject handler(cx, GetIndirectProxyHandlerObject(proxy)); RootedValue fval(cx), value(cx); return GetFundamentalTrap(cx, handler, cx->names().getPropertyDescriptor, &fval) && Trap1(cx, handler, fval, id, &value) && ((value.get().isUndefined() && IndicatePropertyNotFound(desc)) || (ReturnedValueMustNotBePrimitive(cx, proxy, cx->names().getPropertyDescriptor, value) && ParsePropertyDescriptorObject(cx, proxy, value, desc))); } bool ScriptedIndirectProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) + MutableHandle<PropertyDescriptor> desc) { RootedObject handler(cx, GetIndirectProxyHandlerObject(proxy)); RootedValue fval(cx), value(cx); return GetFundamentalTrap(cx, handler, cx->names().getOwnPropertyDescriptor, &fval) && Trap1(cx, handler, fval, id, &value) && ((value.get().isUndefined() && IndicatePropertyNotFound(desc)) || (ReturnedValueMustNotBePrimitive(cx, proxy, cx->names().getPropertyDescriptor, value) && ParsePropertyDescriptorObject(cx, proxy, value, desc))); @@ -1081,21 +1060,19 @@ ScriptedIndirectProxyHandler ScriptedInd class ScriptedDirectProxyHandler : public DirectProxyHandler { public: ScriptedDirectProxyHandler(); virtual ~ScriptedDirectProxyHandler(); /* 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<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props); 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. */ virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE; @@ -1225,17 +1202,17 @@ IsAccessorDescriptor(const PropertyDescr } // Aux.5 ValidateProperty(O, P, Desc) static bool ValidateProperty(JSContext *cx, HandleObject obj, HandleId id, PropDesc *desc, bool *bp) { // step 1 Rooted<PropertyDescriptor> current(cx); - if (!GetOwnPropertyDescriptor(cx, obj, id, 0, ¤t)) + if (!GetOwnPropertyDescriptor(cx, obj, id, ¤t)) return false; /* * steps 2-4 are redundant since ValidateProperty is never called unless * target.[[HasOwn]](P) is true */ JS_ASSERT(current.object()); @@ -1328,29 +1305,29 @@ ValidateProperty(JSContext *cx, HandleOb } // Aux.6 IsSealed(O, P) static bool IsSealed(JSContext* cx, HandleObject obj, HandleId id, bool *bp) { // step 1 Rooted<PropertyDescriptor> desc(cx); - if (!GetOwnPropertyDescriptor(cx, obj, id, 0, &desc)) + if (!GetOwnPropertyDescriptor(cx, obj, id, &desc)) return false; // steps 2-3 *bp = desc.object() && desc.isPermanent(); return true; } static bool HasOwn(JSContext *cx, HandleObject obj, HandleId id, bool *bp) { Rooted<PropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, obj, id, 0, &desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, id, &desc)) return false; *bp = (desc.object() == obj); return true; } static bool IdToValue(JSContext *cx, HandleId id, MutableHandleValue value) { @@ -1729,39 +1706,37 @@ ScriptedDirectProxyHandler::preventExten // step h JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } // FIXME: Move to Proxy::getPropertyDescriptor once ScriptedIndirectProxy is removed bool ScriptedDirectProxyHandler::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) + MutableHandle<PropertyDescriptor> desc) { JS_CHECK_RECURSION(cx, return false); if (!GetOwnPropertyDescriptor(cx, proxy, id, desc)) return false; if (desc.object()) return true; RootedObject proto(cx); if (!JSObject::getProto(cx, proxy, &proto)) return false; if (!proto) { JS_ASSERT(!desc.object()); return true; } - return JS_GetPropertyDescriptorById(cx, proto, id, 0, desc); + return JS_GetPropertyDescriptorById(cx, proto, id, desc); } bool ScriptedDirectProxyHandler::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) + MutableHandle<PropertyDescriptor> desc) { // step 1 RootedValue v(cx); if (!TrapGetOwnProperty(cx, proxy, id, &v)) return false; // step 2 if (v.isUndefined()) { @@ -2367,67 +2342,66 @@ ScriptedDirectProxyHandler ScriptedDirec if (!proto) \ return true; \ assertSameCompartment(cx, proxy, proto); \ return protoCall; \ JS_END_MACRO \ bool Proxy::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { JS_CHECK_RECURSION(cx, return false); BaseProxyHandler *handler = proxy->as<ProxyObject>().handler(); desc.object().set(nullptr); // default result if we refuse to perform this action AutoEnterPolicy policy(cx, handler, proxy, id, BaseProxyHandler::GET, true); if (!policy.allowed()) return policy.returnValue(); if (!handler->hasPrototype()) - return handler->getPropertyDescriptor(cx, proxy, id, desc, flags); - if (!handler->getOwnPropertyDescriptor(cx, proxy, id, desc, flags)) + return handler->getPropertyDescriptor(cx, proxy, id, desc); + if (!handler->getOwnPropertyDescriptor(cx, proxy, id, desc)) return false; if (desc.object()) return true; - INVOKE_ON_PROTOTYPE(cx, handler, proxy, JS_GetPropertyDescriptorById(cx, proto, id, 0, desc)); + INVOKE_ON_PROTOTYPE(cx, handler, proxy, JS_GetPropertyDescriptorById(cx, proto, id, desc)); } bool -Proxy::getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, - HandleId id, MutableHandleValue vp) +Proxy::getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, MutableHandleValue vp) { JS_CHECK_RECURSION(cx, return false); Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getPropertyDescriptor(cx, proxy, id, &desc, flags)) + if (!Proxy::getPropertyDescriptor(cx, proxy, id, &desc)) return false; return NewPropertyDescriptorObject(cx, desc, vp); } bool Proxy::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { JS_CHECK_RECURSION(cx, return false); BaseProxyHandler *handler = proxy->as<ProxyObject>().handler(); desc.object().set(nullptr); // default result if we refuse to perform this action AutoEnterPolicy policy(cx, handler, proxy, id, BaseProxyHandler::GET, true); if (!policy.allowed()) return policy.returnValue(); - return handler->getOwnPropertyDescriptor(cx, proxy, id, desc, flags); + return handler->getOwnPropertyDescriptor(cx, proxy, id, desc); } bool -Proxy::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id, +Proxy::getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, MutableHandleValue vp) { JS_CHECK_RECURSION(cx, return false); Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getOwnPropertyDescriptor(cx, proxy, id, &desc, flags)) + if (!Proxy::getOwnPropertyDescriptor(cx, proxy, id, &desc)) return false; return NewPropertyDescriptorObject(cx, desc, vp); } bool Proxy::defineProperty(JSContext *cx, HandleObject proxy, HandleId id, MutableHandle<PropertyDescriptor> desc) { @@ -2596,17 +2570,17 @@ Proxy::set(JSContext *cx, HandleObject p // If the proxy doesn't require that we consult its prototype for the // non-own cases, we can sink to the |set| trap. if (!handler->hasPrototype()) return handler->set(cx, proxy, receiver, id, strict, vp); // If we have an existing (own or non-own) property with a setter, we want // to invoke that. Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getPropertyDescriptor(cx, proxy, id, &desc, 0)) + if (!Proxy::getPropertyDescriptor(cx, proxy, id, &desc)) return false; if (desc.object() && desc.setter() && desc.setter() != JS_StrictPropertyStub) return CallSetter(cx, receiver, id, desc.setter(), desc.attributes(), strict, vp); // Ok. Either there was no pre-existing property, or it was a value prop // that we're going to shadow. Make a property descriptor and define it. Rooted<PropertyDescriptor> newDesc(cx); newDesc.value().set(vp); @@ -2953,28 +2927,28 @@ js::proxy_SetElement(JSContext *cx, Hand return false; return proxy_SetGeneric(cx, obj, id, vp, strict); } bool js::proxy_GetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getOwnPropertyDescriptor(cx, obj, id, &desc, 0)) + if (!Proxy::getOwnPropertyDescriptor(cx, obj, id, &desc)) return false; *attrsp = desc.attributes(); return true; } bool js::proxy_SetGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp) { /* Lookup the current property descriptor so we have setter/getter/value. */ Rooted<PropertyDescriptor> desc(cx); - if (!Proxy::getOwnPropertyDescriptor(cx, obj, id, &desc, 0)) + if (!Proxy::getOwnPropertyDescriptor(cx, obj, id, &desc)) return false; desc.setAttributes(*attrsp); return Proxy::defineProperty(cx, obj, id, &desc); } static bool proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded) {
--- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -173,21 +173,19 @@ class JS_FRIEND_API(BaseProxyHandler) }; 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<JSPropertyDescriptor> desc, - unsigned flags) = 0; + MutableHandle<JSPropertyDescriptor> desc) = 0; virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, - HandleId id, MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) = 0; + HandleId id, MutableHandle<JSPropertyDescriptor> desc) = 0; virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, 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. */ @@ -243,20 +241,19 @@ class JS_FRIEND_API(BaseProxyHandler) class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler { public: explicit DirectProxyHandler(const 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<JSPropertyDescriptor> desc, unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, - HandleId id, MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, 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; @@ -303,22 +300,22 @@ class JS_PUBLIC_API(DirectProxyHandler) * 945826 comment 0. */ 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<JSPropertyDescriptor> desc, unsigned flags); - static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id, + MutableHandle<JSPropertyDescriptor> desc); + static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, MutableHandleValue vp); static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, unsigned flags); - static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id, + MutableHandle<JSPropertyDescriptor> desc); + static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, MutableHandleValue vp); static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, 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);
--- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -225,34 +225,33 @@ CrossCompartmentWrapper::preventExtensio PIERCE(cx, wrapper, NOTHING, Wrapper::preventExtensions(cx, wrapper), NOTHING); } bool CrossCompartmentWrapper::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { RootedId idCopy(cx, id); PIERCE(cx, wrapper, cx->compartment()->wrapId(cx, idCopy.address()), - Wrapper::getPropertyDescriptor(cx, wrapper, idCopy, desc, flags), + Wrapper::getPropertyDescriptor(cx, wrapper, idCopy, desc), cx->compartment()->wrap(cx, desc)); } bool -CrossCompartmentWrapper::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, - HandleId id, MutableHandle<PropertyDescriptor> desc, - unsigned flags) +CrossCompartmentWrapper::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, + MutableHandle<PropertyDescriptor> desc) { RootedId idCopy(cx, id); PIERCE(cx, wrapper, cx->compartment()->wrapId(cx, idCopy.address()), - Wrapper::getOwnPropertyDescriptor(cx, wrapper, idCopy, desc, flags), + Wrapper::getOwnPropertyDescriptor(cx, wrapper, idCopy, desc), cx->compartment()->wrap(cx, desc)); } bool CrossCompartmentWrapper::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandle<PropertyDescriptor> desc) { RootedId idCopy(cx, id); @@ -751,25 +750,25 @@ bool DeadObjectProxy::preventExtensions(JSContext *cx, HandleObject proxy) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_DEAD_OBJECT); return false; } bool DeadObjectProxy::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_DEAD_OBJECT); return false; } bool DeadObjectProxy::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<PropertyDescriptor> desc, unsigned flags) + MutableHandle<PropertyDescriptor> desc) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_DEAD_OBJECT); return false; } bool DeadObjectProxy::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandle<PropertyDescriptor> desc)
--- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -105,21 +105,19 @@ class JS_FRIEND_API(CrossCompartmentWrap public: CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false); virtual ~CrossCompartmentWrapper(); /* ES5 Harmony fundamental wrapper traps. */ virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE; virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, 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. */ @@ -209,21 +207,19 @@ class JS_FRIEND_API(DeadObjectProxy) : p // This variable exists solely to provide a unique address for use as an identifier. static const char 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, 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. */
--- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -3029,17 +3029,17 @@ CopyProperty(JSContext *cx, HandleObject desc.setAttributes(shape->attributes()); desc.setGetter(shape->getter()); if (!desc.getter() && !desc.hasGetterObject()) desc.setGetter(JS_PropertyStub); desc.setSetter(shape->setter()); if (!desc.setter() && !desc.hasSetterObject()) desc.setSetter(JS_StrictPropertyStub); } else if (referent->is<ProxyObject>()) { - if (!Proxy::getOwnPropertyDescriptor(cx, referent, id, &desc, 0)) + if (!Proxy::getOwnPropertyDescriptor(cx, referent, id, &desc)) return false; if (!desc.object()) return true; } else { if (!JSObject::lookupGeneric(cx, referent, id, objp, &shape)) return false; if (objp != referent) return true;
--- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -1320,25 +1320,23 @@ class DebugScopeProxy : public BaseProxy bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE { // See above. JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE + MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE { - return getOwnPropertyDescriptor(cx, proxy, id, desc, flags); + return getOwnPropertyDescriptor(cx, proxy, id, desc); } bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, - MutableHandle<PropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE + MutableHandle<PropertyDescriptor> desc) MOZ_OVERRIDE { Rooted<DebugScopeObject*> debugScope(cx, &proxy->as<DebugScopeObject>()); Rooted<ScopeObject*> scope(cx, &debugScope->scope()); RootedArgumentsObject maybeArgsObj(cx); if (!checkForMissingArguments(cx, id, *scope, maybeArgsObj.address())) return false; @@ -1356,17 +1354,17 @@ class DebugScopeProxy : public BaseProxy desc.object().set(debugScope); desc.setAttributes(JSPROP_READONLY | JSPROP_ENUMERATE | JSPROP_PERMANENT); desc.value().set(v); desc.setGetter(nullptr); desc.setSetter(nullptr); return true; } - return JS_GetOwnPropertyDescriptorById(cx, scope, id, flags, desc); + return JS_GetOwnPropertyDescriptorById(cx, scope, id, desc); } bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, MutableHandleValue vp) MOZ_OVERRIDE { Rooted<DebugScopeObject*> debugScope(cx, &proxy->as<DebugScopeObject>()); Rooted<ScopeObject*> scope(cx, &proxy->as<DebugScopeObject>().scope());
--- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -852,24 +852,22 @@ 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<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { JS::RootedObject obj(cx, wrappedObject(proxy)); MOZ_ASSERT(js::GetObjectCompartment(obj) == js::GetObjectCompartment(proxy)); - if (!JS_GetPropertyDescriptorById(cx, obj, id, - flags, desc)) + if (!JS_GetPropertyDescriptorById(cx, obj, id, desc)) return false; if (!desc.object()) return true; // No property, nothing to do // Now fix up the getter/setter/value as needed to be bound to desc->obj // Don't mess with holder_get and holder_set, though, because those rely on // the "vp is prefilled with the value in the slot" behavior that property @@ -900,20 +898,19 @@ xpc::SandboxProxyHandler::getPropertyDes return true; } bool xpc::SandboxProxyHandler::getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { - if (!getPropertyDescriptor(cx, proxy, id, desc, flags)) + if (!getPropertyDescriptor(cx, proxy, id, desc)) return false; if (desc.object() != wrappedObject(proxy)) desc.object().set(nullptr); return true; }
--- a/js/xpconnect/wrappers/AccessCheck.cpp +++ b/js/xpconnect/wrappers/AccessCheck.cpp @@ -292,17 +292,17 @@ ExposedPropertiesOnly::check(JSContext * if (!AccessCheck::subsumes(js::UncheckedUnwrap(hallpass), wrappedObject)) { EnterAndThrow(cx, wrapper, "Invalid __exposedProps__"); return false; } Access access = NO_ACCESS; Rooted<JSPropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, hallpass, id, 0, &desc)) { + if (!JS_GetPropertyDescriptorById(cx, hallpass, id, &desc)) { return false; // Error } if (!desc.object() || !desc.isEnumerable()) return false; if (!desc.value().isString()) { EnterAndThrow(cx, wrapper, "property must be a string"); return false;
--- a/js/xpconnect/wrappers/ChromeObjectWrapper.cpp +++ b/js/xpconnect/wrappers/ChromeObjectWrapper.cpp @@ -47,37 +47,36 @@ static bool PropIsFromStandardPrototype(JSContext *cx, HandleObject wrapper, HandleId id) { MOZ_ASSERT(js::Wrapper::wrapperHandler(wrapper) == &ChromeObjectWrapper::singleton); Rooted<JSPropertyDescriptor> desc(cx); ChromeObjectWrapper *handler = &ChromeObjectWrapper::singleton; if (!handler->ChromeObjectWrapperBase::getPropertyDescriptor(cx, wrapper, id, - &desc, 0) || + &desc) || !desc.object()) { return false; } return PropIsFromStandardPrototype(cx, &desc); } bool ChromeObjectWrapper::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, GET | SET); // First, try a lookup on the base wrapper if permitted. desc.object().set(nullptr); if (AllowedByBase(cx, wrapper, id, Wrapper::GET) && !ChromeObjectWrapperBase::getPropertyDescriptor(cx, wrapper, id, - desc, flags)) { + desc)) { return false; } // If the property is something that can be found on a standard prototype, // prefer the one we'll get via the prototype chain in the content // compartment. if (desc.object() && PropIsFromStandardPrototype(cx, desc)) desc.object().set(nullptr); @@ -86,17 +85,17 @@ ChromeObjectWrapper::getPropertyDescript RootedObject wrapperProto(cx); if (!JS_GetPrototype(cx, wrapper, &wrapperProto)) return false; if (desc.object() || !wrapperProto) return true; // If not, try doing the lookup on the prototype. MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); - return JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, desc); + return JS_GetPropertyDescriptorById(cx, wrapperProto, id, desc); } bool ChromeObjectWrapper::has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) { assertEnteredPolicy(cx, wrapper, id, GET); // Try the lookup on the base wrapper if permitted. @@ -111,17 +110,17 @@ ChromeObjectWrapper::has(JSContext *cx, if (!JS_GetPrototype(cx, wrapper, &wrapperProto)) return false; if (*bp || !wrapperProto) return true; // Try the prototype if that failed. MOZ_ASSERT(js::IsObjectInContextCompartment(wrapper, cx)); Rooted<JSPropertyDescriptor> desc(cx); - if (!JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, &desc)) + if (!JS_GetPropertyDescriptorById(cx, wrapperProto, id, &desc)) return false; *bp = !!desc.object(); return true; } bool ChromeObjectWrapper::get(JSContext *cx, HandleObject wrapper, HandleObject receiver, HandleId id,
--- a/js/xpconnect/wrappers/ChromeObjectWrapper.h +++ b/js/xpconnect/wrappers/ChromeObjectWrapper.h @@ -27,18 +27,17 @@ struct ExposedPropertiesOnly; 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) 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 @@ -55,34 +55,32 @@ FilterSetter(JSContext *cx, JSObject *wr } return true; } template <typename Base, typename Policy> bool FilteringWrapper<Base, Policy>::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET); - if (!Base::getPropertyDescriptor(cx, wrapper, id, desc, flags)) + if (!Base::getPropertyDescriptor(cx, wrapper, id, desc)) 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<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET); - if (!Base::getOwnPropertyDescriptor(cx, wrapper, id, desc, flags)) + if (!Base::getOwnPropertyDescriptor(cx, wrapper, id, desc)) return false; return FilterSetter<Policy>(cx, wrapper, id, desc); } template <typename Base, typename Policy> bool FilteringWrapper<Base, Policy>::getOwnPropertyNames(JSContext *cx, HandleObject wrapper, AutoIdVector &props)
--- a/js/xpconnect/wrappers/FilteringWrapper.h +++ b/js/xpconnect/wrappers/FilteringWrapper.h @@ -23,22 +23,20 @@ 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) 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, JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp +++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp @@ -37,29 +37,27 @@ WaiveXrayWrapper::WaiveXrayWrapper(unsig } WaiveXrayWrapper::~WaiveXrayWrapper() { } bool WaiveXrayWrapper::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, - HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc) { - return CrossCompartmentWrapper::getPropertyDescriptor(cx, wrapper, id, desc, flags) && + return CrossCompartmentWrapper::getPropertyDescriptor(cx, wrapper, id, desc) && WrapperFactory::WaiveXrayAndWrap(cx, desc.value()) && WaiveAccessors(cx, desc); } bool WaiveXrayWrapper::getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, - HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc) { - return CrossCompartmentWrapper::getOwnPropertyDescriptor(cx, wrapper, id, desc, flags) && + return CrossCompartmentWrapper::getOwnPropertyDescriptor(cx, wrapper, id, desc) && WrapperFactory::WaiveXrayAndWrap(cx, desc.value()) && WaiveAccessors(cx, desc); } bool WaiveXrayWrapper::get(JSContext *cx, HandleObject wrapper, HandleObject receiver, HandleId id, MutableHandleValue vp) {
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.h +++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h @@ -16,22 +16,20 @@ 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) 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 @@ -410,17 +410,17 @@ JSXrayTraits::resolveOwnProperty(JSConte if (!isPrototype(holder)) return true; // The non-HasPrototypes semantics implemented by traditional Xrays are kind // of broken with respect to |own|-ness and the holder. The common code // muddles through by only checking the holder for non-|own| lookups, but // that doesn't work for us. So we do an explicit holder check here, and hope // that this mess gets fixed up soon. - if (!JS_GetPropertyDescriptorById(cx, holder, id, 0, desc)) + if (!JS_GetPropertyDescriptorById(cx, holder, id, desc)) return false; if (desc.object()) { desc.object().set(wrapper); return true; } // Grab the JSClass. We require all Xrayable classes to have a ClassSpec. RootedObject target(cx, getTargetObject(wrapper)); @@ -477,17 +477,17 @@ JSXrayTraits::resolveOwnProperty(JSConte // The generic Xray machinery only defines non-own properties on the holder. // This is broken, and will be fixed at some point, but for now we need to // cache the value explicitly. See the corresponding call to // JS_GetPropertyById at the top of this function. return JS_DefinePropertyById(cx, holder, id, ObjectValue(*JS_GetFunctionObject(fun)), nullptr, nullptr, 0) && - JS_GetPropertyDescriptorById(cx, holder, id, 0, desc); + JS_GetPropertyDescriptorById(cx, holder, id, desc); } bool JSXrayTraits::enumerateNames(JSContext *cx, HandleObject wrapper, unsigned flags, AutoIdVector &props) { RootedObject holder(cx, ensureHolder(cx, wrapper)); if (!holder) @@ -947,17 +947,17 @@ XPCWrappedNativeXrayTraits::resolveDOMCo nsresult rv = wn->GetScriptableInfo()->GetCallback()->NewResolve(wn, cx, wrapper, id, flags, pobj.address(), &retval); if (NS_FAILED(rv)) { if (retval) XPCThrower::Throw(rv, cx); return false; } - if (pobj && !JS_GetPropertyDescriptorById(cx, holder, id, 0, desc)) + if (pobj && !JS_GetPropertyDescriptorById(cx, holder, id, desc)) return false; return true; } static nsGlobalWindow* AsWindow(JSContext *cx, JSObject *wrapper) { @@ -1133,17 +1133,17 @@ XrayTraits::resolveOwnProperty(JSContext 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. bool found = false; if (expando) { JSAutoCompartment ac(cx, expando); - if (!JS_GetPropertyDescriptorById(cx, expando, id, 0, desc)) + if (!JS_GetPropertyDescriptorById(cx, expando, id, desc)) return false; found = !!desc.object(); } // Next, check for ES builtins. if (!found && JS_IsGlobalObject(target)) { JSProtoKey key = JS_IdToProtoKey(cx, id); JSAutoCompartment ac(cx, target); @@ -1179,17 +1179,17 @@ XrayTraits::resolveOwnProperty(JSContext { if (!JS_AlreadyHasOwnPropertyById(cx, holder, id, &found)) return false; if (!found && !JS_DefinePropertyById(cx, holder, id, UndefinedValue(), wrappedJSObject_getter, nullptr, JSPROP_ENUMERATE | JSPROP_SHARED)) { return false; } - if (!JS_GetPropertyDescriptorById(cx, holder, id, 0, desc)) + if (!JS_GetPropertyDescriptorById(cx, holder, id, desc)) return false; desc.object().set(wrapper); return true; } return true; } @@ -1275,17 +1275,17 @@ XPCWrappedNativeXrayTraits::resolveOwnPr // we have to use it. But we have no way of knowing if it corresponded to an // |own| or non-|own| property, since both get cached on the holder and the // |own|-ness information is lost. // // So we just over-zealously call things |own| here. This can cause us to // 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); + return JS_GetPropertyDescriptorById(cx, holder, id, desc); } bool XPCWrappedNativeXrayTraits::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandle<JSPropertyDescriptor> desc, Handle<JSPropertyDescriptor> existingDesc, bool *defined) { *defined = false; @@ -1773,18 +1773,17 @@ XrayWrapper<Base, Traits>::preventExtens // See above. JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } template <typename Base, typename Traits> bool XrayWrapper<Base, Traits>::getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET); RootedObject holder(cx, Traits::singleton.ensureHolder(cx, wrapper)); if (Traits::isResolving(cx, holder, id)) { desc.object().set(nullptr); return true; } @@ -1808,29 +1807,29 @@ XrayWrapper<Base, Traits>::getPropertyDe // supposed to be dynamic. This means that we have to first check the result // of resolveOwnProperty, and _then_, if that comes up blank, check the // holder for any cached native properties. // // Finally, we call resolveNativeProperty, which checks non-own properties, // and unconditionally caches what it finds on the holder. // Check resolveOwnProperty. - if (!Traits::singleton.resolveOwnProperty(cx, *this, wrapper, holder, id, desc, flags)) + if (!Traits::singleton.resolveOwnProperty(cx, *this, wrapper, holder, id, desc, 0)) return false; // Check the holder. - if (!desc.object() && !JS_GetPropertyDescriptorById(cx, holder, id, 0, desc)) + if (!desc.object() && !JS_GetPropertyDescriptorById(cx, holder, id, desc)) return false; if (desc.object()) { desc.object().set(wrapper); return true; } // Nothing in the cache. Call through, and cache the result. - if (!Traits::singleton.resolveNativeProperty(cx, wrapper, holder, id, desc, flags)) + if (!Traits::singleton.resolveNativeProperty(cx, wrapper, holder, id, desc, 0)) return false; // We need to handle named access on the Window somewhere other than // Traits::resolveOwnProperty, because per spec it happens on the Global // Scope Polluter and thus the resulting properties are non-|own|. However, // we're set up (above) to cache (on the holder) anything that comes out of // resolveNativeProperty, which we don't want for something dynamic like // named access. So we just handle it separately here. @@ -1892,44 +1891,43 @@ XrayWrapper<Base, Traits>::getPropertyDe } // If we still have nothing, we're done. if (!desc.object()) return true; if (!JS_DefinePropertyById(cx, holder, id, desc.value(), desc.getter(), desc.setter(), desc.attributes()) || - !JS_GetPropertyDescriptorById(cx, holder, id, flags, desc)) + !JS_GetPropertyDescriptorById(cx, holder, id, desc)) { return false; } 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<JSPropertyDescriptor> desc, - unsigned flags) + JS::MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::GET | BaseProxyHandler::SET); RootedObject holder(cx, Traits::singleton.ensureHolder(cx, wrapper)); if (Traits::isResolving(cx, holder, id)) { desc.object().set(nullptr); return true; } typename Traits::ResolvingIdImpl resolving(cx, wrapper, id); // NB: Nothing we do here acts on the wrapped native itself, so we don't // enter our policy. - if (!Traits::singleton.resolveOwnProperty(cx, *this, wrapper, holder, id, desc, flags)) + if (!Traits::singleton.resolveOwnProperty(cx, *this, wrapper, holder, id, desc, 0)) return false; if (desc.object()) desc.object().set(wrapper); return true; } // Consider what happens when chrome does |xray.expando = xray.wrappedJSObject|. // @@ -1991,17 +1989,17 @@ RecreateLostWaivers(JSContext *cx, JSPro template <typename Base, typename Traits> bool XrayWrapper<Base, Traits>::defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, MutableHandle<JSPropertyDescriptor> desc) { assertEnteredPolicy(cx, wrapper, id, BaseProxyHandler::SET); Rooted<JSPropertyDescriptor> existing_desc(cx); - if (!getOwnPropertyDescriptor(cx, wrapper, id, &existing_desc, 0)) + if (!getOwnPropertyDescriptor(cx, wrapper, id, &existing_desc)) 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)) return false;
--- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -68,20 +68,19 @@ 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<JSPropertyDescriptor> desc, unsigned flags); + JS::MutableHandle<JSPropertyDescriptor> desc); virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags); + JS::MutableHandle<JSPropertyDescriptor> desc); virtual bool defineProperty(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, 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); @@ -151,22 +150,20 @@ 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<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::MutableHandle<JSPropertyDescriptor> desc, - unsigned flags) MOZ_OVERRIDE; + JS::MutableHandle<JSPropertyDescriptor> desc) 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; virtual bool get(JSContext *cx, JS::Handle<JSObject*> proxy, JS::Handle<JSObject*> receiver,