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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)
Patch Set: Removed throwMinimumArityError family. Created 4 years, 3 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: third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp
index f5164a95a1cb8b8a9bc6c14b879d15db926d41cf..4c1ebf45a59e326d6f1d48dd0ba3cb09fc996be6 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp
@@ -15,25 +15,26 @@ namespace blink {
void V8IDBObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "IDBObserver");
+
if (UNLIKELY(info.Length() < 1)) {
- V8ThrowException::throwException(info.GetIsolate(), createMinimumArityTypeErrorForConstructor(info.GetIsolate(), "IDBObserver", 1, info.Length()));
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
v8::Local<v8::Object> wrapper = info.Holder();
if (!info[0]->IsFunction()) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("IDBObserver", "The callback provided as parameter 1 is not a function."));
+ exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
return;
}
if (info.Length() > 1 && !isUndefinedOrNull(info[1]) && !info[1]->IsObject()) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("IDBObserver", "IDBObserverInit (parameter 2) is not an object."));
+ exceptionState.throwTypeError("parameter 2 ('options') is not an object.");
return;
}
IDBObserverInit idbObserverInit;
- ExceptionState exceptionState(ExceptionState::ConstructionContext, "IDBObserver", info.Holder(), info.GetIsolate());
V8IDBObserverInit::toImpl(info.GetIsolate(), info[1], idbObserverInit, exceptionState);
if (exceptionState.hadException())
return;

Powered by Google App Engine
This is Rietveld 408576698