os.createDebugger() now returns a promise that needs to be awaited instead of simply returning a debugger.
setTimeout() and setInterval() now throw an error if called without a handler function.
:rocket: Improvements
Added the ability to pause scripts that are executed inside debuggers.
The os.createDebugger() API now supports an additional option parameter pausable, which when set to true will cause the debugger to execute every script inside a JavaScript interpreter.
The following functions have also been added to the debugger API:
onPause(handler) - Registers a handler function that will be called when the debugger pauses due to hitting a pause trigger (i.e. breakpoint).
setPauseTrigger(bot, tag, options) - Registers a pause trigger in a bot and tag that the debugger will pause at if it comes across the trigger while executing code. Returns an object that represents the pause trigger.
removePauseTrigger(trigger) - Removes the given pause trigger from the debugger.
enablePauseTrigger(trigger) - Enables the given pause trigger.
disablePauseTrigger(trigger) - Disables the given pause trigger.
listPauseTriggers() - Lists the pause triggers that have been set on the debugger.
listCommonPauseTriggers(bot, tag) - Lists common locations that pause triggers can be placed at for the given bot and tag.
resume(pause) - Tells the debugger to resume execution of the scripts.
See the documentation for more complete information and examples.
:boom: Breaking Changes
os.createDebugger()
now returns a promise that needs to be awaited instead of simply returning a debugger.setTimeout()
andsetInterval()
now throw an error if called without a handler function.:rocket: Improvements
os.createDebugger()
API now supports an additional option parameterpausable
, which when set totrue
will cause the debugger to execute every script inside a JavaScript interpreter.onPause(handler)
- Registers a handler function that will be called when the debugger pauses due to hitting a pause trigger (i.e. breakpoint).setPauseTrigger(bot, tag, options)
- Registers a pause trigger in a bot and tag that the debugger will pause at if it comes across the trigger while executing code. Returns an object that represents the pause trigger.removePauseTrigger(trigger)
- Removes the given pause trigger from the debugger.enablePauseTrigger(trigger)
- Enables the given pause trigger.disablePauseTrigger(trigger)
- Disables the given pause trigger.listPauseTriggers()
- Lists the pause triggers that have been set on the debugger.listCommonPauseTriggers(bot, tag)
- Lists common locations that pause triggers can be placed at for the given bot and tag.resume(pause)
- Tells the debugger to resume execution of the scripts.