mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1206247 - Do not collect coverage information if the source has no filename. r=bhackett
This commit is contained in:
parent
1aefe3b946
commit
3f0b55db0b
4
js/src/jit-test/tests/coverage/bug1206247.js
Normal file
4
js/src/jit-test/tests/coverage/bug1206247.js
Normal file
@ -0,0 +1,4 @@
|
||||
evaluate("", {
|
||||
fileName: null
|
||||
});
|
||||
getLcovInfo();
|
@ -1955,8 +1955,12 @@ GenerateLcovInfo(JSContext* cx, JSCompartment* comp, GenericPrinter& out)
|
||||
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
|
||||
for (ZoneCellIter i(zone, AllocKind::SCRIPT); !i.done(); i.next()) {
|
||||
JSScript* script = i.get<JSScript>();
|
||||
if (script->compartment() != comp || !script->isTopLevel())
|
||||
if (script->compartment() != comp ||
|
||||
!script->isTopLevel() ||
|
||||
!script->filename())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!topScripts.append(script))
|
||||
return false;
|
||||
|
@ -326,6 +326,10 @@ LCovCompartment::collectCodeCoverageInfo(JSCompartment* comp, JSObject* sso,
|
||||
void
|
||||
LCovCompartment::collectSourceFile(JSCompartment* comp, ScriptSourceObject* sso)
|
||||
{
|
||||
// Do not add sources if there is no file name associated to it.
|
||||
if (!sso->source()->filename())
|
||||
return;
|
||||
|
||||
// Skip any operation if we already some out-of memory issues.
|
||||
if (outTN_.hadOutOfMemory())
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user