WebKit Bugzilla
Attachment 369056 Details for
Bug 196662
: Web Inspector: Uncaught Exception: null is not an object (evaluating 'url.startsWith')
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-196662-20190503223929.patch (text/plain), 4.49 KB, created by
Devin Rousso
on 2019-05-03 22:39:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-05-03 22:39:30 PDT
Size:
4.49 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 97206c896b10ddf3ad958b68b3f8bce3e8085713..5cee040c748cab81e6a15eeab9ff46159d2ac676 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,21 @@ >+2019-05-03 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Uncaught Exception: null is not an object (evaluating 'url.startsWith') >+ https://bugs.webkit.org/show_bug.cgi?id=196662 >+ <rdar://problem/49659633> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/ConsoleMessageView.js: >+ (WI.ConsoleMessageView.prototype._appendLocationLink): >+ (WI.ConsoleMessageView.prototype._linkifyLocation): Deleted. >+ >+ * UserInterface/Base/Main.js: >+ (WI.linkifyLocation): >+ (WI.linkifySourceCode): Added. >+ Split the logic into two functions, as there's no need to re-fetch the `SourceCode` from a >+ given url if you already have the `SourceCode` in the caller. >+ > 2019-05-03 Devin Rousso <drousso@apple.com> > > Web Inspector: DOM: rename "low power" to "display composited" >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index 0875955f1f4db37a2e2332b8f50f17cbf5c09ecc..625dd8c4df9cbaf3e7a98e9315f23004d892cb36 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -2849,17 +2849,20 @@ WI.createSourceCodeLocationLink = function(sourceCodeLocation, options = {}) > WI.linkifyLocation = function(url, sourceCodePosition, options = {}) > { > var sourceCode = WI.sourceCodeForURL(url); >+ if (sourceCode) >+ return WI.linkifySourceCode(sourceCode); > >- if (!sourceCode) { >- var anchor = document.createElement("a"); >- anchor.href = url; >- anchor.lineNumber = sourceCodePosition.lineNumber; >- if (options.className) >- anchor.className = options.className; >- anchor.append(WI.displayNameForURL(url) + ":" + sourceCodePosition.lineNumber); >- return anchor; >- } >+ var anchor = document.createElement("a"); >+ anchor.href = url; >+ anchor.lineNumber = sourceCodePosition.lineNumber; >+ if (options.className) >+ anchor.className = options.className; >+ anchor.append(WI.displayNameForURL(url) + ":" + sourceCodePosition.lineNumber); >+ return anchor; >+}; > >+WI.linkifySourceCode = function(sourceCode, sourceCodePosition, options = {}) >+{ > let sourceCodeLocation = sourceCode.createSourceCodeLocation(sourceCodePosition.lineNumber, sourceCodePosition.columnNumber); > let linkElement = WI.createSourceCodeLocationLink(sourceCodeLocation, { > ...options, >diff --git a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >index 23ac06cf9a8971530e86de37cdd18e9151f8523c..171de06cfffc4d7fb68919bc6252d6cae0b78a44 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >@@ -376,7 +376,12 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > if (result === WI.RemoteObject.SourceCodeLocationPromise.NoSourceFound || result === WI.RemoteObject.SourceCodeLocationPromise.MissingObjectId) > return; > >- var link = this._linkifyLocation(result.sourceCode.sourceURL || result.sourceCode.url, result.lineNumber, result.columnNumber); >+ const options = { >+ className: "console-message-url", >+ ignoreNetworkTab: true, >+ ignoreSearchTab: true, >+ }; >+ let link = WI.linkifySourceCode(result.sourceCode, new WI.SourceCodePosition(result.lineNumber, result.columnNumber), options); > link.classList.add("console-message-location"); > > if (this._element.hasChildNodes()) >@@ -766,16 +771,6 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > return url === "undefined" || url === "[native code]"; > } > >- _linkifyLocation(url, lineNumber, columnNumber) >- { >- const options = { >- className: "console-message-url", >- ignoreNetworkTab: true, >- ignoreSearchTab: true, >- }; >- return WI.linkifyLocation(url, new WI.SourceCodePosition(lineNumber, columnNumber), options); >- } >- > _userProvidedColumnNames(columnNamesArgument) > { > if (!columnNamesArgument)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 196662
:
369056
|
369057
|
369068