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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
rsvp.js
Commits
6102340c
Commit
6102340c
authored
Oct 16, 2012
by
Yehuda Katz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates build artifacts
parent
51878cf5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
browser/rsvp.js
browser/rsvp.js
+4
-2
browser/rsvp.min.js
browser/rsvp.min.js
+1
-1
No files found.
browser/rsvp.js
View file @
6102340c
...
@@ -39,6 +39,8 @@ if (typeof process !== 'undefined') {
...
@@ -39,6 +39,8 @@ if (typeof process !== 'undefined') {
};
};
}
}
RSVP
.
async
=
async
;
var
Event
=
exports
.
Event
=
function
(
type
,
options
)
{
var
Event
=
exports
.
Event
=
function
(
type
,
options
)
{
this
.
type
=
type
;
this
.
type
=
type
;
...
@@ -182,7 +184,7 @@ Promise.prototype = {
...
@@ -182,7 +184,7 @@ Promise.prototype = {
},
},
resolve
:
function
(
value
)
{
resolve
:
function
(
value
)
{
async
(
function
()
{
RSVP
.
async
(
function
()
{
this
.
trigger
(
'
promise:resolved
'
,
{
detail
:
value
});
this
.
trigger
(
'
promise:resolved
'
,
{
detail
:
value
});
this
.
isResolved
=
value
;
this
.
isResolved
=
value
;
},
this
);
},
this
);
...
@@ -192,7 +194,7 @@ Promise.prototype = {
...
@@ -192,7 +194,7 @@ Promise.prototype = {
},
},
reject
:
function
(
value
)
{
reject
:
function
(
value
)
{
async
(
function
()
{
RSVP
.
async
(
function
()
{
this
.
trigger
(
'
promise:failed
'
,
{
detail
:
value
});
this
.
trigger
(
'
promise:failed
'
,
{
detail
:
value
});
this
.
isRejected
=
value
;
this
.
isRejected
=
value
;
},
this
);
},
this
);
...
...
browser/rsvp.min.js
View file @
6102340c
(
function
(
a
){
"
use strict
"
;
var
b
=
typeof
window
!=
"
undefined
"
?
window
:{},
c
=
b
.
MutationObserver
||
b
.
WebKitMutationObserver
,
d
;
if
(
typeof
process
!=
"
undefined
"
)
d
=
function
(
a
,
b
){
process
.
nextTick
(
function
(){
a
.
call
(
b
)})};
else
if
(
c
){
var
e
=
[],
f
=
new
c
(
function
(){
var
a
=
e
.
slice
();
e
=
[],
a
.
forEach
(
function
(
a
){
var
b
=
a
[
0
],
c
=
a
[
1
];
b
.
call
(
c
)})}),
g
=
document
.
createElement
(
"
div
"
);
f
.
observe
(
g
,{
attributes
:
!
0
}),
d
=
function
(
a
,
b
){
e
.
push
([
a
,
b
]),
g
.
setAttribute
(
"
drainQueue
"
,
"
drainQueue
"
)}}
else
d
=
function
(
a
,
b
){
setTimeout
(
function
(){
a
.
call
(
b
)},
1
)};
var
h
=
a
.
Event
=
function
(
a
,
b
){
this
.
type
=
a
;
for
(
var
c
in
b
){
if
(
!
b
.
hasOwnProperty
(
c
))
continue
;
this
[
c
]
=
b
[
c
]}},
i
=
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
if
(
a
[
c
][
0
]
===
b
)
return
c
;
return
-
1
},
j
=
function
(
a
){
var
b
=
a
.
_promiseCallbacks
;
b
||
(
b
=
a
.
_promiseCallbacks
=
{});
return
b
},
k
=
a
.
EventTarget
=
{
mixin
:
function
(
a
){
a
.
on
=
this
.
on
,
a
.
off
=
this
.
off
,
a
.
trigger
=
this
.
trigger
;
return
a
},
on
:
function
(
a
,
b
,
c
){
var
d
=
j
(
this
),
e
;
c
=
c
||
this
,
e
=
d
[
a
],
e
||
(
e
=
d
[
a
]
=
[]),
i
(
e
,
b
)
===-
1
&&
e
.
push
([
b
,
c
])},
off
:
function
(
a
,
b
){
var
c
=
j
(
this
),
d
;
if
(
!
b
)
c
[
a
]
=
[];
else
{
d
=
c
[
a
];
var
e
=
i
(
d
,
b
);
e
!==-
1
&&
d
.
splice
(
e
,
1
)}},
trigger
:
function
(
a
,
b
){
var
c
=
j
(
this
),
d
,
e
,
f
,
g
,
i
;
if
(
d
=
c
[
a
])
for
(
var
k
=
0
,
l
=
d
.
length
;
k
<
l
;
k
++
)
e
=
d
[
k
],
f
=
e
[
0
],
g
=
e
[
1
],
typeof
b
!=
"
object
"
&&
(
b
=
{
detail
:
b
}),
i
=
new
h
(
a
,
b
),
f
.
call
(
g
,
i
)}},
l
=
a
.
Promise
=
function
(){
this
.
on
(
"
promise:resolved
"
,
function
(
a
){
this
.
trigger
(
"
success
"
,{
detail
:
a
.
detail
})},
this
),
this
.
on
(
"
promise:failed
"
,
function
(
a
){
this
.
trigger
(
"
error
"
,{
detail
:
a
.
detail
})},
this
)},
m
=
function
(){},
n
=
function
(
a
,
b
,
c
,
d
){
var
e
,
f
;
if
(
c
)
try
{
e
=
c
(
d
.
detail
)}
catch
(
g
){
f
=
g
}
else
e
=
d
.
detail
;
e
instanceof
l
?
e
.
then
(
function
(
a
){
b
.
resolve
(
a
)},
function
(
a
){
b
.
reject
(
a
)}):
c
&&
e
?
b
.
resolve
(
e
):
f
?
b
.
reject
(
f
):
b
[
a
](
e
)};
l
.
prototype
=
{
then
:
function
(
a
,
b
){
var
c
=
new
l
;
this
.
on
(
"
promise:resolved
"
,
function
(
b
){
n
(
"
resolve
"
,
c
,
a
,
b
)}),
this
.
on
(
"
promise:failed
"
,
function
(
a
){
n
(
"
reject
"
,
c
,
b
,
a
)});
return
c
},
resolve
:
function
(
a
){
d
(
function
(){
this
.
trigger
(
"
promise:resolved
"
,{
detail
:
a
}),
this
.
isResolved
=
a
},
this
),
this
.
resolve
=
m
,
this
.
reject
=
m
},
reject
:
function
(
a
){
d
(
function
(){
this
.
trigger
(
"
promise:failed
"
,{
detail
:
a
}),
this
.
isRejected
=
a
},
this
),
this
.
resolve
=
m
,
this
.
reject
=
m
}},
k
.
mixin
(
l
.
prototype
)})(
window
.
RSVP
=
{})
(
function
(
a
){
"
use strict
"
;
var
b
=
typeof
window
!=
"
undefined
"
?
window
:{},
c
=
b
.
MutationObserver
||
b
.
WebKitMutationObserver
,
d
;
if
(
typeof
process
!=
"
undefined
"
)
d
=
function
(
a
,
b
){
process
.
nextTick
(
function
(){
a
.
call
(
b
)})};
else
if
(
c
){
var
e
=
[],
f
=
new
c
(
function
(){
var
a
=
e
.
slice
();
e
=
[],
a
.
forEach
(
function
(
a
){
var
b
=
a
[
0
],
c
=
a
[
1
];
b
.
call
(
c
)})}),
g
=
document
.
createElement
(
"
div
"
);
f
.
observe
(
g
,{
attributes
:
!
0
}),
d
=
function
(
a
,
b
){
e
.
push
([
a
,
b
]),
g
.
setAttribute
(
"
drainQueue
"
,
"
drainQueue
"
)}}
else
d
=
function
(
a
,
b
){
setTimeout
(
function
(){
a
.
call
(
b
)},
1
)};
RSVP
.
async
=
d
;
var
h
=
a
.
Event
=
function
(
a
,
b
){
this
.
type
=
a
;
for
(
var
c
in
b
){
if
(
!
b
.
hasOwnProperty
(
c
))
continue
;
this
[
c
]
=
b
[
c
]}},
i
=
function
(
a
,
b
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
if
(
a
[
c
][
0
]
===
b
)
return
c
;
return
-
1
},
j
=
function
(
a
){
var
b
=
a
.
_promiseCallbacks
;
b
||
(
b
=
a
.
_promiseCallbacks
=
{});
return
b
},
k
=
a
.
EventTarget
=
{
mixin
:
function
(
a
){
a
.
on
=
this
.
on
,
a
.
off
=
this
.
off
,
a
.
trigger
=
this
.
trigger
;
return
a
},
on
:
function
(
a
,
b
,
c
){
var
d
=
j
(
this
),
e
;
c
=
c
||
this
,
e
=
d
[
a
],
e
||
(
e
=
d
[
a
]
=
[]),
i
(
e
,
b
)
===-
1
&&
e
.
push
([
b
,
c
])},
off
:
function
(
a
,
b
){
var
c
=
j
(
this
),
d
;
if
(
!
b
)
c
[
a
]
=
[];
else
{
d
=
c
[
a
];
var
e
=
i
(
d
,
b
);
e
!==-
1
&&
d
.
splice
(
e
,
1
)}},
trigger
:
function
(
a
,
b
){
var
c
=
j
(
this
),
d
,
e
,
f
,
g
,
i
;
if
(
d
=
c
[
a
])
for
(
var
k
=
0
,
l
=
d
.
length
;
k
<
l
;
k
++
)
e
=
d
[
k
],
f
=
e
[
0
],
g
=
e
[
1
],
typeof
b
!=
"
object
"
&&
(
b
=
{
detail
:
b
}),
i
=
new
h
(
a
,
b
),
f
.
call
(
g
,
i
)}},
l
=
a
.
Promise
=
function
(){
this
.
on
(
"
promise:resolved
"
,
function
(
a
){
this
.
trigger
(
"
success
"
,{
detail
:
a
.
detail
})},
this
),
this
.
on
(
"
promise:failed
"
,
function
(
a
){
this
.
trigger
(
"
error
"
,{
detail
:
a
.
detail
})},
this
)},
m
=
function
(){},
n
=
function
(
a
,
b
,
c
,
d
){
var
e
,
f
;
if
(
c
)
try
{
e
=
c
(
d
.
detail
)}
catch
(
g
){
f
=
g
}
else
e
=
d
.
detail
;
e
instanceof
l
?
e
.
then
(
function
(
a
){
b
.
resolve
(
a
)},
function
(
a
){
b
.
reject
(
a
)}):
c
&&
e
?
b
.
resolve
(
e
):
f
?
b
.
reject
(
f
):
b
[
a
](
e
)};
l
.
prototype
=
{
then
:
function
(
a
,
b
){
var
c
=
new
l
;
this
.
on
(
"
promise:resolved
"
,
function
(
b
){
n
(
"
resolve
"
,
c
,
a
,
b
)}),
this
.
on
(
"
promise:failed
"
,
function
(
a
){
n
(
"
reject
"
,
c
,
b
,
a
)});
return
c
},
resolve
:
function
(
a
){
RSVP
.
async
(
function
(){
this
.
trigger
(
"
promise:resolved
"
,{
detail
:
a
}),
this
.
isResolved
=
a
},
this
),
this
.
resolve
=
m
,
this
.
reject
=
m
},
reject
:
function
(
a
){
RSVP
.
async
(
function
(){
this
.
trigger
(
"
promise:failed
"
,{
detail
:
a
}),
this
.
isRejected
=
a
},
this
),
this
.
resolve
=
m
,
this
.
reject
=
m
}},
k
.
mixin
(
l
.
prototype
)})(
window
.
RSVP
=
{})
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