mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-20 10:50:25 +00:00
Previously, when `WindowOrWorkerGlobalScope.reportError()` was called the `filename` property of the dispatched error event was blank. It is now populated with the full path of the active script.
18 lines
774 B
HTML
18 lines
774 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
window.onerror = (message, filename, lineno, colno, error) => {
|
|
println(`message = ${message}`);
|
|
println(`lineno = ${lineno}`);
|
|
println(`colno = ${colno}`);
|
|
println(`error = ${error}`);
|
|
// We can't simply print the filename because it is the full path to the active script, which varies between machines.
|
|
const filenameURL = new URL(filename);
|
|
println(`filename URL scheme = ${filenameURL.protocol}`);
|
|
println(`filename URL final path segment = ${filenameURL.pathname.split('/').pop()}`);
|
|
return true;
|
|
};
|
|
|
|
window.reportError(new Error('Reporting an Error!'));
|
|
});
|
|
</script>
|