8000 Some extra info in the noload test. · xcoderzach/requirejs@fed6053 · GitHub
[go: up one dir, main page]

Skip to content

Commit fed6053

Browse files
committed
Some extra info in the noload test.
1 parent 0750df8 commit fed6053

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tests/browsertests/noload/index.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,38 @@
1212
if (evt.type === "load" || readyRegExp.test(node.readyState)) {
1313
log(node.getAttribute("data-name") + " loaded");
1414

15+
/* Comment out for now, make sure we get all events for test
1516
//Clean up binding.
1617
if (node.removeEventListener) {
1718
node.removeEventListener("load", onTestScriptLoad, false);
1819
} else {
1920
//Probably IE.
2021
node.detachEvent("onreadystatechange", onTestScriptLoad);
2122
}
23+
*/
2224
}
2325
}
2426

2527
function onTestError(evt) {
2628
var node = evt.target || evt.srcElement,
2729
name = node.getAttribute("data-name");
2830

29-
if (typeof console !== "undefined" && console.log) {
30-
console.log(name + ' has error event: ', evt);
31-
}
31+
//if (typeof console !== "undefined" && console.log) {
32+
// console.log(name + ' has error event: ', evt);
33+
//}
34+
35+
log(name + " ONERROR triggered");
3236

33-
log(name + " onerror triggered");
3437

38+
/* Comment out for now, make sure we get all events for test
3539
//Clean up binding.
3640
if (node.removeEventListener) {
3741
node.removeEventListener("error", onTestError, false);
3842
} else {
3943
//Probably IE.
4044
node.detachEvent("onerror", onTestError);
4145
}
46+
*/
4247
}
4348

4449
function attachScript(url, name) {
@@ -80,8 +85,10 @@ <h1>Script noload Test</h1>
8085

8186
<p>For this test to receive 500 responses, nodejs needs to run server.js in this directory.</p>
8287

83-
<p>Output below should be "404 onerror triggered", "500 onerror triggered" and "no server onerror triggered".
84-
They may be in a different order, but that is OK.</p>
88+
<p>Output (normally shown in the console) should be "404 ONERROR triggered", "500 ONERROR triggered"
89+
and "no server ONERROR triggered".
90+
They may be in a different order, but that is OK. If items like "404 loaded" are seend, then
91+
it means the error handler was not triggered, which is undesirable.</p>
8592

8693
<p>Unfortunately, IE 6-8 trigger the onreadystate callback, <b>not the error callback</b>,
8794
and given that they execute scripts in a way where the onload for a script is not executed
@@ -91,7 +98,7 @@ <h1>Script noload Test</h1>
9198
<p>If all scripts called define() then the loader would have a chance to determine if
9299
the module was not already loaded or in the context.defQueue (in requirejs). However,
93100
since some scripts can be executed in requirejs without using define, there does not
94-
seem to be a reliable way to tie the error to the event.</p>
101+
seem to be a reliable way to tie the error to the event in IE 6-8.</p>
95102

96103
</body>
97104
</html>

0 commit comments

Comments
 (0)
0