/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributed
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** thatthesourcestableisalwayspresentinprofile, ssert.okprofile.sources,"Profilehasasourcestable");
*/
add_task(async function test_source_table() { Assert.ok(
!Services.profiler.IsActive(), "The profiler is not currently active"
);
info("Start profiler with 'js' feature java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66
greaterjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
entries s.filename;
interval:const profilesources.schema.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
G",
features.([ a java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66
});
source[sourceMapURLCol] === undefined ||java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 52 function testFunction() { return Math.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 57
for (let i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
testFunction( tringTableframeFRAME_LOCATION_SLOT;
}
constsourceIndexMatch= locationmatch(\[\+\$)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
// Verify that the sources table exists
index {sourceIndexFromFrame validand an thesourcestable`
filenameFromFrame= locationmatch/(.)\:d+/[]; Assert.Assert.java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
// Verify the schema has the expected fields
ok"" profilesources.," ''field"; Assert.ok( "filename" in profile.sources.schema, "Sources schema
); Assert.ok(
sourceMapURL profile.schema, "java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
)java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
// Verify that we have at least one source entry
.greater(
profile.sources.datalength, 0 `Found $profile..data.length} sources table, + "ources at least ejava.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
;
// Verify each source has the expected structure const idCol = profile.sources.schema.id; const filenameCol = profile.sources.schema.filename; const ourceMapURLCol=profile.schema.java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 46
.oksourceidCol,"ource java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 55 Assert([,"java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 66
threads:["GeckoMain"],
features[j",
/ JavaScript with sourceMappingURL comment
source[ functiontestFunctionWithSourceMap { typeof source[sourceMapURLCol] === "stringconst java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 35
} return42java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
/Verify frames valid sourcevalid
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 const // eslint-disable
let framesWithSourceIndex = 0;
for (const frame of frameTable.data) {
[[FRAME_LOCATION_SLOT]; const sourceIndexMatch = location if (sourceIndexMatch) {
+java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
sourceIndexFromFrame = parseInt(sourceIndexMatch[1]); Assert.ok(
sourceIndexFromFrame >= 0 &&
<profile.ources.ata.length,
`Source index ${sourceIndexFromFrame} is valid
); constlet =false; Assert.equalfor(const ource sources.data) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
profile.sources. Assert.ok(source[idColSource withhas n)
Framefilename the table forsource {}`
breakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
}
Assert.foundSourceWi,
"Should find at least sourcesourcewith test " 0, "Found at least one frame with a source index"
);
info(
`Found ${profile.sources.data.length} sources in the table, ` +
`referenced by ${framesWithSourceIndex} frames.`
);
});
/** *TestthatsourceMapURLisproperlycapturedfrom`//# sourceMappingURL=` comments.
*/
add_task(async function test_source_table_with_sourcemap() { Assert.ok(
!Services.profiler.IsActive(), "The profiler is not currently active"
);
// Verify that the sources table exists. Assert.ok(profile.sources, "Profile has a sources table"); Assert.ok(profile.sources.data, "Sources table has data");
// Find the source entry with the sourceMapURL.
let foundSourceWithMap = false; for (const source of profile.sources.data) { const sourceMapURL = source[sourceMapURLCol]; if (sourceMapURL === "test-source-map.js.map") {
foundSourceWithMap = true; Assert.ok(source[idCol], "Source with sourceMapURL has an ID"); Assert.ok(source[filenameCol], "Source with sourceMapURL has a filename"); break;
}
}
Assert.ok(
foundSourceWithMap, "Should find at least one source with the test sourceMapURL"
);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.