Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Unified Diff: src/js/promise.js

Issue 2399053003: [promises] fix deferred object leak (Closed)
Patch Set: test reject case too Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5476.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index b47472aa07f88e6d3638f08cd6085f2033c6bab2..86be06018ce7230dd54a9d7179db9dbd5fa365fa 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -172,7 +172,7 @@ function PromiseHandle(value, handler, deferred) {
if (IS_UNDEFINED(deferred.resolve)) {
ResolvePromise(deferred.promise, result);
} else {
- deferred.resolve(result);
+ %_Call(deferred.resolve, UNDEFINED, result);
}
} %catch (exception) { // Natives syntax to mark this catch block.
try {
@@ -181,7 +181,7 @@ function PromiseHandle(value, handler, deferred) {
// redundant ExceptionEvents.
RejectPromise(deferred.promise, exception, false);
} else {
- deferred.reject(exception);
+ %_Call(deferred.reject, UNDEFINED, exception);
}
} catch (e) { }
} finally {
@@ -606,7 +606,7 @@ function PromiseRace(iterable) {
}
}
} catch (e) {
- deferred.reject(e)
+ %_Call(deferred.reject, UNDEFINED, e);
}
return deferred.promise;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5476.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698