Proposing a nice debugging feature
somonek
somonek at gmail.com
Wed May 3 13:14:44 UTC 2017
yeah it's maybe more a styling preference. I'm also thinking how
browsers would behave case you have a forgotten debugger somewhere.
Chrome skips debugger keywords if you don't have the developer tools
pane open. The code might break or stop in some cases if it's inside
an if block. Having the condition passed to the debugger could avoid
that. Any thoughts?
(of course forgotten debugger is stupid!)
On Wed, May 3, 2017 at 3:05 PM, Elie Rotenberg <elie at rotenberg.io> wrote:
> Is something wrong with
>
> if(condition) {
> debugger;
> }
>
> ?
>
> You can implement the feature you propose in userland, except that you get
> one useless stack frame (but that can also be worked around if need be):
>
> const debugIf = (b) => {
> if(b) {
> debugger;
> }
> }
>
> debugIf(condition);
>
> Regards,
>
> On Wed, May 3, 2017 at 2: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
>
>
More information about the es-discuss
mailing list