mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 06:21:29 +00:00
Wire assertions to global abort, see #8
This commit is contained in:
11
tests/compiler/std/abort.ts
Normal file
11
tests/compiler/std/abort.ts
Normal file
@ -0,0 +1,11 @@
|
||||
var abortCalled = false;
|
||||
|
||||
@global
|
||||
function abort(message: string | null, filename: string, line: i32, column: i32): void {
|
||||
abortCalled = true;
|
||||
}
|
||||
|
||||
assert(false, "this is ok");
|
||||
|
||||
if (!abortCalled)
|
||||
unreachable();
|
Reference in New Issue
Block a user