diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-09-11 02:54:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 02:54:37 +0200 |
commit | ba8bbe6f1c11d4cf19ad0b916ba41cd919dbb042 (patch) | |
tree | c12b2df8d9e36b64f4653c4a38f928b748b755cf /core | |
parent | bd4ca721eb2aa7b772a3834add2c37f606d4568b (diff) |
refactor: use Deno.core.tryClose (#11980)
Diffstat (limited to 'core')
-rw-r--r-- | core/lib.deno_core.d.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/lib.deno_core.d.ts b/core/lib.deno_core.d.ts index 2c69782a6..46cf6b42c 100644 --- a/core/lib.deno_core.d.ts +++ b/core/lib.deno_core.d.ts @@ -33,9 +33,18 @@ declare namespace Deno { */ function resources(): Record<string, string>; - /** Close the resource with the specified op id. */ + /** + * Close the resource with the specified op id. Throws `BadResource` error + * if resource doesn't exist in resource table. + */ function close(rid: number): void; + /** + * Try close the resource with the specified op id; if resource with given + * id doesn't exist do nothing. + */ + function tryClose(rid: number): void; + /** Get heap stats for current isolate/worker */ function heapStats(): Record<string, number>; |