Skip to content

Commit

Permalink
fix(pkg::compiler): set default dummy access model
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Sep 21, 2023
1 parent 59066c3 commit 418657f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/compiler/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ impl TypstCompilerBuilder {
#[wasm_bindgen(constructor)]
pub fn new() -> ZResult<TypstCompilerBuilder> {
console_error_panic_hook::set_once();
Ok(Self {
let mut res = Self {
access_model: None,
searcher: BrowserFontSearcher::new(),
})
};
res.set_dummy_access_model()?;
Ok(res)
}

pub async fn set_dummy_access_model(&mut self) -> ZResult<()> {
pub fn set_dummy_access_model(&mut self) -> ZResult<()> {
self.access_model = Some(ProxyAccessModel {
context: wasm_bindgen::JsValue::UNDEFINED,
mtime_fn: js_sys::Function::new_no_args("return new Date(0)"),
Expand Down

0 comments on commit 418657f

Please sign in to comment.