improve jsconsole (#17414)

* Add jsconsole.dir

* Update lib/js/jsconsole.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
Juan Carlos 2021-03-19 03:15:37 -03:00 • committed by GitHub
commit 9e1a2e9b63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -237,6 +237,8 @@
- In `std/os`, `getHomeDir`, `expandTilde`, `getTempDir`, `getConfigDir` now do not include trailing `DirSep`, - In `std/os`, `getHomeDir`, `expandTilde`, `getTempDir`, `getConfigDir` now do not include trailing `DirSep`,
unless `-d:nimLegacyHomeDir` is specified (for a transition period). unless `-d:nimLegacyHomeDir` is specified (for a transition period).
- Added `jsconsole.dir`, `jsconsole.dirxml`, `jsconsole.timeStamp`.
## Language changes ## Language changes

View file

@ -110,5 +110,15 @@ since (1, 5):
{.line: loc.}: {.line: loc.}:
{.emit: ["console.assert(", assertion, ", ", msg, ");"].} {.emit: ["console.assert(", assertion, ", ", msg, ");"].}
func dir*(console: Console; obj: auto) {.importcpp.}
## https://developer.mozilla.org/en-US/docs/Web/API/Console/dir
func dirxml*(console: Console; obj: auto) {.importcpp.}
## https://developer.mozilla.org/en-US/docs/Web/API/Console/dirxml
func timeStamp*(console: Console; label: cstring) {.importcpp.}
## https://developer.mozilla.org/en-US/docs/Web/API/Console/timeStamp
## ..warning:: non-standard
var console* {.importc, nodecl.}: Console var console* {.importc, nodecl.}: Console