Called when the current pending resource of the specified type has finished loading. Executes the associated callback (if any) and loads the next resource in the queue. @method finish @param {String} type resource type ('css' or 'js') @private
(type)
| 86 | @private |
| 87 | */ |
| 88 | finish(type) { |
| 89 | var p = this.pending[type], |
| 90 | callback, |
| 91 | urls; |
| 92 | |
| 93 | if (p) { |
| 94 | callback = p.callback; |
| 95 | urls = p.urls; |
| 96 | |
| 97 | urls.shift(); |
| 98 | this.pollCount = 0; |
| 99 | |
| 100 | // If this is the last of the pending URLs, execute the callback and |
| 101 | // start the next request in the queue (if any). |
| 102 | if (!urls.length) { |
| 103 | callback && callback.call(p.context, p.obj); |
| 104 | this.pending[type] = null; |
| 105 | this.queue[type].length && this.load(type); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | Populates the <code>env</code> variable with user agent and feature test |
no test coverage detected