Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rsvp.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
rsvp.js
Commits
e0d98b1c
Commit
e0d98b1c
authored
Dec 14, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish build version of rsvp.
parent
d58a4846
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
24 deletions
+63
-24
dist/commonjs/rsvp/promise.js
dist/commonjs/rsvp/promise.js
+5
-0
dist/commonjs/rsvp/queue.js
dist/commonjs/rsvp/queue.js
+15
-7
dist/rsvp-2.0.4.amd.js
dist/rsvp-2.0.4.amd.js
+21
-8
dist/rsvp-2.0.4.js
dist/rsvp-2.0.4.js
+21
-8
dist/rsvp-2.0.4.min.js
dist/rsvp-2.0.4.min.js
+1
-1
No files found.
dist/commonjs/rsvp/promise.js
View file @
e0d98b1c
...
@@ -204,6 +204,11 @@ function handleThenable(promise, value) {
...
@@ -204,6 +204,11 @@ function handleThenable(promise, value) {
then
=
value
.
then
;
then
=
value
.
then
;
if
(
isFunction
(
then
))
{
if
(
isFunction
(
then
))
{
if
(
isFunction
(
value
.
on
))
{
value
.
on
(
'
promise:notified
'
,
function
(
event
)
{
notify
(
promise
,
event
.
detail
);
});
}
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
if
(
isFunction
(
value
.
cancel
))
{
if
(
isFunction
(
value
.
cancel
))
{
value
.
cancel
();
value
.
cancel
();
...
...
dist/commonjs/rsvp/queue.js
View file @
e0d98b1c
"
use strict
"
;
"
use strict
"
;
var
Promise
=
require
(
"
./promise
"
).
Promise
;
var
Promise
=
require
(
"
./promise
"
).
Promise
;
var
delay
=
require
(
"
./timeout
"
).
delay
;
var
resolve
=
require
(
"
./resolve
"
).
resolve
;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
function
ResolvedQueueError
(
message
)
{
function
ResolvedQueueError
(
message
)
{
...
@@ -19,6 +19,7 @@ var Queue = function() {
...
@@ -19,6 +19,7 @@ var Queue = function() {
promise
,
promise
,
fulfill
,
fulfill
,
reject
,
reject
,
notify
,
resolved
;
resolved
;
if
(
!
(
this
instanceof
Queue
))
{
if
(
!
(
this
instanceof
Queue
))
{
...
@@ -31,7 +32,7 @@ var Queue = function() {
...
@@ -31,7 +32,7 @@ var Queue = function() {
}
}
}
}
promise
=
new
Promise
(
function
(
done
,
fail
)
{
promise
=
new
Promise
(
function
(
done
,
fail
,
progress
)
{
fulfill
=
function
(
fulfillmentValue
)
{
fulfill
=
function
(
fulfillmentValue
)
{
if
(
resolved
)
{
return
;}
if
(
resolved
)
{
return
;}
queue
.
isFulfilled
=
true
;
queue
.
isFulfilled
=
true
;
...
@@ -46,9 +47,10 @@ var Queue = function() {
...
@@ -46,9 +47,10 @@ var Queue = function() {
resolved
=
true
;
resolved
=
true
;
return
fail
(
rejectedReason
);
return
fail
(
rejectedReason
);
};
};
notify
=
progress
;
},
canceller
);
},
canceller
);
promise_list
.
push
(
delay
());
promise_list
.
push
(
resolve
());
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
...
@@ -69,7 +71,7 @@ var Queue = function() {
...
@@ -69,7 +71,7 @@ var Queue = function() {
return
promise
.
then
.
apply
(
promise
,
arguments
);
return
promise
.
then
.
apply
(
promise
,
arguments
);
};
};
queue
.
push
=
function
(
done
,
fail
)
{
queue
.
push
=
function
(
done
,
fail
,
progress
)
{
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
next_promise
;
next_promise
;
...
@@ -77,11 +79,11 @@ var Queue = function() {
...
@@ -77,11 +79,11 @@ var Queue = function() {
throw
new
ResolvedQueueError
();
throw
new
ResolvedQueueError
();
}
}
next_promise
=
last_promise
.
then
(
done
,
fail
);
next_promise
=
last_promise
.
then
(
done
,
fail
,
progress
);
promise_list
.
push
(
next_promise
);
promise_list
.
push
(
next_promise
);
// Handle pop
// Handle pop
promise_list
.
push
(
next_promise
.
then
(
function
(
fulfillmentValue
)
{
last_promise
=
next_promise
.
then
(
function
(
fulfillmentValue
)
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
fulfill
(
fulfillmentValue
);
fulfill
(
fulfillmentValue
);
...
@@ -95,7 +97,13 @@ var Queue = function() {
...
@@ -95,7 +97,13 @@ var Queue = function() {
}
else
{
}
else
{
throw
rejectedReason
;
throw
rejectedReason
;
}
}
}));
},
function
(
notificationValue
)
{
if
(
promise_list
[
promise_list
.
length
-
1
]
===
last_promise
)
{
notify
(
notificationValue
);
}
return
notificationValue
;
});
promise_list
.
push
(
last_promise
);
return
this
;
return
this
;
};
};
...
...
dist/rsvp-2.0.4.amd.js
View file @
e0d98b1c
...
@@ -631,6 +631,11 @@ define("rsvp/promise",
...
@@ -631,6 +631,11 @@ define("rsvp/promise",
then
=
value
.
then
;
then
=
value
.
then
;
if
(
isFunction
(
then
))
{
if
(
isFunction
(
then
))
{
if
(
isFunction
(
value
.
on
))
{
value
.
on
(
'
promise:notified
'
,
function
(
event
)
{
notify
(
promise
,
event
.
detail
);
});
}
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
if
(
isFunction
(
value
.
cancel
))
{
if
(
isFunction
(
value
.
cancel
))
{
value
.
cancel
();
value
.
cancel
();
...
@@ -693,11 +698,11 @@ define("rsvp/promise",
...
@@ -693,11 +698,11 @@ define("rsvp/promise",
__exports__
.
Promise
=
Promise
;
__exports__
.
Promise
=
Promise
;
});
});
define
(
"
rsvp/queue
"
,
define
(
"
rsvp/queue
"
,
[
"
rsvp/promise
"
,
"
rsvp/
timeout
"
,
"
exports
"
],
[
"
rsvp/promise
"
,
"
rsvp/
resolve
"
,
"
exports
"
],
function
(
__dependency1__
,
__dependency2__
,
__exports__
)
{
function
(
__dependency1__
,
__dependency2__
,
__exports__
)
{
"
use strict
"
;
"
use strict
"
;
var
Promise
=
__dependency1__
.
Promise
;
var
Promise
=
__dependency1__
.
Promise
;
var
delay
=
__dependency2__
.
delay
;
var
resolve
=
__dependency2__
.
resolve
;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
function
ResolvedQueueError
(
message
)
{
function
ResolvedQueueError
(
message
)
{
...
@@ -716,6 +721,7 @@ define("rsvp/queue",
...
@@ -716,6 +721,7 @@ define("rsvp/queue",
promise
,
promise
,
fulfill
,
fulfill
,
reject
,
reject
,
notify
,
resolved
;
resolved
;
if
(
!
(
this
instanceof
Queue
))
{
if
(
!
(
this
instanceof
Queue
))
{
...
@@ -728,7 +734,7 @@ define("rsvp/queue",
...
@@ -728,7 +734,7 @@ define("rsvp/queue",
}
}
}
}
promise
=
new
Promise
(
function
(
done
,
fail
)
{
promise
=
new
Promise
(
function
(
done
,
fail
,
progress
)
{
fulfill
=
function
(
fulfillmentValue
)
{
fulfill
=
function
(
fulfillmentValue
)
{
if
(
resolved
)
{
return
;}
if
(
resolved
)
{
return
;}
queue
.
isFulfilled
=
true
;
queue
.
isFulfilled
=
true
;
...
@@ -743,9 +749,10 @@ define("rsvp/queue",
...
@@ -743,9 +749,10 @@ define("rsvp/queue",
resolved
=
true
;
resolved
=
true
;
return
fail
(
rejectedReason
);
return
fail
(
rejectedReason
);
};
};
notify
=
progress
;
},
canceller
);
},
canceller
);
promise_list
.
push
(
delay
());
promise_list
.
push
(
resolve
());
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
...
@@ -766,7 +773,7 @@ define("rsvp/queue",
...
@@ -766,7 +773,7 @@ define("rsvp/queue",
return
promise
.
then
.
apply
(
promise
,
arguments
);
return
promise
.
then
.
apply
(
promise
,
arguments
);
};
};
queue
.
push
=
function
(
done
,
fail
)
{
queue
.
push
=
function
(
done
,
fail
,
progress
)
{
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
next_promise
;
next_promise
;
...
@@ -774,11 +781,11 @@ define("rsvp/queue",
...
@@ -774,11 +781,11 @@ define("rsvp/queue",
throw
new
ResolvedQueueError
();
throw
new
ResolvedQueueError
();
}
}
next_promise
=
last_promise
.
then
(
done
,
fail
);
next_promise
=
last_promise
.
then
(
done
,
fail
,
progress
);
promise_list
.
push
(
next_promise
);
promise_list
.
push
(
next_promise
);
// Handle pop
// Handle pop
promise_list
.
push
(
next_promise
.
then
(
function
(
fulfillmentValue
)
{
last_promise
=
next_promise
.
then
(
function
(
fulfillmentValue
)
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
fulfill
(
fulfillmentValue
);
fulfill
(
fulfillmentValue
);
...
@@ -792,7 +799,13 @@ define("rsvp/queue",
...
@@ -792,7 +799,13 @@ define("rsvp/queue",
}
else
{
}
else
{
throw
rejectedReason
;
throw
rejectedReason
;
}
}
}));
},
function
(
notificationValue
)
{
if
(
promise_list
[
promise_list
.
length
-
1
]
===
last_promise
)
{
notify
(
notificationValue
);
}
return
notificationValue
;
});
promise_list
.
push
(
last_promise
);
return
this
;
return
this
;
};
};
...
...
dist/rsvp-2.0.4.js
View file @
e0d98b1c
...
@@ -668,6 +668,11 @@ define("rsvp/promise",
...
@@ -668,6 +668,11 @@ define("rsvp/promise",
then
=
value
.
then
;
then
=
value
.
then
;
if
(
isFunction
(
then
))
{
if
(
isFunction
(
then
))
{
if
(
isFunction
(
value
.
on
))
{
value
.
on
(
'
promise:notified
'
,
function
(
event
)
{
notify
(
promise
,
event
.
detail
);
});
}
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
promise
.
on
(
'
promise:cancelled
'
,
function
(
event
)
{
if
(
isFunction
(
value
.
cancel
))
{
if
(
isFunction
(
value
.
cancel
))
{
value
.
cancel
();
value
.
cancel
();
...
@@ -730,11 +735,11 @@ define("rsvp/promise",
...
@@ -730,11 +735,11 @@ define("rsvp/promise",
__exports__
.
Promise
=
Promise
;
__exports__
.
Promise
=
Promise
;
});
});
define
(
"
rsvp/queue
"
,
define
(
"
rsvp/queue
"
,
[
"
rsvp/promise
"
,
"
rsvp/
timeout
"
,
"
exports
"
],
[
"
rsvp/promise
"
,
"
rsvp/
resolve
"
,
"
exports
"
],
function
(
__dependency1__
,
__dependency2__
,
__exports__
)
{
function
(
__dependency1__
,
__dependency2__
,
__exports__
)
{
"
use strict
"
;
"
use strict
"
;
var
Promise
=
__dependency1__
.
Promise
;
var
Promise
=
__dependency1__
.
Promise
;
var
delay
=
__dependency2__
.
delay
;
var
resolve
=
__dependency2__
.
resolve
;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
function
ResolvedQueueError
(
message
)
{
function
ResolvedQueueError
(
message
)
{
...
@@ -753,6 +758,7 @@ define("rsvp/queue",
...
@@ -753,6 +758,7 @@ define("rsvp/queue",
promise
,
promise
,
fulfill
,
fulfill
,
reject
,
reject
,
notify
,
resolved
;
resolved
;
if
(
!
(
this
instanceof
Queue
))
{
if
(
!
(
this
instanceof
Queue
))
{
...
@@ -765,7 +771,7 @@ define("rsvp/queue",
...
@@ -765,7 +771,7 @@ define("rsvp/queue",
}
}
}
}
promise
=
new
Promise
(
function
(
done
,
fail
)
{
promise
=
new
Promise
(
function
(
done
,
fail
,
progress
)
{
fulfill
=
function
(
fulfillmentValue
)
{
fulfill
=
function
(
fulfillmentValue
)
{
if
(
resolved
)
{
return
;}
if
(
resolved
)
{
return
;}
queue
.
isFulfilled
=
true
;
queue
.
isFulfilled
=
true
;
...
@@ -780,9 +786,10 @@ define("rsvp/queue",
...
@@ -780,9 +786,10 @@ define("rsvp/queue",
resolved
=
true
;
resolved
=
true
;
return
fail
(
rejectedReason
);
return
fail
(
rejectedReason
);
};
};
notify
=
progress
;
},
canceller
);
},
canceller
);
promise_list
.
push
(
delay
());
promise_list
.
push
(
resolve
());
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
push
(
promise_list
[
0
].
then
(
function
()
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
...
@@ -803,7 +810,7 @@ define("rsvp/queue",
...
@@ -803,7 +810,7 @@ define("rsvp/queue",
return
promise
.
then
.
apply
(
promise
,
arguments
);
return
promise
.
then
.
apply
(
promise
,
arguments
);
};
};
queue
.
push
=
function
(
done
,
fail
)
{
queue
.
push
=
function
(
done
,
fail
,
progress
)
{
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
var
last_promise
=
promise_list
[
promise_list
.
length
-
1
],
next_promise
;
next_promise
;
...
@@ -811,11 +818,11 @@ define("rsvp/queue",
...
@@ -811,11 +818,11 @@ define("rsvp/queue",
throw
new
ResolvedQueueError
();
throw
new
ResolvedQueueError
();
}
}
next_promise
=
last_promise
.
then
(
done
,
fail
);
next_promise
=
last_promise
.
then
(
done
,
fail
,
progress
);
promise_list
.
push
(
next_promise
);
promise_list
.
push
(
next_promise
);
// Handle pop
// Handle pop
promise_list
.
push
(
next_promise
.
then
(
function
(
fulfillmentValue
)
{
last_promise
=
next_promise
.
then
(
function
(
fulfillmentValue
)
{
promise_list
.
splice
(
0
,
2
);
promise_list
.
splice
(
0
,
2
);
if
(
promise_list
.
length
===
0
)
{
if
(
promise_list
.
length
===
0
)
{
fulfill
(
fulfillmentValue
);
fulfill
(
fulfillmentValue
);
...
@@ -829,7 +836,13 @@ define("rsvp/queue",
...
@@ -829,7 +836,13 @@ define("rsvp/queue",
}
else
{
}
else
{
throw
rejectedReason
;
throw
rejectedReason
;
}
}
}));
},
function
(
notificationValue
)
{
if
(
promise_list
[
promise_list
.
length
-
1
]
===
last_promise
)
{
notify
(
notificationValue
);
}
return
notificationValue
;
});
promise_list
.
push
(
last_promise
);
return
this
;
return
this
;
};
};
...
...
dist/rsvp-2.0.4.min.js
View file @
e0d98b1c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment