-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for the Playground #979
Conversation
Need a better solution than just duplicating the execute plan stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick thought within!
@@ -50,6 +50,7 @@ fn compile( | |||
|
|||
#[wasm_bindgen] | |||
pub fn run(passes: &JsValue, library: &str, namespace: &str) -> String { | |||
std::panic::set_hook(Box::new(console_error_panic_hook::hook)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning panics into console.log
s is a neat solution!
calyx/src/pass_manager.rs
Outdated
@@ -176,6 +176,27 @@ impl PassManager { | |||
|
|||
Ok(()) | |||
} | |||
|
|||
/// Executes a given "plan" constructed with logging disabled | |||
pub fn execute_plan_without_log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is a good idea, but one option would be to use a wasm-specific logger, sort of analogously to the wasm-specific panic hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reference! I'm trying to see if there is a shim for the Instant::now() implementation somewhere that I can use. If not, this might be the way to go.
Fixes #978.