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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp

Issue 1466563003: Make [TypeChecking=Interface] the default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/V8TestInterfaceGarbageCollected.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
index 245894abc51768fd4505bbb2e5d4df1777020acc..0791edce026988810014be0fccc5af2ea0745449 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
@@ -59,8 +59,14 @@ static void attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Valu
static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+ ExceptionState exceptionState(ExceptionState::SetterContext, "attr1", "TestInterfaceGarbageCollected", holder, info.GetIsolate());
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
+ if (!cppValue) {
+ exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
+ exceptionState.throwIfNeeded();
+ return;
+ }
impl->setAttr1(WTF::getPtr(cppValue));
}
@@ -82,6 +88,10 @@ static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
TestInterfaceGarbageCollected* arg;
{
arg = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), info[0]);
+ if (!arg) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("func", "TestInterfaceGarbageCollected", "parameter 1 is not of type 'TestInterfaceGarbageCollected'."));
+ return;
+ }
}
impl->func(arg);
}

Powered by Google App Engine
This is Rietveld 408576698