Fix a failure case in pluginloader where an onerror callback was not being set.
Probably is never triggered... Might as well though. (cherry picked from commit c2a6ba1cb8c7d004b44bb6b825017f30bf403d54) Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/e4193f9c Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/e4193f9c Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/e4193f9c Branch: refs/heads/2.9.x Commit: e4193f9c6f769f9ab719980337a26ee756e8d039 Parents: a1ff039 Author: Andrew Grieve <[email protected]> Authored: Tue Jul 9 23:03:06 2013 -0400 Committer: Andrew Grieve <[email protected]> Committed: Tue Oct 22 11:35:37 2013 -0400 ---------------------------------------------------------------------- lib/common/pluginloader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/e4193f9c/lib/common/pluginloader.js ---------------------------------------------------------------------- diff --git a/lib/common/pluginloader.js b/lib/common/pluginloader.js index 4b5955d..7341e14 100644 --- a/lib/common/pluginloader.js +++ b/lib/common/pluginloader.js @@ -38,7 +38,7 @@ function injectScript(url, onload, onerror) { var script = document.createElement("script"); // onload fires even when script fails loads with an error. script.onload = onload; - script.onerror = onerror; + script.onerror = onerror || onload; script.src = url; document.head.appendChild(script); }
