- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / third_party / spaceport / js / util / chainAsync.js
1 define([ ], function () {
2     return function chainAsync(functions) {
3         functions = functions.slice();
4
5         function next() {
6             if (functions.length === 0) {
7                 return;
8             }
9
10             var fn = functions.shift();
11             fn(function () {
12                 setTimeout(next, 0);
13             });
14         }
15
16         setTimeout(next, 0);
17     };
18 });