Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 2c77f72

Browse files
committed
Bug 1532362 - Lookup sources by actor URL instead of source URL, r=lsmyth.
--HG-- extra : rebase_source : ed338e0539445ee5ec0bc34c92b0a150e69634ce
1 parent add5cee commit 2c77f72

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+
/* Any copyright is dedicated to the Public Domain.
2+
* http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
// Test that breakpoints are hit in eval'ed sources with a sourceURL property.
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)