Permalink
Browse files

Fix an issue where 3 text plugin files were loaded after initial page…

… load. The reset of the timeout time was only done in the normal require.load function not in the load functions for plugins, so essentially a timeout happened on the 3 files. However, the timeout block did not actually throw the timeout error, so the normal callback paths were followed leading to weird behavior. This issues affects anything where just plugin resources are loaded after page load. If just one normal JS resource is loaded things are OK.
  • Loading branch information...
jrburke committed Aug 3, 2010
1 parent e6bc01c commit d12935bac803bcd5981652584102282b69fdd7b1
Showing with 4 additions and 1 deletion.
  1. +4 −1 require.js
View
@@ -562,6 +562,9 @@ var require;
if (!context.specified[dep.fullName]) {
context.specified[dep.fullName] = true;
//Reset the start time to use for timeouts
context.startTime = (new Date()).getTime();
//If a plugin, call its load method.
if (dep.prefix) {
//>>excludeStart("requireExcludePlugin", pragmas.requireExcludePlugin);
@@ -709,7 +712,6 @@ var require;
require.attach(url, contextName, moduleName);
urlFetched[url] = true;
}
context.startTime = (new Date()).getTime();
//>>excludeStart("requireExcludeContext", pragmas.requireExcludeContext);
}
//>>excludeEnd("requireExcludeContext");
@@ -913,6 +915,7 @@ var require;
err = new Error("require.js load timeout for modules: " + noLoads);
err.requireType = "timeout";
err.requireModules = noLoads;
throw err;
}
if (stillLoading) {
//Something is still waiting to load. Wait for it.

0 comments on commit d12935b

Please sign in to comment.