Ignore:
Timestamp:
Aug 25, 2020, 11:49:57 AM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: breakpoint condition should be evaluated before the ignore count
https://bugs.webkit.org/show_bug.cgi?id=215364
<rdar://problem/67310703>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Previously, when pausing, JSC::Breakpoint would check that it's ignoreCount before it
would even attempt to evaluate it's condition. This meant that a JSC::Breakpoint with
a condition of foo === 42 and an ignoreCount of 3 would ignore the first three
pauses and then only pause if foo === 42. This is likely contrary to the expectation of
most users (especially since the condition input is before the ignoreCount input in
the Web Inspector frontend UI) in that they would probably expect to ignore the first
three pauses if foo === 42.

  • debugger/Breakpoint.cpp:

(JSC::Breakpoint::shouldPause):

LayoutTests:

  • inspector/debugger/resources/condition-ignoreCount.js: Added.

(trigger): Added.

  • inspector/debugger/setBreakpoint-condition-ignoreCount.html: Added.
  • inspector/debugger/setBreakpoint-condition-ignoreCount-expected.txt: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Breakpoint.cpp

    r266074 r266138  
    7676bool Breakpoint::shouldPause(Debugger& debugger, JSGlobalObject* globalObject)
    7777{
    78     if (++m_hitCount <= m_ignoreCount)
     78    if (!debugger.evaluateBreakpointCondition(*this, globalObject))
    7979        return false;
    8080
    81     return debugger.evaluateBreakpointCondition(*this, globalObject);
     81    return ++m_hitCount > m_ignoreCount;
    8282}
    8383
Note: See TracChangeset for help on using the changeset viewer.