⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243727 in webkit


Ignore:
Timestamp:
Apr 1, 2019, 5:20:11 PM (7 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: modernize serialization of breakpoints and the maps that hold them
https://bugs.webkit.org/show_bug.cgi?id=196230
<rdar://problem/49236485>

Reviewed by Joseph Pecoraro.

  • UserInterface/Controllers/DebuggerManager.js:

(WI.DebuggerManager):
(WI.DebuggerManager.prototype.breakpointsForSourceCode):
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype.removeBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):

  • UserInterface/Models/Breakpoint.js:

(WI.Breakpoint):
(WI.Breakpoint.fromJSON): Added.
(WI.Breakpoint.prototype.toJSON):
(WI.Breakpoint.prototype.set resolved):
(WI.Breakpoint.prototype.recreateAction):
(WI.Breakpoint.prototype.saveIdentityToCookie):
(WI.Breakpoint.prototype._isSpecial): Added.
(WI.Breakpoint.set resolved.isSpecialBreakpoint): Deleted.
(WI.Breakpoint.serializeOptions): Deleted.

  • UserInterface/Models/BreakpointAction.js:

(WI.BreakpointAction):
(WI.BreakpointAction.fromJSON): Added.
(WI.BreakpointAction.prototype.toProtocol): Added.

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WI.DebuggerSidebarPanel.prototype._addBreakpointsForSourceCode):

  • UserInterface/Views/SourceCodeTextEditor.js:

