Browse Source

Clean api directly before call.

It can contain deps' exports.
Herby Vojčík 3 years ago
parent
commit
dab73b932b
2 changed files with 2 additions and 2 deletions
  1. 1 1
      amd/brikz.js
  2. 1 1
      brikz.js

+ 1 - 1
amd/brikz.js

@@ -34,10 +34,10 @@ define([], function () {
             function ensure(key) {
                 var b = brikz[key],
                     bak = backup[key];
-                mixin(null, api, api);
                 while (typeof b === "function") {
                     (b.deps || []).forEach(ensure);
                     b[backupKey] = bak;
+                    mixin(null, api, api);
                     b = new b(brikz, api);
                 }
                 brikz[key] = b;

+ 1 - 1
brikz.js

@@ -33,10 +33,10 @@ function Brikz(api, apiKey, initKey, backupKey) {
         function ensure(key) {
             var b = brikz[key],
                 bak = backup[key];
-            mixin(null, api, api);
             while (typeof b === "function") {
                 (b.deps || []).forEach(ensure);
                 b[backupKey] = bak;
+                mixin(null, api, api);
                 b = new b(brikz, api);
             }
             brikz[key] = b;