Skip to content

Commit 40d194e

Browse files
authored
Merge pull request #269 from stefanpenner/fix-memory-leak
Fix Leak: TRY_CATCH_ERROR must release the error manually because things
2 parents f5f44e8 + 317e234 commit 40d194e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/es6-promise/-internal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function handleMaybeThenable(promise, maybeThenable, then) {
8989
} else {
9090
if (then === GET_THEN_ERROR) {
9191
reject(promise, GET_THEN_ERROR.error);
92+
GET_THEN_ERROR.error = null;
9293
} else if (then === undefined) {
9394
fulfill(promise, maybeThenable);
9495
} else if (isFunction(then)) {
@@ -198,7 +199,7 @@ function invokeCallback(settled, promise, callback, detail) {
198199
if (value === TRY_CATCH_ERROR) {
199200
failed = true;
200201
error = value.error;
201-
value = null;
202+
value.error = null;
202203
} else {
203204
succeeded = true;
204205
}

0 commit comments

Comments
 (0)