mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #13062 - nox:bump-js, r=nox
Make DOMJSClass use JSClass instead of Class (fixes #13031) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13062) <!-- Reviewable:end -->
This commit is contained in:
commit
fe1225b4ba
5 changed files with 19 additions and 19 deletions
|
@ -1995,7 +1995,7 @@ class CGDOMJSClass(CGThing):
|
|||
elif self.descriptor.weakReferenceable:
|
||||
args["slots"] = "2"
|
||||
return """\
|
||||
static CLASS_OPS: js::jsapi::ClassOps = js::jsapi::ClassOps {
|
||||
static CLASS_OPS: js::jsapi::JSClassOps = js::jsapi::JSClassOps {
|
||||
addProperty: None,
|
||||
delProperty: None,
|
||||
getProperty: None,
|
||||
|
@ -2011,15 +2011,13 @@ static CLASS_OPS: js::jsapi::ClassOps = js::jsapi::ClassOps {
|
|||
};
|
||||
|
||||
static Class: DOMJSClass = DOMJSClass {
|
||||
base: js::jsapi::Class {
|
||||
base: js::jsapi::JSClass {
|
||||
name: %(name)s as *const u8 as *const libc::c_char,
|
||||
flags: JSCLASS_IS_DOMJSCLASS | %(flags)s |
|
||||
(((%(slots)s) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
|
||||
/* JSCLASS_HAS_RESERVED_SLOTS(%(slots)s) */,
|
||||
cOps: &CLASS_OPS,
|
||||
spec: ptr::null(),
|
||||
ext: ptr::null(),
|
||||
oOps: ptr::null(),
|
||||
reserved: [0 as *mut _; 3],
|
||||
},
|
||||
dom_class: %(domClass)s
|
||||
};""" % args
|
||||
|
@ -2391,7 +2389,7 @@ rooted!(in(cx) let obj = obj);\
|
|||
""" % (descriptor.name, parent)
|
||||
else:
|
||||
create += ("rooted!(in(cx) let obj = JS_NewObjectWithGivenProto(\n"
|
||||
" cx, &Class.base as *const js::jsapi::Class as *const JSClass, proto.handle()));\n"
|
||||
" cx, &Class.base as *const JSClass, proto.handle()));\n"
|
||||
"assert!(!obj.is_null());\n"
|
||||
"\n"
|
||||
"JS_SetReservedSlot(obj.get(), DOM_OBJECT_SLOT,\n"
|
||||
|
@ -2530,7 +2528,7 @@ let _rt = RootedTraceable::new(&*raw);
|
|||
rooted!(in(cx) let mut obj = ptr::null_mut());
|
||||
create_global_object(
|
||||
cx,
|
||||
&*(&Class.base as *const js::jsapi::Class as *const _),
|
||||
&Class.base,
|
||||
raw as *const libc::c_void,
|
||||
_trace,
|
||||
obj.handle_mut());
|
||||
|
@ -2842,7 +2840,7 @@ assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
|
|||
holderClass = "ptr::null()"
|
||||
holderProto = "HandleObject::null()"
|
||||
else:
|
||||
holderClass = "&Class.base as *const js::jsapi::Class as *const JSClass"
|
||||
holderClass = "&Class.base as *const JSClass"
|
||||
holderProto = "prototype.handle()"
|
||||
code.append(CGGeneric("""
|
||||
rooted!(in(cx) let mut unforgeable_holder = ptr::null_mut());
|
||||
|
@ -5205,7 +5203,7 @@ class CGClassFinalizeHook(CGAbstractClassHook):
|
|||
A hook for finalize, used to release our native object.
|
||||
"""
|
||||
def __init__(self, descriptor):
|
||||
args = [Argument('*mut FreeOp', '_fop'), Argument('*mut JSObject', 'obj')]
|
||||
args = [Argument('*mut JSFreeOp', '_fop'), Argument('*mut JSObject', 'obj')]
|
||||
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
|
||||
'void', args)
|
||||
|
||||
|
@ -5326,7 +5324,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
|||
'js::{JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT}',
|
||||
'js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL, JSCLASS_RESERVED_SLOTS_MASK}',
|
||||
'js::error::throw_type_error',
|
||||
'js::jsapi::{AutoIdVector, Call, CallArgs, FreeOp, GetPropertyKeys}',
|
||||
'js::jsapi::{AutoIdVector, Call, CallArgs, GetPropertyKeys}',
|
||||
'js::jsapi::{GetWellKnownSymbol, Handle, HandleId, HandleObject, HandleValue}',
|
||||
'js::jsapi::{HandleValueArray, INTERNED_STRING_TO_JSID, IsCallable}',
|
||||
'js::jsapi::{JS_AtomizeAndPinString, JS_CallFunctionValue, JS_CopyPropertiesFrom}',
|
||||
|
|
|
@ -100,7 +100,7 @@ unsafe impl Sync for DOMClass {}
|
|||
#[derive(Copy)]
|
||||
pub struct DOMJSClass {
|
||||
/// The actual JSClass.
|
||||
pub base: js::jsapi::Class,
|
||||
pub base: js::jsapi::JSClass,
|
||||
/// Associated data for DOM object reflectors.
|
||||
pub dom_class: DOMClass,
|
||||
}
|
||||
|
|
|
@ -18,11 +18,13 @@ use dom::window::Window;
|
|||
use js::JSCLASS_IS_GLOBAL;
|
||||
use js::glue::{CreateWrapperProxyHandler, ProxyTraps, NewWindowProxy};
|
||||
use js::glue::{GetProxyPrivate, SetProxyExtra, GetProxyExtra};
|
||||
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::{MutableHandleObject, MutableHandleValue, ObjectOpResult};
|
||||
use js::jsapi::{Handle, HandleId, HandleObject, HandleValue};
|
||||
use js::jsapi::{JSAutoCompartment, JSContext, JSErrNum, JSFreeOp, JSObject};
|
||||
use js::jsapi::{JSPROP_READONLY, JSTracer, JS_DefinePropertyById};
|
||||
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass};
|
||||
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById};
|
||||
use js::jsapi::{MutableHandle, MutableHandleObject, MutableHandleValue};
|
||||
use js::jsapi::{ObjectOpResult, PropertyDescriptor};
|
||||
use js::jsval::{UndefinedValue, PrivateValue};
|
||||
use msg::constellation_msg::{PipelineId, SubpageId};
|
||||
use std::cell::Cell;
|
||||
|
@ -409,7 +411,7 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps {
|
|||
};
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe extern fn finalize(_fop: *mut FreeOp, obj: *mut JSObject) {
|
||||
unsafe extern fn finalize(_fop: *mut JSFreeOp, obj: *mut JSObject) {
|
||||
let this = GetProxyExtra(obj, 0).to_private() as *mut BrowsingContext;
|
||||
assert!(!this.is_null());
|
||||
let _ = Box::from_raw(this);
|
||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -1086,7 +1086,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "js"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#a4a693bf41fc67e839f3a5e8219d872f5c675b5f"
|
||||
source = "git+https://github.com/servo/rust-mozjs#9a200eab19b0035a0a1634ef527058be4738a0f6"
|
||||
dependencies = [
|
||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -994,7 +994,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "js"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/servo/rust-mozjs#a4a693bf41fc67e839f3a5e8219d872f5c675b5f"
|
||||
source = "git+https://github.com/servo/rust-mozjs#9a200eab19b0035a0a1634ef527058be4738a0f6"
|
||||
dependencies = [
|
||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue