mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 14:31:22 +00:00
Guarantee static_method_of
uses the right this
(#1795)
This came up during #1760 where `Promise.resolve` must be invoked with `this` as the `Promise` object, but we were erroneously importing it in such a way that it didn't have a shim and `this` was `undefined`.
This commit is contained in:
@ -2269,6 +2269,11 @@ impl<'a> Context<'a> {
|
||||
}
|
||||
},
|
||||
|
||||
AuxImport::ValueWithThis(class, name) => {
|
||||
let class = self.import_name(class)?;
|
||||
Ok(format!("{}.{}({})", class, name, variadic_args(&args)?))
|
||||
}
|
||||
|
||||
AuxImport::Instanceof(js) => {
|
||||
assert!(webidl_ty.kind == ast::WebidlFunctionKind::Static);
|
||||
assert!(!variadic);
|
||||
|
Reference in New Issue
Block a user