[Webkit-unassigned] [Bug 221184] New: window.onerror error object (fifth parameter) should ALWAYS have @ deliminator
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Jan 31 02:25:08 PST 2021
https://bugs.webkit.org/show_bug.cgi?id=221184
Bug ID: 221184
Summary: window.onerror error object (fifth parameter) should
ALWAYS have @ deliminator
Product: WebKit
Version: Safari 14
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jab_creations at yahoo.com
The error object (the fifth parameter for the window.onerror event handler) should ALWAYS return an @ deliminator. Because WebKit/Safari doesn't in order to parse and clean up the error details for proper error reporting developers have to add pointless additional logic. Gecko browsers always use the @ deliminator; if no function is used the deliminator[0] index is simply empty though the deliminator[1] index is the same for all stack trace indexes. This would make the error object compatible with existing browser engines and likely the only need is to remove whatever excessive logic exists in the code that conditionally outputs the @ deliminator so this should be easy for someone familiar with the engine to fix.
The general overview of what is happening plus a prerequisite function for my platform:
function array_remove_empty(a)
{
var k = [];
for (var i = 0; i < a.length; i++) {if (a[i] == '') {k.push(i);}}
var r = array_remove_keys(a,k);
return r;
}
window.onerror = function(msg,url,line,col,error)
{
a = array_trim(array_remove_empty(a.split('\n').reverse()));
console.log(a);
}
The text string output:
0 "http://1.0.0.1/scripts/index.js?1612087732:7859:96"
1 "window_onload at http://1.0.0.1/scripts/index.js?1612087732:7368:5"
2 "az19 at http://1.0.0.1/scripts/index.js?1612087732:7364:9"
As demonstrated [0] index lacks the @ deliminator creating pointless complications. Tested with the latest version of Safari 14 as of 2021-01-31.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210131/3c2d100b/attachment.htm>
More information about the webkit-unassigned
mailing list