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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestException.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/tests/results/core/V8TestException.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
index 3536be6e24950551c864f544b26d8d1648e97f06..ead3d8711f314bc334f27122d99302ce27f4fe0b 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
@@ -7,6 +7,7 @@
#include "V8TestException.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/GeneratedCodeHelper.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "core/dom/Document.h"
@@ -74,6 +75,7 @@ void readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCallbackIn
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestException* impl = V8TestException::toImpl(info.Holder());
+
v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
}
@@ -84,17 +86,18 @@ static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestException", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestException");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
+
unsigned argument;
- {
- argument = toUInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.hadException())
- return;
- }
+ argument = toUInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
+ if (exceptionState.hadException())
+ return;
+
TestException* impl = TestException::create(argument);
v8::Local<v8::Object> wrapper = info.Holder();
wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestException::wrapperTypeInfo, wrapper);

Powered by Google App Engine
This is Rietveld 408576698