mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +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;
|
// interface XULControllers;
|
||||||
|
|
||||||
// http://www.whatwg.org/specs/web-apps/current-work/
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
||||||
[PrimaryGlobal, LegacyUnenumerableNamedProperties, NeedResolve]
|
[Global=Window,
|
||||||
|
Exposed=Window,
|
||||||
|
LegacyUnenumerableNamedProperties]
|
||||||
/*sealed*/ interface Window : EventTarget {
|
/*sealed*/ interface Window : EventTarget {
|
||||||
// the current browsing context
|
// the current browsing context
|
||||||
[Unforgeable, Constant, StoreInSlot,
|
[Unforgeable, Constant, StoreInSlot,
|
||||||
|
@ -32,6 +32,7 @@ pub(crate) struct InterfaceData {
|
|||||||
/// Whether only partial interfaces were encountered
|
/// Whether only partial interfaces were encountered
|
||||||
pub(crate) partial: bool,
|
pub(crate) partial: bool,
|
||||||
pub(crate) operations: BTreeMap<OperationId, OperationData>,
|
pub(crate) operations: BTreeMap<OperationId, OperationData>,
|
||||||
|
pub(crate) global: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||||
@ -185,6 +186,7 @@ impl FirstPass<()> for webidl::ast::NonPartialInterface {
|
|||||||
InterfaceData {
|
InterfaceData {
|
||||||
partial: false,
|
partial: false,
|
||||||
operations: Default::default(),
|
operations: Default::default(),
|
||||||
|
global: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -213,6 +215,7 @@ impl FirstPass<()> for webidl::ast::PartialInterface {
|
|||||||
InterfaceData {
|
InterfaceData {
|
||||||
partial: true,
|
partial: true,
|
||||||
operations: Default::default(),
|
operations: Default::default(),
|
||||||
|
global: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -269,6 +272,17 @@ impl<'b> FirstPass<&'b str> for webidl::ast::ExtendedAttribute {
|
|||||||
&rhs_arguments,
|
&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(())
|
_ => Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -656,7 +656,11 @@ impl<'a> FirstPassRecord<'a> {
|
|||||||
.map(|arg| (&*arg.name, &*arg.type_, arg.variadic)),
|
.map(|arg| (&*arg.name, &*arg.type_, arg.variadic)),
|
||||||
ret,
|
ret,
|
||||||
kind,
|
kind,
|
||||||
false,
|
self
|
||||||
|
.interfaces
|
||||||
|
.get(self_name)
|
||||||
|
.map(|interface_data| interface_data.global)
|
||||||
|
.unwrap_or(false),
|
||||||
catch,
|
catch,
|
||||||
doc_comment,
|
doc_comment,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user