Deno.exit() is an alias to self.close() in worker contexts (#14826)

This commit changes Deno.exit() to be an alias to self.close() in worker contexts,
and the provided exit code becomes is ignored.
This commit is contained in:
Bartek Iwańczuk 2022-06-13 23:53:04 +02:00 committed by GitHub
parent 4a0a412d7c
commit fc3a966a2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 47 deletions

View file

@ -480,6 +480,8 @@ declare namespace Deno {
/** Exit the Deno process with optional exit code. If no exit code is supplied
* then Deno will exit with return code of 0.
*
* In worker contexts this is an alias to `self.close();`.
*
* ```ts
* Deno.exit(5);
* ```