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
47b35e23
Commit
47b35e23
authored
Jun 29, 2013
by
Stefan Penner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify handling the thenable.
Removed the double try/catch
parent
253666b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
lib/rsvp/promise.js
lib/rsvp/promise.js
+8
-11
No files found.
lib/rsvp/promise.js
View file @
47b35e23
...
...
@@ -131,16 +131,11 @@ function resolve(promise, value) {
function
handleThenable
(
promise
,
value
)
{
var
then
=
null
;
if
(
objectOrFunction
(
value
))
{
try
{
if
(
objectOrFunction
(
value
))
{
then
=
value
.
then
;
}
catch
(
e
)
{
reject
(
promise
,
e
);
return
true
;
}
if
(
isFunction
(
then
))
{
try
{
then
.
call
(
value
,
function
(
val
)
{
if
(
value
!==
val
)
{
resolve
(
promise
,
val
);
...
...
@@ -150,12 +145,14 @@ function handleThenable(promise, value) {
},
function
(
val
)
{
reject
(
promise
,
val
);
});
}
catch
(
e
)
{
reject
(
promise
,
e
);
}
return
true
;
}
}
}
catch
(
error
)
{
reject
(
promise
,
error
);
return
true
;
}
return
false
;
}
...
...
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