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
deeaba9a
Commit
deeaba9a
authored
Apr 20, 2013
by
Teddy Zeenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix infinite recursion with deep self fulfilling promises
parent
00d5aaed
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6881 additions
and
9482 deletions
+6881
-9482
browser/rsvp.js
browser/rsvp.js
+225
-221
browser/rsvp.min.js
browser/rsvp.min.js
+1
-1
browser/rsvp/promise.amd.js
browser/rsvp/promise.amd.js
+5
-1
lib/rsvp/promise.js
lib/rsvp/promise.js
+5
-1
tests/extension-tests.js
tests/extension-tests.js
+21
-0
tests/tmp/test-bundle.js
tests/tmp/test-bundle.js
+6624
-9258
No files found.
browser/rsvp.js
View file @
deeaba9a
This diff is collapsed.
Click to expand it.
browser/rsvp.min.js
View file @
deeaba9a
This diff is collapsed.
Click to expand it.
browser/rsvp/promise.amd.js
View file @
deeaba9a
...
...
@@ -119,7 +119,11 @@ define(
fulfill
(
promise
,
value
);
}
else
if
(
objectOrFunction
(
value
)
&&
isFunction
(
value
.
then
))
{
value
.
then
(
function
(
val
)
{
resolve
(
promise
,
val
);
if
(
value
!==
val
)
{
resolve
(
promise
,
val
);
}
else
{
fulfill
(
promise
,
val
);
}
},
function
(
val
)
{
reject
(
promise
,
val
);
});
...
...
lib/rsvp/promise.js
View file @
deeaba9a
...
...
@@ -115,7 +115,11 @@ function resolve(promise, value) {
fulfill
(
promise
,
value
);
}
else
if
(
objectOrFunction
(
value
)
&&
isFunction
(
value
.
then
))
{
value
.
then
(
function
(
val
)
{
resolve
(
promise
,
val
);
if
(
value
!==
val
)
{
resolve
(
promise
,
val
);
}
else
{
fulfill
(
promise
,
val
);
}
},
function
(
val
)
{
reject
(
promise
,
val
);
});
...
...
tests/extension-tests.js
View file @
deeaba9a
...
...
@@ -134,6 +134,27 @@ describe("RSVP extensions", function() {
});
});
it
(
'
should assimilate two levels deep, for fulfillment of self fulfilling promises
'
,
function
(
done
)
{
var
originalPromise
,
promise
;
originalPromise
=
new
RSVP
.
Promise
(
function
(
resolve
)
{
setTimeout
(
function
()
{
resolve
(
originalPromise
);
},
0
)
});
promise
=
new
RSVP
.
Promise
(
function
(
resolve
)
{
setTimeout
(
function
()
{
resolve
(
originalPromise
);
},
0
);
});
promise
.
then
(
function
(
value
)
{
assert
.
equal
(
value
,
originalPromise
);
done
();
});
});
it
(
'
should assimilate two levels deep, for fulfillment
'
,
function
(
done
)
{
var
originalPromise
=
new
RSVP
.
Promise
(
function
(
resolve
)
{
resolve
(
'
original value
'
);
});
var
nextPromise
=
new
RSVP
.
Promise
(
function
(
resolve
)
{
resolve
(
originalPromise
);
});
...
...
tests/tmp/test-bundle.js
View file @
deeaba9a
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