mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Assert that we're handed a DOM global in initialize_global.
This commit is contained in:
parent
69c49bb764
commit
692d4e847d
1 changed files with 2 additions and 0 deletions
|
@ -410,9 +410,11 @@ pub extern fn ThrowingConstructor(_cx: *mut JSContext, _argc: c_uint, _vp: *mut
|
|||
}
|
||||
|
||||
/// Construct and cache the ProtoOrIfaceArray for the given global.
|
||||
/// Fails if the argument is not a DOM global.
|
||||
pub fn initialize_global(global: *mut JSObject) {
|
||||
let protoArray = box () ([0 as *mut JSObject, ..PrototypeList::id::IDCount as uint]);
|
||||
unsafe {
|
||||
assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
|
||||
let box_ = squirrel_away_unique(protoArray);
|
||||
JS_SetReservedSlot(global,
|
||||
DOM_PROTOTYPE_SLOT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue