mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
auto merge of #2295 : Ms2ger/servo/JSCLASS_DOM_GLOBAL, r=jdm
It seems unlikely that this will ever be hit, but potentially hard to figure out if it ever is hit.
This commit is contained in:
commit
812d70942f
2 changed files with 5 additions and 7 deletions
|
@ -1444,7 +1444,7 @@ class CGDOMJSClass(CGThing):
|
||||||
def define(self):
|
def define(self):
|
||||||
traceHook = "Some(%s)" % TRACE_HOOK_NAME
|
traceHook = "Some(%s)" % TRACE_HOOK_NAME
|
||||||
if self.descriptor.createGlobal:
|
if self.descriptor.createGlobal:
|
||||||
flags = "JSCLASS_IS_GLOBAL"
|
flags = "JSCLASS_IS_GLOBAL | JSCLASS_DOM_GLOBAL"
|
||||||
slots = "JSCLASS_GLOBAL_SLOT_COUNT + 1"
|
slots = "JSCLASS_GLOBAL_SLOT_COUNT + 1"
|
||||||
else:
|
else:
|
||||||
flags = "0"
|
flags = "0"
|
||||||
|
@ -2024,10 +2024,8 @@ class CGGetPerInterfaceObject(CGAbstractMethod):
|
||||||
wrapper and aGlobal is the sandbox's global.
|
wrapper and aGlobal is the sandbox's global.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Make sure our global is sane. Hopefully we can remove this sometime */
|
assert!(((*JS_GetClass(aGlobal)).flags & JSCLASS_DOM_GLOBAL) != 0);
|
||||||
/*if ((*JS_GetClass(aGlobal)).flags & JSCLASS_DOM_GLOBAL) == 0 {
|
|
||||||
return ptr::null();
|
|
||||||
}*/
|
|
||||||
/* Check to see whether the interface objects are already installed */
|
/* Check to see whether the interface objects are already installed */
|
||||||
let protoOrIfaceArray: *mut *JSObject = GetProtoOrIfaceArray(aGlobal) as *mut *JSObject;
|
let protoOrIfaceArray: *mut *JSObject = GetProtoOrIfaceArray(aGlobal) as *mut *JSObject;
|
||||||
let cachedObject: *JSObject = *protoOrIfaceArray.offset(%s as int);
|
let cachedObject: *JSObject = *protoOrIfaceArray.offset(%s as int);
|
||||||
|
@ -4272,7 +4270,7 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::bindings::utils::{CreateDOMGlobal, CreateInterfaceObjects2}',
|
'dom::bindings::utils::{CreateDOMGlobal, CreateInterfaceObjects2}',
|
||||||
'dom::bindings::utils::{ConstantSpec, cx_for_dom_object, Default}',
|
'dom::bindings::utils::{ConstantSpec, cx_for_dom_object, Default}',
|
||||||
'dom::bindings::utils::{dom_object_slot, DOM_OBJECT_SLOT, DOMClass}',
|
'dom::bindings::utils::{dom_object_slot, DOM_OBJECT_SLOT, DOMClass}',
|
||||||
'dom::bindings::utils::{DOMJSClass}',
|
'dom::bindings::utils::{DOMJSClass, JSCLASS_DOM_GLOBAL}',
|
||||||
'dom::bindings::utils::{FindEnumStringIndex, GetArrayIndexFromId}',
|
'dom::bindings::utils::{FindEnumStringIndex, GetArrayIndexFromId}',
|
||||||
'dom::bindings::utils::{GetPropertyOnPrototype, GetProtoOrIfaceArray}',
|
'dom::bindings::utils::{GetPropertyOnPrototype, GetProtoOrIfaceArray}',
|
||||||
'dom::bindings::utils::{HasPropertyOnPrototype, IntVal}',
|
'dom::bindings::utils::{HasPropertyOnPrototype, IntVal}',
|
||||||
|
|
|
@ -207,7 +207,7 @@ pub struct DOMJSClass {
|
||||||
|
|
||||||
pub fn GetProtoOrIfaceArray(global: *JSObject) -> **JSObject {
|
pub fn GetProtoOrIfaceArray(global: *JSObject) -> **JSObject {
|
||||||
unsafe {
|
unsafe {
|
||||||
/*assert ((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0;*/
|
assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
|
||||||
JS_GetReservedSlot(global, DOM_PROTOTYPE_SLOT).to_private() as **JSObject
|
JS_GetReservedSlot(global, DOM_PROTOTYPE_SLOT).to_private() as **JSObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue