Bug 1532362 - Lookup sources by actor URL instead of source URL, r=lsmyth.

This commit is contained in:
Brian Hackett 2019-03-07 06:41:25 -10:00
Родитель ab6b030e03
Коммит cffc603b55
4 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@ -657,6 +657,7 @@ support-files =
examples/simple-worker.js
examples/doc-event-handler.html
examples/doc-eval-throw.html
examples/doc-sourceURL-breakpoint.html
[browser_dbg-asm.js]
[browser_dbg-async-stepping.js]
@ -774,3 +775,4 @@ skip-if = true
[browser_dbg-windowless-workers-early-breakpoint.js]
[browser_dbg-event-handler.js]
[browser_dbg-eval-throw.js]
[browser_dbg-sourceURL-breakpoint.js]

Просмотреть файл

@ -0,0 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test that breakpoints are hit in eval'ed sources with a sourceURL property.
add_task(async function() {
const dbg = await initDebugger("doc-sourceURL-breakpoint.html", "my-foo.js");
await selectSource(dbg, "my-foo.js");
await addBreakpoint(dbg, "my-foo.js", 2);
invokeInTab("foo");
await waitForPaused(dbg);
ok(true, "paused at breakpoint");
});

Просмотреть файл

@ -0,0 +1,9 @@
<body>
<script>
var script = `function foo() {
console.log('called foo');
}
//# sourceURL=my-foo.js`;
eval(script);
</script>
</body>

Просмотреть файл

@ -173,8 +173,8 @@ TabSources.prototype = {
getSourceActorsByURL: function(url) {
const rv = [];
if (url) {
for (const [source, actor] of this._sourceActors) {
if (source.url === url) {
for (const [, actor] of this._sourceActors) {
if (actor.url === url) {
rv.push(actor);
}
}