resolve wasm build issues

This commit is contained in:
Connor Skees 2020-07-24 23:58:26 -04:00
parent 9dc87f4c96
commit 98fcc76a65

View File

@ -348,7 +348,7 @@ pub fn from_string(p: String, options: &Options) -> Result<String> {
#[cfg(feature = "wasm")] #[cfg(feature = "wasm")]
#[wasm_bindgen] #[wasm_bindgen]
pub fn from_string(p: String, options: &'_ Options<'_>) -> std::result::Result<String, JsValue> { pub fn from_string(p: String) -> std::result::Result<String, JsValue> {
let mut map = CodeMap::new(); let mut map = CodeMap::new();
let file = map.add_file("stdin".into(), p); let file = map.add_file("stdin".into(), p);
let empty_span = file.span.subspan(0, 0); let empty_span = file.span.subspan(0, 0);
@ -370,13 +370,13 @@ pub fn from_string(p: String, options: &'_ Options<'_>) -> std::result::Result<S
at_root_has_selector: false, at_root_has_selector: false,
extender: &mut Extender::new(empty_span), extender: &mut Extender::new(empty_span),
content_scopes: &mut Scopes::new(), content_scopes: &mut Scopes::new(),
options, options: &Options::default(),
} }
.parse() .parse()
.map_err(|e| raw_to_parse_error(&map, *e, options.unicode_error_messages).to_string())?; .map_err(|e| raw_to_parse_error(&map, *e, true).to_string())?;
Ok(Css::from_stmts(stmts, false, options.allows_charset) Ok(Css::from_stmts(stmts, false, true)
.map_err(|e| raw_to_parse_error(&map, *e, options.unicode_error_messages).to_string())? .map_err(|e| raw_to_parse_error(&map, *e, true).to_string())?
.pretty_print(&map) .pretty_print(&map)
.map_err(|e| raw_to_parse_error(&map, *e, options.unicode_error_messages).to_string())?) .map_err(|e| raw_to_parse_error(&map, *e, true).to_string())?)
} }