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

Unified Diff: Source/bindings/v8/ScriptPromise.cpp

Issue 337053004: Don't assert when ServiceWorker::from is passed an empty promise (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
Index: Source/bindings/v8/ScriptPromise.cpp
diff --git a/Source/bindings/v8/ScriptPromise.cpp b/Source/bindings/v8/ScriptPromise.cpp
index 11865ee4854c9fd76b572354a85ebfa60b06eca2..cdeeb0586de15f19c3555019e0ae9e7d00be498e 100644
--- a/Source/bindings/v8/ScriptPromise.cpp
+++ b/Source/bindings/v8/ScriptPromise.cpp
@@ -67,13 +67,13 @@ ScriptPromise::ScriptPromise(ScriptState* scriptState, v8::Handle<v8::Value> val
ScriptPromise ScriptPromise::then(PassOwnPtr<ScriptFunction> onFulfilled, PassOwnPtr<ScriptFunction> onRejected)
{
+ v8::Local<v8::Function> v8OnFulfilled = ScriptFunction::adoptByGarbageCollector(onFulfilled);
+ v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected);
haraken 2014/06/17 00:51:55 Would you elaborate on this change? It seems a bit
falken 2014/06/17 01:07:51 The destructor of PassOwnPtr deletes the ScriptFun
haraken 2014/06/17 01:15:25 Thanks for the details; that ASSERT doesn't make m
+
if (m_promise.isEmpty())
return ScriptPromise();
v8::Local<v8::Object> promise = m_promise.v8Value().As<v8::Object>();
- v8::Local<v8::Function> v8OnFulfilled = ScriptFunction::adoptByGarbageCollector(onFulfilled);
- v8::Local<v8::Function> v8OnRejected = ScriptFunction::adoptByGarbageCollector(onRejected);
-
ASSERT(promise->IsPromise());
// Return this Promise if no handlers are given.
// In fact it is not the exact bahavior of Promise.prototype.then

Powered by Google App Engine
This is Rietveld 408576698