mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-10 19:41:25 +00:00
Enable structural mode for all operations if there is a Global extended attribute on the interface
This commit is contained in:
committed by
Alex Crichton
parent
90579416cf
commit
ebab7d9fc8
4
crates/web-sys/webidls/enabled/Window.webidl
vendored
4
crates/web-sys/webidls/enabled/Window.webidl
vendored
@ -25,7 +25,9 @@
|
||||
// interface XULControllers;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/
|
||||
[PrimaryGlobal, LegacyUnenumerableNamedProperties, NeedResolve]
|
||||
[Global=Window,
|
||||
Exposed=Window,
|
||||
LegacyUnenumerableNamedProperties]
|
||||
/*sealed*/ interface Window : EventTarget {
|
||||
// the current browsing context
|
||||
[Unforgeable, Constant, StoreInSlot,
|
||||
|
@ -32,6 +32,7 @@ pub(crate) struct InterfaceData {
|
||||
/// Whether only partial interfaces were encountered
|
||||
pub(crate) partial: bool,
|
||||
pub(crate) operations: BTreeMap<OperationId, OperationData>,
|
||||
pub(crate) global: bool,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
@ -185,6 +186,7 @@ impl FirstPass<()> for webidl::ast::NonPartialInterface {
|
||||
InterfaceData {
|
||||
partial: false,
|
||||
operations: Default::default(),
|
||||
global: false,
|
||||
},
|
||||
);
|
||||
|
||||
@ -213,6 +215,7 @@ impl FirstPass<()> for webidl::ast::PartialInterface {
|
||||
InterfaceData {
|
||||
partial: true,
|
||||
operations: Default::default(),
|
||||
global: false,
|
||||
},
|
||||
);
|
||||
|
||||
@ -269,6 +272,17 @@ impl<'b> FirstPass<&'b str> for webidl::ast::ExtendedAttribute {
|
||||
&rhs_arguments,
|
||||
)
|
||||
},
|
||||
webidl::ast::ExtendedAttribute::Identifier(
|
||||
webidl::ast::IdentifierExtendedAttribute { lhs, .. }
|
||||
)
|
||||
| webidl::ast::ExtendedAttribute::IdentifierList(
|
||||
webidl::ast::IdentifierListExtendedAttribute { lhs, .. }
|
||||
)
|
||||
if lhs == "Global" =>
|
||||
{
|
||||
record.interfaces.get_mut(self_name).unwrap().global = true;
|
||||
Ok(())
|
||||
}
|
||||
_ => Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -656,7 +656,11 @@ impl<'a> FirstPassRecord<'a> {
|
||||
.map(|arg| (&*arg.name, &*arg.type_, arg.variadic)),
|
||||
ret,
|
||||
kind,
|
||||
false,
|
||||
self
|
||||
.interfaces
|
||||
.get(self_name)
|
||||
.map(|interface_data| interface_data.global)
|
||||
.unwrap_or(false),
|
||||
catch,
|
||||
doc_comment,
|
||||
)
|
||||
|
Reference in New Issue
Block a user