Merge lp:~sidnei/lazr-js/prefetch into lp:lazr-js
Proposed by
Sidnei da Silva
Status: | Merged |
---|---|
Approved by: | Māris Fogels |
Approved revision: | 188 |
Merged at revision: | 188 |
Proposed branch: | lp:~sidnei/lazr-js/prefetch |
Merge into: | lp:lazr-js |
Diff against target: |
92 lines (+87/-0) 1 file modified
src-js/lazrjs/loader/prefetch.js (+87/-0) |
To merge this branch: | bzr merge lp:~sidnei/lazr-js/prefetch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Review via email: mp+36710@code.launchpad.net |
Description of the change
This is a copy of the refactored prefetch code from Landscape. It can be used to defer calls to use() until one or more combo files containing YUI modules are loaded (in parallel!) so that the YUI loader doesn't try to re-fetch them.
To post a comment you must log in.
Hi Sidnei,
This branch looks good. I think you have an indentation error on line 21, and another error on line 24. Instead of this:
15 +YUI.prototype. prefetch = function prefetch() {
16 + var Y = this,
17 + deferred = [],
18 + preload = arguments,
19 + pending = arguments.length;
20 +
21 + var YArray = Y.Array,
22 + YGet_script = Y.Get.script;
23 +
24 + /**
It should be this:
15 +YUI.prototype. prefetch = function prefetch() {
16 + var Y = this,
17 + deferred = [],
18 + preload = arguments,
19 + pending = arguments.length;
20 +
21 + var YArray = Y.Array, <== Indented
22 + YGet_script = Y.Get.script;
23 +
24 + /** <== Indented
Besides that, this code looks good. r=mars