-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
When attempting to fix a memory leak caused by nested promises I inadvertently completely broke my library once more than a couple of promises were nested (see then/promise#67). I caught it with the following test:
var promises = [];
var resolveFns = [];
for (var i = 0; i < 100; i++) {
promises.push(new Promise(function (resolve) {
resolveFns.push(resolve);
}));
}
for (var i = 0; i < 99; i++) {
resolveFns[i](promises[i + 1]);
}
resolveFns[99]('foo');
return promises[0].then(function (result) {
assert(result === 'foo');
});
It took me a long time to realise that I might have an bug in that place so it would be great if we could add a test like this so that other people don't suffer the same problem.
Metadata
Metadata
Assignees
Labels
No labels