mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-24 18:21:33 +00:00
Merge branch 'master' into reexporting_in_2018
This commit is contained in:
@ -79,6 +79,7 @@ pub struct Import {
|
||||
pub enum ImportModule {
|
||||
None,
|
||||
Named(String, Span),
|
||||
RawNamed(String, Span),
|
||||
Inline(usize, Span),
|
||||
}
|
||||
|
||||
@ -96,6 +97,10 @@ impl Hash for ImportModule {
|
||||
2u8.hash(h);
|
||||
idx.hash(h);
|
||||
}
|
||||
ImportModule::RawNamed(name, _) => {
|
||||
3u8.hash(h);
|
||||
name.hash(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -844,6 +844,18 @@ impl ToTokens for ast::ImportEnum {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::all)]
|
||||
impl wasm_bindgen::convert::OptionIntoWasmAbi for #name {
|
||||
#[inline]
|
||||
fn none() -> Self::Abi { Object::none() }
|
||||
}
|
||||
|
||||
#[allow(clippy::all)]
|
||||
impl wasm_bindgen::convert::OptionFromWasmAbi for #name {
|
||||
#[inline]
|
||||
fn is_none(abi: &Self::Abi) -> bool { Object::is_none(abi) }
|
||||
}
|
||||
|
||||
#[allow(clippy::all)]
|
||||
impl From<#name> for wasm_bindgen::JsValue {
|
||||
fn from(obj: #name) -> wasm_bindgen::JsValue {
|
||||
|
@ -208,6 +208,7 @@ fn shared_import<'a>(i: &'a ast::Import, intern: &'a Interner) -> Result<Import<
|
||||
ast::ImportModule::Named(m, span) => {
|
||||
ImportModule::Named(intern.resolve_import_module(m, *span)?)
|
||||
}
|
||||
ast::ImportModule::RawNamed(m, _span) => ImportModule::RawNamed(intern.intern_str(m)),
|
||||
ast::ImportModule::Inline(idx, _) => ImportModule::Inline(*idx as u32),
|
||||
ast::ImportModule::None => ImportModule::None,
|
||||
},
|
||||
|
Reference in New Issue
Block a user