Merge pull request #1353 from alexcrichton/raw-module

Add a `raw_module` attribute to `#[wasm_bindgen]`
This commit is contained in:
Alex Crichton
2019-03-18 12:48:14 -05:00
committed by GitHub
8 changed files with 61 additions and 21 deletions

View File

@ -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);
}
}
}
}

View File

@ -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,
},