1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

js: add basic support for running tests, fix string.replace_each (#11314)

This commit is contained in:
playX
2021-08-26 15:20:54 +03:00
committed by GitHub
parent 403da9f36e
commit bdf11d969a
8 changed files with 178 additions and 28 deletions

View File

@ -36,3 +36,11 @@ pub fn eprint(s any) {
panic('Cannot `eprint` in a browser, use `println` instead')
}
}
// Exits the process in node, and halts execution in the browser
// because `process.exit` is undefined. Workaround for not having
// a 'real' way to exit in the browser.
pub fn exit(c int) {
JS.process.exit(c)
js_throw('exit($c)')
}