Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify use of timeout option in vm #23512

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ in the ECMAScript specification.
### module.evaluate([options])

* `options` {Object}
* `timeout` {number} Specifies the number of milliseconds to evaluate
* `timeout` {integer} Specifies the number of milliseconds to evaluate
before terminating execution. If execution is interrupted, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.
* `breakOnSigint` {boolean} If `true`, the execution will be terminated when
`SIGINT` (Ctrl+C) is received. Existing handlers for the event that have
been attached via `process.on('SIGINT')` will be disabled during script
Expand Down Expand Up @@ -507,9 +507,9 @@ changes:
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.
* `breakOnSigint`: if `true`, the execution will be terminated when
`SIGINT` (Ctrl+C) is received. Existing handlers for the
event that have been attached via `process.on('SIGINT')` will be disabled
Expand Down Expand Up @@ -570,9 +570,9 @@ changes:
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
vsemozhetbyt marked this conversation as resolved.
Show resolved Hide resolved
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.
* `contextName` {string} Human-readable name of the newly created context.
**Default:** `'VM Context i'`, where `i` is an ascending numerical index of
the created context.
Expand Down Expand Up @@ -628,9 +628,9 @@ added: v0.3.1
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.

Runs the compiled code contained by the `vm.Script` within the context of the
current `global` object. Running code does not have access to local scope, but
Expand Down Expand Up @@ -775,9 +775,9 @@ Returns `true` if the given `sandbox` object has been [contextified][] using
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.

The `vm.runInContext()` method compiles `code`, runs it within the context of
the `contextifiedSandbox`, then returns the result. Running code does not have
Expand Down Expand Up @@ -822,9 +822,9 @@ added: v0.3.1
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.
* `contextName` {string} Human-readable name of the newly created context.
**Default:** `'VM Context i'`, where `i` is an ascending numerical index of
the created context.
Expand Down Expand Up @@ -876,9 +876,9 @@ added: v0.3.1
* `displayErrors` {boolean} When `true`, if an [`Error`][] error occurs
while compiling the `code`, the line of code causing the error is attached
to the stack trace.
* `timeout` {number} Specifies the number of milliseconds to execute `code`
* `timeout` {integer} Specifies the number of milliseconds to execute `code`
before terminating execution. If execution is terminated, an [`Error`][]
will be thrown.
will be thrown. This value must be a strictly positive integer.

`vm.runInThisContext()` compiles `code`, runs it within the context of the
current `global` and returns the result. Running code does not have access to
Expand Down