Bug 1579994 - Handle null source value in prettyPrint r=davidwalsh
authorAlex Rosenfeld <arosenfeld2003@mac.com>
Mon, 23 Sep 2019 01:12:05 +0000
changeset 494458 cb54e53665dec89e689176aa5100120747ba2408
parent 494457 8d46f84b818dce78694859a991f328f2960cdc4e
child 494459 69574a70c39f5ab22dbdd7f8535ed33599e22134
push id36607
push usermalexandru@mozilla.com
push dateMon, 23 Sep 2019 09:48:00 +0000
treeherdermozilla-central@07eb2cc7e1c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidwalsh
bugs1579994
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1579994 - Handle null source value in prettyPrint r=davidwalsh use the source id to create a url when pretty printing if the url is null. Differential Revision: https://phabricator.services.mozilla.com/D46634
devtools/client/debugger/src/actions/sources/prettyPrint.js
--- a/devtools/client/debugger/src/actions/sources/prettyPrint.js
+++ b/devtools/client/debugger/src/actions/sources/prettyPrint.js
@@ -58,17 +58,17 @@ export async function prettyPrintSource(
     text: code,
     contentType: "text/javascript",
   };
 }
 
 export function createPrettySource(cx: Context, sourceId: string) {
   return async ({ dispatch, getState, sourceMaps }: ThunkArgs) => {
     const source = getSourceFromId(getState(), sourceId);
-    const url = getPrettySourceURL(source.url);
+    const url = getPrettySourceURL(source.url || source.id);
     const id = generatedToOriginalId(sourceId, url);
 
     const prettySource = {
       id,
       url,
       relativeUrl: url,
       isBlackBoxed: false,
       isPrettyPrinted: true,