From c5f44a8c1d96a3e9f6e6a1648f9a5ac116f16624 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sat, 11 Sep 2021 09:46:55 -0700 Subject: [PATCH] Add an intentional panic for debug --- editor/src/document/document_file.rs | 2 +- frontend/src/components/widgets/inputs/MenuBarInput.vue | 1 + frontend/wasm/src/api.rs | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/src/document/document_file.rs b/editor/src/document/document_file.rs index 7f358cfa..65b0690e 100644 --- a/editor/src/document/document_file.rs +++ b/editor/src/document/document_file.rs @@ -551,7 +551,7 @@ impl MessageHandler for DocumentMessageHand }) .flatten(), ); - log::debug!("LayerPanel: {:?}", self.layer_data.keys()); + // log::debug!("LayerPanel: {:?}", self.layer_data.keys()); } Err(e) => log::error!("DocumentError: {:?}", e), Ok(_) => (), diff --git a/frontend/src/components/widgets/inputs/MenuBarInput.vue b/frontend/src/components/widgets/inputs/MenuBarInput.vue index 1f1693b4..6e3eeae3 100644 --- a/frontend/src/components/widgets/inputs/MenuBarInput.vue +++ b/frontend/src/components/widgets/inputs/MenuBarInput.vue @@ -161,6 +161,7 @@ const menuEntries: MenuListEntries = [ { label: "Graphite License", action: () => window.open("https://raw.githubusercontent.com/GraphiteEditor/Graphite/master/LICENSE.txt", "_blank") }, { label: "Third-Party Licenses", action: () => window.open("/third-party-licenses.txt", "_blank") }, ], + [{ label: "Debug: Panic (DANGER)", action: async () => (await wasm).intentional_panic() }], ], }, ]; diff --git a/frontend/wasm/src/api.rs b/frontend/wasm/src/api.rs index 83df7976..3dc10cb6 100644 --- a/frontend/wasm/src/api.rs +++ b/frontend/wasm/src/api.rs @@ -14,6 +14,12 @@ use editor::LayerId; use editor::{message_prelude::*, Color}; use wasm_bindgen::prelude::*; +/// Intentionally panic for testing purposes +#[wasm_bindgen] +pub fn intentional_panic() { + panic!(); +} + /// Modify the currently selected tool in the document state store #[wasm_bindgen] pub fn select_tool(tool: String) -> Result<(), JsValue> {