Skip to content

Commit

Permalink
loader_type_bundle: success callback shouldn't be applied after error
Browse files Browse the repository at this point in the history
  • Loading branch information
dfilatov committed Feb 13, 2015
1 parent 69cdecf commit da5fdb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common.blocks/loader/_type/loader_type_bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ var LOADING_TIMEOUT = 20000,
bundles = {},

handleError = function(bundleId) {
var bundleDesc = bundles[bundleId],
fns = bundleDesc.errorFns, fn;
var bundleDesc = bundles[bundleId];

if(!bundleDesc) return;

var fns = bundleDesc.errorFns,
fn;

clearTimeout(bundleDesc.timer);

Expand Down Expand Up @@ -73,6 +77,8 @@ var LOADING_TIMEOUT = 20000,
load._loaded = function(bundle) {
var bundleDesc = bundles[bundle.id];

if(!bundleDesc) return;

clearTimeout(bundleDesc.timer);

bundle.js && bundle.js.call(global);
Expand Down

0 comments on commit da5fdb9

Please sign in to comment.