repo.or.cz
/
chromium-blink-merge.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git]
/
chrome
/
test
/
data
/
third_party
/
spaceport
/
js
/
util
/
chainAsync.js
blob
50a180a37718c621524cc8cc8eb0cca6460034d7
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
});