diff --git a/changelog.md b/changelog.md index 20177aefd..d0ad8e8e4 100644 --- a/changelog.md +++ b/changelog.md @@ -205,6 +205,8 @@ provided by the operating system. - Removed support for named procs in `sugar.=>` +- Added `jscore.debugger` to [call any available debugging functionality, such as breakpoints.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) + ## Language changes diff --git a/lib/js/jscore.nim b/lib/js/jscore.nim index 3af33b535..693e50799 100644 --- a/lib/js/jscore.nim +++ b/lib/js/jscore.nim @@ -13,6 +13,7 @@ ## specific requirements and solely targets JavaScript, you should be using ## the relevant functions in the `math`, `json`, and `times` stdlib ## modules instead. +import std/private/since when not defined(js): {.error: "This module only works on the JavaScript platform".} @@ -104,3 +105,8 @@ proc setFullYear*(d: DateTime, year: int) {.importcpp.} #JSON library proc stringify*(l: JsonLib, s: JsRoot): cstring {.importcpp.} proc parse*(l: JsonLib, s: cstring): JsRoot {.importcpp.} + + +since (1, 5): + func debugger*() {.importjs: "debugger@".} + ## https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger