mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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.
This commit is contained in:
parent
a0c502261d
commit
89efccc426
7 changed files with 224 additions and 115 deletions
|
@ -22,7 +22,7 @@ use js::jsapi::{Handle, HandleId, HandleObject, HandleValue, JSAutoCompartment};
|
|||
use js::jsapi::{JSContext, JSPROP_READONLY, JSErrNum, JSObject, PropertyDescriptor, JS_DefinePropertyById};
|
||||
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass, JSTracer, FreeOp};
|
||||
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, MutableHandle};
|
||||
use js::jsapi::{MutableHandleValue, ObjectOpResult};
|
||||
use js::jsapi::{MutableHandleObject, MutableHandleValue, ObjectOpResult};
|
||||
use js::jsval::{UndefinedValue, PrivateValue};
|
||||
use msg::constellation_msg::{PipelineId, SubpageId};
|
||||
use std::cell::Cell;
|
||||
|
@ -354,6 +354,28 @@ unsafe extern "C" fn set(cx: *mut JSContext,
|
|||
res)
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe extern "C" fn get_prototype_if_ordinary(_: *mut JSContext,
|
||||
_: HandleObject,
|
||||
is_ordinary: *mut bool,
|
||||
_: MutableHandleObject)
|
||||
-> bool {
|
||||
// Window's [[GetPrototypeOf]] trap isn't the ordinary definition:
|
||||
//
|
||||
// https://html.spec.whatwg.org/multipage/#windowproxy-getprototypeof
|
||||
//
|
||||
// We nonetheless can implement it with a static [[Prototype]], because
|
||||
// wrapper-class handlers (particularly, XOW in FilteringWrapper.cpp) supply
|
||||
// all non-ordinary behavior.
|
||||
//
|
||||
// But from a spec point of view, it's the exact same object in both cases --
|
||||
// only the observer's changed. So this getPrototypeIfOrdinary trap on the
|
||||
// non-wrapper object *must* report non-ordinary, even if static [[Prototype]]
|
||||
// usually means ordinary.
|
||||
*is_ordinary = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
||||
enter: None,
|
||||
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
|
||||
|
@ -361,6 +383,7 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
|||
ownPropertyKeys: None,
|
||||
delete_: None,
|
||||
enumerate: None,
|
||||
getPrototypeIfOrdinary: Some(get_prototype_if_ordinary),
|
||||
preventExtensions: None,
|
||||
isExtensible: None,
|
||||
has: Some(has),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue