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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.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/V8TestInterfaceWillBeGarbageCollected.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
index 4a986dbbe67db33c39f44149380d9888d16b70fe..466a7ed6e57c7cef8ecf05d783d464635e900b1e 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
@@ -56,8 +56,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", "TestInterfaceWillBeGarbageCollected", holder, info.GetIsolate());
TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageCollected::toImpl(holder);
TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
+ if (!cppValue) {
+ exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceWillBeGarbageCollected'.");
+ exceptionState.throwIfNeeded();
+ return;
+ }
impl->setAttr1(WTF::getPtr(cppValue));
}
@@ -79,6 +85,10 @@ static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
TestInterfaceWillBeGarbageCollected* arg;
{
arg = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), info[0]);
+ if (!arg) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("func", "TestInterfaceWillBeGarbageCollected", "parameter 1 is not of type 'TestInterfaceWillBeGarbageCollected'."));
+ return;
+ }
}
impl->func(arg);
}

Powered by Google App Engine
This is Rietveld 408576698