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:
@ -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)')
|
||||
}
|
||||
|
Reference in New Issue
Block a user