diff --git a/devtools/server/actors/common.js b/devtools/server/actors/common.js index 89c6709dac08..d8d4390d5da0 100644 --- a/devtools/server/actors/common.js +++ b/devtools/server/actors/common.js @@ -148,9 +148,7 @@ GeneratedLocation.prototype = { }, get generatedUrl() { - const actor = this.generatedSourceActor; - const source = actor.source; - return source ? source.url : actor._originalUrl; + return this.generatedSourceActor.url; }, get generatedLine() { diff --git a/devtools/server/actors/source.js b/devtools/server/actors/source.js index c8efb8745551..e830b408eb7a 100644 --- a/devtools/server/actors/source.js +++ b/devtools/server/actors/source.js @@ -107,7 +107,7 @@ const SourceActor = ActorClassWithSpec(sourceSpec, { initialize: function({ source, thread, originalUrl, isInlineSource, contentType }) { this._threadActor = thread; - this._originalUrl = originalUrl; + this._url = originalUrl; this._source = source; this._contentType = contentType; this._isInlineSource = isInlineSource; @@ -138,10 +138,13 @@ const SourceActor = ActorClassWithSpec(sourceSpec, { return this.threadActor.breakpointActorMap; }, get url() { - if (this.source) { - return getSourceURL(this.source, this.threadActor._parent.window); + if (this._url) { + return this._url; } - return this._originalUrl; + if (this.source) { + this._url = getSourceURL(this.source, this.threadActor._parent.window); + } + return this._url; }, get isCacheEnabled() {