mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-30 06:54:26 +03:00
allow 'await' in the REPL and added os.sleepAsync()
This commit is contained in:
@@ -368,6 +368,9 @@ optional properties:
|
||||
@item backtrace_barrier
|
||||
Boolean (default = false). If true, error backtraces do not list the
|
||||
stack frames below the evalScript.
|
||||
@item async
|
||||
Boolean (default = false). If true, @code{await} is accepted in the
|
||||
script and a promise is returned.
|
||||
@end table
|
||||
|
||||
@item loadScript(filename)
|
||||
@@ -769,6 +772,12 @@ write_fd]} or null in case of error.
|
||||
@item sleep(delay_ms)
|
||||
Sleep during @code{delay_ms} milliseconds.
|
||||
|
||||
@item sleepAsync(delay_ms)
|
||||
Asynchronouse sleep during @code{delay_ms} milliseconds. Returns a promise. Example:
|
||||
@example
|
||||
await os.sleepAsync(500);
|
||||
@end example
|
||||
|
||||
@item now()
|
||||
Return a timestamp in milliseconds with more precision than
|
||||
@code{Date.now()}. The time origin is unspecified and is normally not
|
||||
|
Reference in New Issue
Block a user