Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrijac/break-js

Set breakpoint before function call from console - console.break()
https://github.com/andrijac/break-js

Last synced: about 1 month ago
JSON representation

Set breakpoint before function call from console - console.break()

Awesome Lists containing this project

README

        

break-js
========

Set breakpoint before function call from console, this could potentially be implementation of `console.break()`.

Script makes global function `__break`.

Parameters:

1. Function name
- Mandatory
- Type: string
2. Remove breakpoint
- [Optional]
- Type: boolean

Details on implementation:
http://andrijac.github.io/blog/2014/01/31/javascript-breakpoint/

Usage
-

To set the breakpoint:
```javascript
__break('foo.bar.func');
```
To remove the breakpoint:
```javascript
__break('foo.bar.func', true);
```

Potentially, we could assign `__break` function to `console` object:

*Note: this is now added to script*
```javascript
if(!console.break) {
console.break = __break;
}
```