We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64ccb0c commit 8b661e3Copy full SHA for 8b661e3
abort/abort.mbt
@@ -23,10 +23,34 @@
23
///
24
/// Returns a value of type `T`. However, this function never actually returns a
25
/// value as it always causes a panic.
26
+#cfg(any(target="wasm", target="wasm-gc"))
27
pub fn[T] abort(msg : String) -> T {
28
let _ = msg
29
panic_impl()
30
}
31
32
+///|
33
+#cfg(target="js")
34
+pub fn[T] abort(msg : String) -> T {
35
+ console_error(msg)
36
+ panic_impl()
37
+}
38
+
39
40
41
+extern "js" fn console_error(msg : String) =
42
+ #|console.error
43
44
45
+#cfg(target="native")
46
+fn println(s : String) -> Unit = "%println"
47
48
49
50
51
+ println(msg)
52
53
54
55
///|
56
fn[T] panic_impl() -> T = "%panic"
0 commit comments