summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2007-09-10 10:01:58 +0000
committerThomas BrĂ¼derli2007-09-10 10:01:58 +0000
commit0d050f9631d411cd4bdec0a26a9d005349464395 (patch)
tree651271c61f062969da4796822101d0c30fd41cc4
parentda11d93152ef0d6e562856029cb11b12f8b8b7d6 (diff)
downloaditools-0d050f9631d411cd4bdec0a26a9d005349464395.tar.gz
itools-0d050f9631d411cd4bdec0a26a9d005349464395.tar.bz2
itools-0d050f9631d411cd4bdec0a26a9d005349464395.zip
Flags to locate script errors
-rw-r--r--itjs/boot.js10
-rw-r--r--itjs/loader.js8
2 files changed, 17 insertions, 1 deletions
diff --git a/itjs/boot.js b/itjs/boot.js
index 311f28e..32c8578 100644
--- a/itjs/boot.js
+++ b/itjs/boot.js
@@ -20,6 +20,11 @@ function it_catcherr(msg, url, line)
}
}
+ if (typeof it_boot.sequence != 'undefined')
+ stacktrace += "it_boot=" + it_boot.sequence + ";";
+ if (typeof window.it_loader != 'undefined')
+ stacktrace += "it_loader=" + it_loader.sequence + ";";
+
it_boot_report(msg, url, line, stacktrace);
return !window.env || !!window.env.is_live_server; // No env or live server -> suppress error
@@ -87,6 +92,8 @@ function it_boot_init()
function it_boot(file, isretry)
{
+ it_boot.sequence = isretry ? "r" : "b";
+
try
{
var loader = new XMLHttpRequest();
@@ -112,11 +119,14 @@ function it_boot(file, isretry)
{
if (loader.responseText.length && loader.responseText.lastIndexOf('it_boot_init()') > 0)
{
+ it_boot.sequence += "e";
var code = "try {" + loader.responseText + "} catch (e) { it_boot_report('Script exec error', '-', -1, e); }"; // Wrapped in try/catch as Konqueror does not support window.onerror
if (window.execScript)
window.execScript(code, "javascript"); // IE work-around to get script executed in global scope
else
window.setTimeout(code, 0); // Standard compliant version
+
+ window.setTimeout('it_boot.sequence = "";', 50);
}
else
error = "Incomplete script load @ status " + loader.status;
diff --git a/itjs/loader.js b/itjs/loader.js
index 6efdbee..3735bca 100644
--- a/itjs/loader.js
+++ b/itjs/loader.js
@@ -165,6 +165,7 @@ post: function(baseurl, data)
readyStateChanged: function()
{
var loader = this.loader; // Avoid race conditions
+ it_loader.sequence += "r";
if (loader && (loader.readyState == 4))
{
@@ -199,6 +200,7 @@ dataReady: function(data, callid)
{
var fixkonqueror33gcbug = this.loader;
var loadtime = new Date().getTime() - this.starttime;
+ it_loader.sequence += "e";
this.loader = null;
@@ -228,6 +230,8 @@ dataReady: function(data, callid)
if (!this.attr.eof && (this.end < this.pos + this.num))
this.load(this.baseurl, this.end, this.pos + this.num - this.end);
+
+ it_loader.sequence += "h";
}
this.unlink();
@@ -257,10 +261,12 @@ unlink: function()
document.body.removeChild(this.scrpt);
this.scrpt = null;
}
+
+ it_loader.sequence = "";
}/* NO COMMA */
}
// static properties
it_loader.instances = 0;
-
+it_loader.sequence = "";