new Breakpoint(criteria, name) → {Breakpoint}
Used to stop running code when specific criteria are met
Parameters:
Name | Type | Description |
---|---|---|
criteria |
object | Critera for when the Breakpoint should stop code from running. See EventFilter for details |
name |
string | Optional name for this breakpoint. If no name is specified, a default name will be assigned. |
Members
-
static inBreak
-
true if a break has been triggered
-
static list
-
Array of breakpoint strings, as returned by
toString
Methods
-
async, static checkBreak(e, cb) → {Promise}
-
Evaluates whether the specified event triggers a breakpoint
Parameters:
Name Type Description e
EventBase An event that is derived from EventBase
cb
function A callback function for when resuming from the break
Returns:
Promise -a Promise that resolves when resuming from the breakpoint
-
static clear(name) → {boolean}
-
Delete a breakpoint
Parameters:
Name Type Description name
string | number The name or number of the breakpoint. If multiple breakpoints with the same name are found, they are all cleared.
Returns:
boolean -Returns
true
if the breakpoint was found and enabled, false otherwise. -
static clearAll()
-
Clear all breakpoints
-
static disable(name) → {boolean}
-
Disable a breakpoint so that it still exists, but doesn't trigger
Parameters:
Name Type Description name
string | number The name or number of the breakpoint. If multiple breakpoints with the same name are found, they are all disabled.
Returns:
boolean -Returns
true
if the breakpoint was found and enabled, false otherwise. -
static enable(name) → {boolean}
-
Enable a previously disabled breakpoint
Parameters:
Name Type Description name
string | number The name or number of the breakpoint. If multiple breakpoints with the same name are found, they are all enabled.
Returns:
boolean -Returns
true
if the breakpoint was found and enabled, false otherwise. -
static find(name) → {Array.<Breakpoint>}
-
Find breakpoints with the corresponding 'name'
Parameters:
Name Type Description name
string The name of the breakpoint(s) to find
Returns:
Array.<Breakpoint> -An Array of Breakpoints that were found, or an empty array if none were found.
-
static init()
-
Initialize breakpoints, typically called by init()
-
static run()
-
Resumes running after a breakpoint has been triggered
-
static setBreakpoint()
-
Sets a new breakpoint
-
clear()
-
Clears this breakpoint by removing it from the global breakpoint list
-
disable()
-
Disables this breakpoint
-
enable()
-
Enables this Breakpoint
-
matchEvent(e) → {boolean}
-
Determines if this Breakpoint matches event 'e' based on the 'criteria' specified when the Breakpoint was created. Used to determine if the program should stop.
Parameters:
Name Type Description e
EventBase The event to be evaluated
Returns:
boolean -Returns
true
if the event matches this Breakpoint's criteria,false
otherwise -
toString()
-
Converts the Breakpoint to a human-readable String