diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-28 06:58:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-28 06:58:59 -0500 |
commit | 5ae1fcd6fe35f942f1cb29fd0efdc9c2de393ee6 (patch) | |
tree | a9958e813191fe93abb9552644ea06a1ffd24069 /components/script/dom/bindings/proxyhandler.rs | |
parent | 45209b7ffea7b2355e227719ed29cb6aa6f00e0f (diff) | |
parent | 89efccc4267706eec8d1cd32043bb25d7f37f9b2 (diff) | |
download | servo-5ae1fcd6fe35f942f1cb29fd0efdc9c2de393ee6.tar.gz servo-5ae1fcd6fe35f942f1cb29fd0efdc9c2de393ee6.zip |
Auto merge of #12255 - servo:smup, r=jdm
Update SpiderMonkey to m-c bcf4ff0c3eef.
This currently breaks Servo on Android, because there are a number of interdependent changes that cannot easily land serially in a way that keeps it working throughout. We expect to fix this in the near future.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12255)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/proxyhandler.rs')
-rw-r--r-- | components/script/dom/bindings/proxyhandler.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/components/script/dom/bindings/proxyhandler.rs b/components/script/dom/bindings/proxyhandler.rs index 9db30d8835c..c863cc31994 100644 --- a/components/script/dom/bindings/proxyhandler.rs +++ b/components/script/dom/bindings/proxyhandler.rs @@ -12,7 +12,9 @@ use js::glue::GetProxyExtra; use js::glue::InvokeGetOwnPropertyDescriptor; use js::glue::{GetProxyHandler, SetProxyExtra}; use js::jsapi::GetObjectProto; +use js::jsapi::GetStaticPrototype; use js::jsapi::JS_GetPropertyDescriptorById; +use js::jsapi::MutableHandleObject; use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult}; use js::jsapi::{JSContext, JSObject, JSPROP_GETTER, PropertyDescriptor}; use js::jsapi::{JSErrNum, JS_StrictPropertyStub}; @@ -103,6 +105,25 @@ pub unsafe extern "C" fn is_extensible(_cx: *mut JSContext, true } +/// If `proxy` (underneath any functionally-transparent wrapper proxies) has as +/// its `[[GetPrototypeOf]]` trap the ordinary `[[GetPrototypeOf]]` behavior +/// defined for ordinary objects, set `*is_ordinary` to true and store `obj`'s +/// prototype in `proto`. Otherwise set `*isOrdinary` to false. In case of +/// error, both outparams have unspecified value. +/// +/// This implementation always handles the case of the ordinary +/// `[[GetPrototypeOf]]` behavior. An alternative implementation will be +/// necessary for the Location object. +pub unsafe extern "C" fn get_prototype_if_ordinary(_: *mut JSContext, + proxy: HandleObject, + is_ordinary: *mut bool, + proto: MutableHandleObject) + -> bool { + *is_ordinary = true; + proto.set(GetStaticPrototype(proxy.get())); + true +} + /// Get the expando object, or null if there is none. pub fn get_expando_object(obj: HandleObject) -> *mut JSObject { unsafe { |