Eval should never return an error
Only awaiting eval should error. Eval should always be available, even if using its methods returns errors.
This commit is contained in:
9 files changed
+65
-44
No files matched your search
@@ -45,7 +45,7 @@ fn mock_event(id: &'static str, value: &'static str) {
|
||||
value, id
|
||||
);
|
||||
|
||||
eval(&js).unwrap().await.unwrap();
|
||||
eval(&js).await.unwrap();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ fn use_inner_html(id: &'static str) -> Option<String> {
|
||||
return element.innerHTML"#,
|
||||
id
|
||||
))
|
||||
.unwrap()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ impl DesktopEvalProvider {
|
||||
}
|
||||
|
||||
impl EvalProvider for DesktopEvalProvider {
|
||||
fn new_evaluator(&self, js: String) -> Result<GenerationalBox<Box<dyn Evaluator>>, EvalError> {
|
||||
Ok(DesktopEvaluator::create(self.desktop_ctx.clone(), js))
|
||||
fn new_evaluator(&self, js: String) -> GenerationalBox<Box<dyn Evaluator>> {
|
||||
DesktopEvaluator::create(self.desktop_ctx.clone(), js)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user