Proposing a nice debugging feature

T.J. Crowder tj.crowder at farsightsoftware.com
Wed May 3 13:04:45 UTC 2017


Preference, really, is to use the features of your debugger rather than
modifying source. But for those times you need to modify source, why do we
need new syntax for this? These seem sufficient:

```js
if (typeof someVariable === 'undefined') debugger;
```

or

```js
typeof someVariable === 'undefined' && debugger;
```

*(since it's temporary throw-away code, style objections by some [like me]
can be ignored...)*

-- T.J. Crowder

On Wed, May 3, 2017 at 1:59 PM, somonek <somonek at gmail.com> wrote:

> Hello,
>
> not sure if it's been already proposed maybe, but I have this in mind
>
> debugger(/* condition */);
>
> to stop on conditional breakpoint.
>
> Example:
>
> debugger(typeof someVariable === 'undefined');
>
> What do you think?
>
>
> Be well,
> Serghei
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170503/af18411e/attachment.html>


More information about the es-discuss mailing list