diff options
author | Yash Ladha <18033231+yashLadha@users.noreply.github.com> | 2023-05-13 23:58:25 +0530 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2023-05-15 11:37:34 +0200 |
commit | 372796440b69c81cb15c3114290e0dfa8a8bf4b0 (patch) | |
tree | 4c63275bfa6d67ca48391a2ed607737d70442825 | |
parent | 4197a9a5a0c36dcd01f4229dc8ba37caeb9dd363 (diff) | |
download | node-new-372796440b69c81cb15c3114290e0dfa8a8bf4b0.tar.gz |
doc: update measure memory rejection information
If in case context is unable to allocate a promise then
`ERR_CONTEXT_NOT_INITIALIZED` error will be thrown (as promise
rejection) in the vm measureMemory call.
PR-URL: https://github.com/nodejs/node/pull/41639
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
-rw-r--r-- | doc/api/vm.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/vm.md b/doc/api/vm.md index 1c043d119d..7631b39353 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -1143,8 +1143,9 @@ current V8 isolate, or the main context. exits before the next GC). With eager execution, the GC will be started right away to measure the memory. **Default:** `'default'` -* Returns: {Promise} If the memory is successfully measured the promise will +* Returns: {Promise} If the memory is successfully measured, the promise will resolve with an object containing information about the memory usage. + Otherwise it will be rejected with an `ERR_CONTEXT_NOT_INITIALIZED` error. The format of the object that the returned Promise may resolve with is specific to the V8 engine and may change from one version of V8 to the next. |