Skip to content

Commit d12935b

Browse files
committed
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.
1 parent e6bc01c commit d12935b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎require.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ var require;
562562
if (!context.specified[dep.fullName]) {
563563
context.specified[dep.fullName] = true;
564564

565+
//Reset the start time to use for timeouts
566+
context.startTime = (new Date()).getTime();
567+
565568
//If a plugin, call its load method.
566569
if (dep.prefix) {
567570
//>>excludeStart("requireExcludePlugin", pragmas.requireExcludePlugin);
@@ -709,7 +712,6 @@ var require;
709712
require.attach(url, contextName, moduleName);
710713
urlFetched[url] = true;
711714
}
712-
context.startTime = (new Date()).getTime();
713715
//>>excludeStart("requireExcludeContext", pragmas.requireExcludeContext);
714716
}
715717
//>>excludeEnd("requireExcludeContext");
@@ -913,6 +915,7 @@ var require;
913915
err = new Error("require.js load timeout for modules: " + noLoads);
914916
err.requireType = "timeout";
915917
err.requireModules = noLoads;
918+
throw err;
916919
}
917920
if (stillLoading) {
918921
//Something is still waiting to load. Wait for it.

0 commit comments

Comments
 (0)