Skip to content

Commit 3a97dc2

Browse files
committed
Bug 1532362 - Lookup sources by actor URL instead of source URL, r=lsmyth.
UltraBlame original commit: a52dffe6d7beee0a0ad9dca59ab504593018d00d
1 parent 4d8ed25 commit 3a97dc2

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

devtools/client/debugger/new/test/mochitest/browser.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ support-files =
657657
examples/simple-worker.js
658658
examples/doc-event-handler.html
659659
examples/doc-eval-throw.html
660+
examples/doc-sourceURL-breakpoint.html
660661

661662
[browser_dbg-asm.js]
662663
[browser_dbg-async-stepping.js]
@@ -774,3 +775,4 @@ skip-if = true
774775
[browser_dbg-windowless-workers-early-breakpoint.js]
775776
[browser_dbg-event-handler.js]
776777
[browser_dbg-eval-throw.js]
778+
[browser_dbg-sourceURL-breakpoint.js]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
4+
5+
add_task(async function() {
6+
const dbg = await initDebugger("doc-sourceURL-breakpoint.html", "my-foo.js");
7+
await addBreakpoint(dbg, "my-foo.js", 2);
8+
9+
invokeInTab("foo");
10+
await waitForPaused(dbg);
11+
12+
ok(true, "paused at breakpoint");
13+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<body>
2+
<script>
3+
var script = `function foo() {
4+
console.log('called foo');
5+
}
6+
//# sourceURL=my-foo.js`;
7+
eval(script);
8+
</script>
9+
</body>

devtools/server/actors/utils/TabSources.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ TabSources.prototype = {
173173
getSourceActorsByURL: function(url) {
174174
const rv = [];
175175
if (url) {
176-
for (const [source, actor] of this._sourceActors) {
177-
if (source.url === url) {
176+
for (const [, actor] of this._sourceActors) {
177+
if (actor.url === url) {
178178
rv.push(actor);
179179
}
180180
}

0 commit comments

Comments
 (0)