(WI.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
(WI.SourceCodeTextEditor.prototype._breakpointsEnabledDidChange):

Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243722 r243727  
     12019-04-01  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: modernize serialization of breakpoints and the maps that hold them
     4        https://bugs.webkit.org/show_bug.cgi?id=196230
     5        <rdar://problem/49236485>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/Controllers/DebuggerManager.js:
     10        (WI.DebuggerManager):
     11        (WI.DebuggerManager.prototype.breakpointsForSourceCode):
     12        (WI.DebuggerManager.prototype.addBreakpoint):
     13        (WI.DebuggerManager.prototype.removeBreakpoint):
     14        (WI.DebuggerManager.prototype._setBreakpoint):
     15        (WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
     16
     17        * UserInterface/Models/Breakpoint.js:
     18        (WI.Breakpoint):
     19        (WI.Breakpoint.fromJSON): Added.
     20        (WI.Breakpoint.prototype.toJSON):
     21        (WI.Breakpoint.prototype.set resolved):
     22        (WI.Breakpoint.prototype.recreateAction):
     23        (WI.Breakpoint.prototype.saveIdentityToCookie):
     24        (WI.Breakpoint.prototype._isSpecial): Added.
     25        (WI.Breakpoint.set resolved.isSpecialBreakpoint): Deleted.
     26        (WI.Breakpoint.serializeOptions): Deleted.
     27
     28        * UserInterface/Models/BreakpointAction.js:
     29        (WI.BreakpointAction):
     30        (WI.BreakpointAction.fromJSON): Added.
     31        (WI.BreakpointAction.prototype.toProtocol): Added.
     32
     33        * UserInterface/Views/DebuggerSidebarPanel.js:
     34        (WI.DebuggerSidebarPanel.prototype._addBreakpointsForSourceCode):
     35
     36        * UserInterface/Views/SourceCodeTextEditor.js:
     37        (WI.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
     38        (WI.SourceCodeTextEditor.prototype._breakpointsEnabledDidChange):
     39
    1402019-04-01  Devin Rousso  <drousso@apple.com>
    241
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js

    r243226 r243727  
    5959        let specialBreakpointLocation = new WI.SourceCodeLocation(null, Infinity, Infinity);
    6060
    61         this._allExceptionsBreakpoint = new WI.Breakpoint(specialBreakpointLocation, !this._allExceptionsBreakpointEnabledSetting.value);
     61        this._allExceptionsBreakpoint = new WI.Breakpoint(specialBreakpointLocation, {
     62            disabled: !this._allExceptionsBreakpointEnabledSetting.value,
     63        });
    6264        this._allExceptionsBreakpoint.resolved = true;
    6365
    64         this._uncaughtExceptionsBreakpoint = new WI.Breakpoint(specialBreakpointLocation, !this._uncaughtExceptionsBreakpointEnabledSetting.value);
    65 
    66         this._assertionFailuresBreakpoint = new WI.Breakpoint(specialBreakpointLocation, !this._assertionFailuresBreakpointEnabledSetting.value);
     66        this._uncaughtExceptionsBreakpoint = new WI.Breakpoint(specialBreakpointLocation, {
     67            disabled: !this._uncaughtExceptionsBreakpointEnabledSetting.value,
     68        });
     69        this._uncaughtExceptionsBreakpoint.resolved = true;
     70
     71        this._assertionFailuresBreakpoint = new WI.Breakpoint(specialBreakpointLocation, {
     72            disabled: !this._assertionFailuresBreakpointEnabledSetting.value,
     73        });
    6774        this._assertionFailuresBreakpoint.resolved = true;
    6875
    6976        this._breakpoints = [];
    70         this._breakpointContentIdentifierMap = new Map;
    71         this._breakpointScriptIdentifierMap = new Map;
     77        this._breakpointContentIdentifierMap = new Multimap;
     78        this._breakpointScriptIdentifierMap = new Multimap;
    7279        this._breakpointIdMap = new Map;
    7380
     
    104111            if (existingSerializedBreakpoints) {
    105112                for (let existingSerializedBreakpoint of existingSerializedBreakpoints)
    106                     await WI.objectStores.breakpoints.putObject(new WI.Breakpoint(existingSerializedBreakpoint));
     113                    await WI.objectStores.breakpoints.putObject(WI.Breakpoint.fromJSON(existingSerializedBreakpoint));
    107114            }
    108115
     
    111118            this._restoringBreakpoints = true;
    112119            for (let serializedBreakpoint of serializedBreakpoints) {
    113                 let breakpoint = new WI.Breakpoint(serializedBreakpoint);
     120                let breakpoint = WI.Breakpoint.fromJSON(serializedBreakpoint);
    114121
    115122                const key = null;
     
    212219        console.assert(sourceCode instanceof WI.Resource || sourceCode instanceof WI.Script);
    213220
    214         if (sourceCode instanceof WI.SourceMapResource) {
    215             let originalSourceCodeBreakpoints = this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode);
    216             return originalSourceCodeBreakpoints.filter(function(breakpoint) {
    217                 return breakpoint.sourceCodeLocation.displaySourceCode === sourceCode;
    218             });
    219         }
     221        if (sourceCode instanceof WI.SourceMapResource)
     222            return Array.from(this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode)).filter((breakpoint) => breakpoint.sourceCodeLocation.displaySourceCode === sourceCode);
    220223
    221224        let contentIdentifierBreakpoints = this._breakpointContentIdentifierMap.get(sourceCode.contentIdentifier);
     
    481484        }
    482485
    483         if (breakpoint.contentIdentifier) {
    484             let contentIdentifierBreakpoints = this._breakpointContentIdentifierMap.get(breakpoint.contentIdentifier);
    485             if (!contentIdentifierBreakpoints) {
    486                 contentIdentifierBreakpoints = [];
    487                 this._breakpointContentIdentifierMap.set(breakpoint.contentIdentifier, contentIdentifierBreakpoints);
    488             }
    489             contentIdentifierBreakpoints.push(breakpoint);
    490         }
    491 
    492         if (breakpoint.scriptIdentifier) {
    493             let scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap.get(breakpoint.scriptIdentifier);
    494             if (!scriptIdentifierBreakpoints) {
    495                 scriptIdentifierBreakpoints = [];
    496                 this._breakpointScriptIdentifierMap.set(breakpoint.scriptIdentifier, scriptIdentifierBreakpoints);
    497             }
    498             scriptIdentifierBreakpoints.push(breakpoint);
    499         }
     486        if (breakpoint.contentIdentifier)
     487            this._breakpointContentIdentifierMap.add(breakpoint.contentIdentifier, breakpoint);
     488
     489        if (breakpoint.scriptIdentifier)
     490            this._breakpointScriptIdentifierMap.add(breakpoint.scriptIdentifier, breakpoint);
    500491
    501492        this._breakpoints.push(breakpoint);
     
    538529            this._removeBreakpoint(breakpoint);
    539530
    540         if (breakpoint.contentIdentifier) {
    541             let contentIdentifierBreakpoints = this._breakpointContentIdentifierMap.get(breakpoint.contentIdentifier);
    542             if (contentIdentifierBreakpoints) {
    543                 contentIdentifierBreakpoints.remove(breakpoint);
    544                 if (!contentIdentifierBreakpoints.length)
    545                     this._breakpointContentIdentifierMap.delete(breakpoint.contentIdentifier);
    546             }
    547         }
    548 
    549         if (breakpoint.scriptIdentifier) {
    550             let scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap.get(breakpoint.scriptIdentifier);
    551             if (scriptIdentifierBreakpoints) {
    552                 scriptIdentifierBreakpoints.remove(breakpoint);
    553                 if (!scriptIdentifierBreakpoints.length)
    554                     this._breakpointScriptIdentifierMap.delete(breakpoint.scriptIdentifier);
    555             }
    556         }
     531        if (breakpoint.contentIdentifier)
     532            this._breakpointContentIdentifierMap.delete(breakpoint.contentIdentifier, breakpoint);
     533
     534        if (breakpoint.scriptIdentifier)
     535            this._breakpointScriptIdentifierMap.delete(breakpoint.scriptIdentifier, breakpoint);
    557536
    558537        // Disable the breakpoint first, so removing actions doesn't re-add the breakpoint.
     
    904883    _debuggerBreakpointOptions(breakpoint)
    905884    {
    906         const templatePlaceholderRegex = /\$\{.*?\}/;
    907 
    908         let options = breakpoint.serializeOptions();
    909         options.actions = options.actions.filter((action) => {
     885        let actions = breakpoint.actions;
     886        actions = actions.map((action) => action.toProtocol());
     887        actions = actions.filter((action) => {
    910888            if (action.type !== WI.BreakpointAction.Type.Log)
    911889                return true;
    912890
    913             if (!templatePlaceholderRegex.test(action.data))
     891            if (!/\$\{.*?\}/.test(action.data))
    914892                return true;
    915893
     
    931909            return true;
    932910        });
    933         return options;
     911
     912        return {
     913            condition: breakpoint.condition,
     914            ignoreCount: breakpoint.ignoreCount,
     915            autoContinue: breakpoint.autoContinue,
     916            actions,
     917        };
    934918    }
    935919
     
    947931        }
    948932
    949         function didSetBreakpoint(target, error, breakpointIdentifier, locations)
    950         {
    951             if (error)
     933        function didSetBreakpoint(target, error, breakpointIdentifier, locations) {
     934            if (error) {
     935                WI.reportInternalError(error);
    952936                return;
     937            }
    953938
    954939            this._breakpointIdMap.set(breakpointIdentifier, breakpoint);
     
    996981                options
    997982            }, didSetBreakpoint.bind(this, target), target.DebuggerAgent);
    998         }
     983        } else
     984            WI.reportInternalError("Unknown source for breakpoint.");
    999985    }
    1000986
  • trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js

    r243226 r243727  
    2626WI.Breakpoint = class Breakpoint extends WI.Object
    2727{
    28     constructor(sourceCodeLocationOrInfo, disabled, condition)
    29     {
     28    constructor(sourceCodeLocation, {contentIdentifier, disabled, condition, ignoreCount, autoContinue} = {})
     29    {
     30        console.assert(sourceCodeLocation instanceof WI.SourceCodeLocation);
     31        console.assert(!contentIdentifier || typeof contentIdentifier === "string");
     32        console.assert(!disabled || typeof disabled === "boolean");
     33        console.assert(!condition || typeof condition === "string");
     34        console.assert(!ignoreCount || !isNaN(ignoreCount));
     35        console.assert(!autoContinue || typeof autoContinue === "boolean");
     36
    3037        super();
    3138
    32         if (sourceCodeLocationOrInfo instanceof WI.SourceCodeLocation) {
    33             var sourceCode = sourceCodeLocationOrInfo.sourceCode;
    34             var contentIdentifier = sourceCode ? sourceCode.contentIdentifier : null;
    35             var scriptIdentifier = sourceCode instanceof WI.Script ? sourceCode.id : null;
    36             var target = sourceCode instanceof WI.Script ? sourceCode.target : null;
    37             var location = sourceCodeLocationOrInfo;
    38         } else if (sourceCodeLocationOrInfo && typeof sourceCodeLocationOrInfo === "object") {
    39             // The 'url' fallback is for transitioning from older frontends and should be removed.
    40             var contentIdentifier = sourceCodeLocationOrInfo.contentIdentifier || sourceCodeLocationOrInfo.url;
    41             var lineNumber = sourceCodeLocationOrInfo.lineNumber || 0;
    42             var columnNumber = sourceCodeLocationOrInfo.columnNumber || 0;
    43             var location = new WI.SourceCodeLocation(null, lineNumber, columnNumber);
    44             var ignoreCount = sourceCodeLocationOrInfo.ignoreCount || 0;
    45             var autoContinue = sourceCodeLocationOrInfo.autoContinue || false;
    46             var actions = sourceCodeLocationOrInfo.actions || [];
    47             for (var i = 0; i < actions.length; ++i)
    48                 actions[i] = new WI.BreakpointAction(this, actions[i]);
    49             disabled = sourceCodeLocationOrInfo.disabled;
    50             condition = sourceCodeLocationOrInfo.condition;
     39        this._id = null;
     40        this._sourceCodeLocation = sourceCodeLocation;
     41
     42        let sourceCode = this._sourceCodeLocation.sourceCode;
     43        if (sourceCode) {
     44            this._contentIdentifier = sourceCode.contentIdentifier;
     45            console.assert(!contentIdentifier || contentIdentifier === this._contentIdentifier, "The content identifier from the source code should match the given value.");
    5146        } else
    52             console.error("Unexpected type passed to WI.Breakpoint", sourceCodeLocationOrInfo);
    53 
    54         this._id = null;
    55         this._contentIdentifier = contentIdentifier || null;
    56         this._scriptIdentifier = scriptIdentifier || null;
    57         this._target = target || null;
     47            this._contentIdentifier = contentIdentifier || null;
     48        console.assert(this._contentIdentifier || this._isSpecial(), "There should always be a content identifier for a breakpoint.");
     49
     50        this._scriptIdentifier = sourceCode instanceof WI.Script ? sourceCode.id : null;
     51        this._target = sourceCode instanceof WI.Script ? sourceCode.target : null;
    5852        this._disabled = disabled || false;
    5953        this._condition = condition || "";
    6054        this._ignoreCount = ignoreCount || 0;
    6155        this._autoContinue = autoContinue || false;
    62         this._actions = actions || [];
     56        this._actions = [];
    6357        this._resolved = false;
    6458
    65         this._sourceCodeLocation = location;
    6659        this._sourceCodeLocation.addEventListener(WI.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationLocationChanged, this);
    6760        this._sourceCodeLocation.addEventListener(WI.SourceCodeLocation.Event.DisplayLocationChanged, this._sourceCodeLocationDisplayLocationChanged, this);
    6861    }
    6962
     63    // Import / Export
     64
     65    static fromJSON(json)
     66    {
     67        const sourceCode = null;
     68        let breakpoint = new Breakpoint(new WI.SourceCodeLocation(sourceCode, json.lineNumber || 0, json.columnNumber || 0), {
     69            // The 'url' fallback is for transitioning from older frontends and should be removed.
     70            contentIdentifier: json.contentIdentifier || json.url,
     71            disabled: json.disabled,
     72            condition: json.condition,
     73            ignoreCount: json.ignoreCount,
     74            autoContinue: json.autoContinue,
     75        });
     76        breakpoint._actions = json.actions.map((actionJSON) => WI.BreakpointAction.fromJSON(actionJSON, breakpoint));
     77        return breakpoint;
     78    }
     79
     80    toJSON(key)
     81    {
     82        // The id, scriptIdentifier, target, and resolved state are tied to the current session, so don't include them for serialization.
     83        let json = {
     84            contentIdentifier: this._contentIdentifier,
     85            lineNumber: this._sourceCodeLocation.lineNumber,
     86            columnNumber: this._sourceCodeLocation.columnNumber,
     87            disabled: this._disabled,
     88            condition: this._condition,
     89            ignoreCount: this._ignoreCount,
     90            actions: this._actions.map((action) => action.toJSON()),
     91            autoContinue: this._autoContinue,
     92        };
     93        if (key === WI.ObjectStore.toJSONSymbol)
     94            json[WI.objectStores.breakpoints.keyPath] = this._contentIdentifier + ":" + this._sourceCodeLocation.lineNumber + ":" + this._sourceCodeLocation.columnNumber;
     95        return json;
     96    }
     97
    7098    // Public
    7199
     100    get sourceCodeLocation() { return this._sourceCodeLocation; }
     101    get contentIdentifier() { return this._contentIdentifier; }
     102    get scriptIdentifier() { return this._scriptIdentifier; }
     103    get target() { return this._target; }
     104
    72105    get identifier()
    73106    {
     
    80113    }
    81114
    82     get contentIdentifier()
    83     {
    84         return this._contentIdentifier;
    85     }
    86 
    87     get scriptIdentifier()
    88     {
    89         return this._scriptIdentifier;
    90     }
    91 
    92     get target()
    93     {
    94         return this._target;
    95     }
    96 
    97     get sourceCodeLocation()
    98     {
    99         return this._sourceCodeLocation;
    100     }
    101 
    102115    get resolved()
    103116    {
     
    110123            return;
    111124
    112         function isSpecialBreakpoint()
    113         {
    114             return this._sourceCodeLocation.isEqual(new WI.SourceCodeLocation(null, Infinity, Infinity));
    115         }
    116 
    117         console.assert(!resolved || this._sourceCodeLocation.sourceCode || isSpecialBreakpoint.call(this), "Breakpoints must have a SourceCode to be resolved.", this);
     125        console.assert(!resolved || this._sourceCodeLocation.sourceCode || this._isSpecial(), "Breakpoints must have a SourceCode to be resolved.", this);
    118126
    119127        this._resolved = resolved || false;
     
    242250    recreateAction(type, actionToReplace)
    243251    {
    244         var newAction = new WI.BreakpointAction(this, type, null);
    245 
    246         var index = this._actions.indexOf(actionToReplace);
     252        let index = this._actions.indexOf(actionToReplace);
    247253        console.assert(index !== -1);
    248254        if (index === -1)
    249255            return null;
    250256
    251         this._actions[index] = newAction;
    252 
    253         this.dispatchEventToListeners(WI.Breakpoint.Event.ActionsDidChange);
    254 
    255         return newAction;
     257        const data = null;
     258        let action = new WI.BreakpointAction(this, type, data);
     259        this._actions[index] = action;
     260
     261        this.dispatchEventToListeners(WI.Breakpoint.Event.ActionsDidChange);
     262
     263        return action;
    256264    }
    257265
     
    283291    saveIdentityToCookie(cookie)
    284292    {
    285         cookie["breakpoint-content-identifier"] = this.contentIdentifier;
    286         cookie["breakpoint-line-number"] = this.sourceCodeLocation.lineNumber;
    287         cookie["breakpoint-column-number"] = this.sourceCodeLocation.columnNumber;
    288     }
    289 
    290     serializeOptions()
    291     {
    292         return {
    293             condition: this._condition,
    294             ignoreCount: this._ignoreCount,
    295             actions: this._actions.map((action) => action.toJSON()),
    296             autoContinue: this._autoContinue,
    297         };
    298     }
    299 
    300     toJSON(key)
    301     {
    302         // The id, scriptIdentifier, target, and resolved state are tied to the current session, so don't include them for serialization.
    303         let json = {
    304             contentIdentifier: this._contentIdentifier,
    305             lineNumber: this._sourceCodeLocation.lineNumber,
    306             columnNumber: this._sourceCodeLocation.columnNumber,
    307             disabled: this._disabled,
    308             ...this.serializeOptions(),
    309         };
    310         if (key === WI.ObjectStore.toJSONSymbol)
    311             json[WI.objectStores.breakpoints.keyPath] = this._contentIdentifier + ":" + this._sourceCodeLocation.lineNumber + ":" + this._sourceCodeLocation.columnNumber;
    312         return json;
     293        cookie["breakpoint-content-identifier"] = this._contentIdentifier;
     294        cookie["breakpoint-line-number"] = this._sourceCodeLocation.lineNumber;
     295        cookie["breakpoint-column-number"] = this._sourceCodeLocation.columnNumber;
    313296    }
    314297
     
    326309
    327310    // Private
     311
     312    _isSpecial()
     313    {
     314        return this._sourceCodeLocation.isEqual(new WI.SourceCodeLocation(null, Infinity, Infinity));
     315    }
    328316
    329317    _sourceCodeLocationLocationChanged(event)
  • trunk/Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js

    r243226 r243727  
    2626WI.BreakpointAction = class BreakpointAction
    2727{
    28     constructor(breakpoint, typeOrInfo, data)
     28    constructor(breakpoint, type, data)
    2929    {
    30         console.assert(breakpoint);
    31         console.assert(typeOrInfo);
     30        console.assert(breakpoint instanceof WI.Breakpoint);
     31        console.assert(Object.values(WI.BreakpointAction.Type).includes(type));
    3232
    3333        this._breakpoint = breakpoint;
     34        this._type = type;
     35        this._data = data || null;
     36        this._id = WI.debuggerManager.nextBreakpointActionIdentifier();
     37    }
    3438
    35         if (typeof typeOrInfo === "string") {
    36             this._type = typeOrInfo;
    37             this._data = data || null;
    38         } else if (typeof typeOrInfo === "object") {
    39             this._type = typeOrInfo.type;
    40             this._data = typeOrInfo.data || null;
    41         } else
    42             console.error("Unexpected type passed to WI.BreakpointAction");
     39    // Import / Export
    4340
    44         console.assert(typeof this._type === "string");
    45         this._id = WI.debuggerManager.nextBreakpointActionIdentifier();
     41    static fromJSON(json, breakpoint)
     42    {
     43        return new BreakpointAction(breakpoint, json.type, json.data);
     44    }
     45
     46    toJSON()
     47    {
     48        let json = {
     49            type: this._type,
     50        };
     51        if (this._data)
     52            json.data = this._data;
     53        return json;
    4654    }
    4755
     
    6775    }
    6876
    69     toJSON()
     77    toProtocol()
    7078    {
    71         let json = {
    72             type: this._type,
    73             id: this._id,
    74         };
    75         if (this._data)
    76             json.data = this._data;
     79        let json = this.toJSON();
     80        json.id = this._id;
    7781        return json;
    7882    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r243715 r243727  
    561561    _addBreakpointsForSourceCode(sourceCode)
    562562    {
    563         var breakpoints = WI.debuggerManager.breakpointsForSourceCode(sourceCode);
    564         for (var i = 0; i < breakpoints.length; ++i)
    565             this._addBreakpoint(breakpoints[i], sourceCode);
     563        for (let breakpoint of WI.debuggerManager.breakpointsForSourceCode(sourceCode))
     564            this._addBreakpoint(breakpoint, sourceCode);
    566565    }
    567566
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

    r242049 r243727  
    500500            this._breakpointMap = {};
    501501
    502             var breakpoints = WI.debuggerManager.breakpointsForSourceCode(this._sourceCode);
    503             for (var i = 0; i < breakpoints.length; ++i) {
    504                 var breakpoint = breakpoints[i];
     502            for (let breakpoint of WI.debuggerManager.breakpointsForSourceCode(this._sourceCode)) {
    505503                console.assert(this._matchesBreakpoint(breakpoint));
    506504                var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
     
    563561        console.assert(this._supportsDebugging);
    564562
    565         var breakpoints = WI.debuggerManager.breakpointsForSourceCode(this._sourceCode);
    566         for (var breakpoint of breakpoints)
     563        for (let breakpoint of WI.debuggerManager.breakpointsForSourceCode(this._sourceCode))
    567564            this._updateBreakpointStatus(breakpoint);
    568565    }
Note: See TracChangeset for help on using the changeset viewer.