Bug 150913 - Web Inspector: Uncaught Exception opening inspector - TypeError: Attempted to assign to readonly property.
Summary: Web Inspector: Uncaught Exception opening inspector - TypeError: Attempted to...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Other
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-11-04 17:04 PST by Joseph Pecoraro
Modified: 2015-11-04 20:08 PST (History)
8 users (show)

See Also:


Attachments
[Patch] Proposed Fix (2.11 KB, patch)
2015-11-04 19:18 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-11-04 17:04:36 PST
* SUMMARY
Uncaught Exception opening inspector - TypeError: Attempted to assign to readonly property.

* EXCEPTION
TypeError: Attempted to assign to readonly property.
    replaceContentView — ContentViewContainer.js:229
    _resourceTypeDidChange — ResourceClusterContentView.js:248
    dispatch — Object.js:155
    dispatchEventToListeners — Object.js:162
    associateWithScript — Resource.js:653
    Script — Script.js:42
    scriptDidParse — DebuggerManager.js:531
    scriptParsed — DebuggerObserver.js:37
    dispatchEvent — InspectorBackend.js:382
    _dispatchEvent — InspectorBackend.js:281
    dispatch — InspectorBackend.js:89
    dispatchNextQueuedMessageFromBackend — MessageDispatcher.js:42

* NOTES
BackForwardEntry.js has a "get contentView()" but no "set contentView(x)" so this looks legit.

        // Replace all occurrences of oldContentView with newContentView in the back/forward list.
        for (var i = 0; i < this._backForwardList.length; ++i) {
            if (this._backForwardList[i].contentView === oldContentView)
                this._backForwardList[i].contentView = newContentView; // <-- attempting to set content view.
        }
Comment 1 Radar WebKit Bug Importer 2015-11-04 17:05:27 PST
<rdar://problem/23404728>
Comment 2 Matt Baker 2015-11-04 18:12:08 PST
A BackForwardEntry associates a ContentView with a cookie, so having a contentView setter seems like the wrong thing to do. What we probably want is:

// Replace all occurrences of oldContentView with newContentView in the back/forward list.
for (var i = 0; i < this._backForwardList.length; ++i) {
    if (this._backForwardList[i].contentView === oldContentView)
        this._backForwardList[i] = new WebInspector.BackForwardEntry(newContentView, newCookie);
}
Comment 3 Timothy Hatcher 2015-11-04 19:09:11 PST
Looks right to me. Good catch.
Comment 4 Matt Baker 2015-11-04 19:18:22 PST
Created attachment 264836 [details]
[Patch] Proposed Fix
Comment 5 WebKit Commit Bot 2015-11-04 20:08:46 PST
Comment on attachment 264836 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 264836

Committed r192049: <http://trac.webkit.org/changeset/192049>
Comment 6 WebKit Commit Bot 2015-11-04 20:08:50 PST
All reviewed patches have been landed.  Closing bug.