mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
parent
c064c4950d
commit
d678b20616
4 changed files with 54 additions and 16 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
//! Machinery to initialise interface prototype objects and interface objects.
|
||||
|
||||
use dom::bindings::codegen::InterfaceObjectMap::Globals;
|
||||
use dom::bindings::codegen::PrototypeList;
|
||||
use dom::bindings::conversions::get_dom_class;
|
||||
use dom::bindings::guard::Guard;
|
||||
|
@ -484,3 +485,11 @@ unsafe extern "C" fn non_new_constructor(
|
|||
throw_type_error(cx, "This constructor needs to be called with `new`.");
|
||||
false
|
||||
}
|
||||
|
||||
/// Returns whether an interface with exposure set given by `globals` should
|
||||
/// be exposed in the global object `obj`.
|
||||
pub unsafe fn is_exposed_in(object: HandleObject, globals: Globals) -> bool {
|
||||
let unwrapped = UncheckedUnwrapObject(object.get(), /* stopAtWindowProxy = */ 0);
|
||||
let dom_class = get_dom_class(unwrapped).unwrap();
|
||||
globals.contains(dom_class.global)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue