Index: Source/bindings/core/v8/V8Initializer.cpp |
diff --git a/Source/bindings/core/v8/V8Initializer.cpp b/Source/bindings/core/v8/V8Initializer.cpp |
index 1f855ff7bbeab807055122aa96c39110c89ade78..85c6490a218cf15bbced8933c3c327681a7312d7 100644 |
--- a/Source/bindings/core/v8/V8Initializer.cpp |
+++ b/Source/bindings/core/v8/V8Initializer.cpp |
@@ -203,13 +203,8 @@ void V8Initializer::reportRejectedPromisesOnMainThread() |
static void promiseRejectHandlerInMainThread(v8::PromiseRejectMessage data) |
{ |
ASSERT(isMainThread()); |
- if (data.GetEvent() == v8::kPromiseHandlerAddedAfterReject) { |
- rejectedPromisesOnMainThread().handlerAdded(data); |
+ if (data.GetEvent() != v8::kPromiseRejectWithNoHandler) |
return; |
- } |
- |
- ASSERT(data.GetEvent() == v8::kPromiseRejectWithNoHandler); |
- |
v8::Handle<v8::Promise> promise = data.GetPromise(); |
v8::Isolate* isolate = promise->GetIsolate(); |
@@ -254,11 +249,14 @@ static void promiseRejectHandlerInMainThread(v8::PromiseRejectMessage data) |
errorMessage = "Uncaught " + messageForConsole; |
ScriptState* scriptState = ScriptState::current(isolate); |
- rejectedPromisesOnMainThread().rejectedWithNoHandler(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, callStack); |
+ rejectedPromisesOnMainThread().add(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, callStack); |
} |
static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data) |
{ |
+ if (data.GetEvent() != v8::kPromiseRejectWithNoHandler) |
+ return; |
+ |
v8::Handle<v8::Promise> promise = data.GetPromise(); |
// Bail out if called during context initialization. |
@@ -275,13 +273,6 @@ static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data) |
WorkerScriptController* scriptController = toWorkerGlobalScope(executionContext)->script(); |
ASSERT(scriptController); |
- if (data.GetEvent() == v8::kPromiseHandlerAddedAfterReject) { |
- scriptController->rejectedPromises()->handlerAdded(data); |
- return; |
- } |
- |
- ASSERT(data.GetEvent() == v8::kPromiseRejectWithNoHandler); |
- |
int scriptId = 0; |
int lineNumber = 0; |
int columnNumber = 0; |
@@ -298,7 +289,7 @@ static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data) |
// message->Get() can be empty here. https://crbug.com/450330 |
errorMessage = toCoreStringWithNullCheck(message->Get()); |
} |
- scriptController->rejectedPromises()->rejectedWithNoHandler(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, nullptr); |
+ scriptController->rejectedPromises()->add(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, nullptr); |
} |
static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data) |