Index: Source/bindings/tests/results/V8TestObject.cpp |
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp |
index 241b304f0860c328e029d56f38b7521ed78e9093..da2ef323dab284fc1664e3bb83f6f776fb1b6f43 100644 |
--- a/Source/bindings/tests/results/V8TestObject.cpp |
+++ b/Source/bindings/tests/results/V8TestObject.cpp |
@@ -3935,7 +3935,7 @@ static void strictTypeCheckingTestInterfaceAttributeAttributeSetter(v8::Local<v8 |
{ |
v8::Handle<v8::Object> holder = info.Holder(); |
ExceptionState exceptionState(ExceptionState::SetterContext, "strictTypeCheckingTestInterfaceAttribute", "TestObject", holder, info.GetIsolate()); |
- if (!isUndefinedOrNull(v8Value) && !V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { |
+ if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { |
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); |
exceptionState.throwIfNeeded(); |
return; |
@@ -3952,6 +3952,46 @@ static void strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback(v8:: |
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
} |
+static void strictTypeCheckingNullableTestInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestObject* impl = V8TestObject::toNative(holder); |
+ RefPtr<TestInterfaceImplementation> v8Value = impl->strictTypeCheckingNullableTestInterfaceAttribute(); |
+ if (!v8Value) { |
+ v8SetReturnValueNull(info); |
+ return; |
+ } |
+ v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); |
+} |
+ |
+static void strictTypeCheckingNullableTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
+ TestObjectV8Internal::strictTypeCheckingNullableTestInterfaceAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
+} |
+ |
+static void strictTypeCheckingNullableTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "strictTypeCheckingNullableTestInterfaceAttribute", "TestObject", holder, info.GetIsolate()); |
+ if (!isUndefinedOrNull(v8Value) && !V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { |
+ exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ TestObject* impl = V8TestObject::toNative(holder); |
+ V8TRYCATCH_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
+ impl->setStrictTypeCheckingNullableTestInterfaceAttribute(WTF::getPtr(cppValue)); |
+} |
+ |
+static void strictTypeCheckingNullableTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
+ TestObjectV8Internal::strictTypeCheckingNullableTestInterfaceAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
+} |
+ |
static void treatNullAsNullStringStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
{ |
v8::Handle<v8::Object> holder = info.Holder(); |
@@ -7818,6 +7858,7 @@ static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] |
{"setterCallWithExecutionContextStringAttribute", TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetterCallback, TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
{"strictTypeCheckingFloatAttribute", TestObjectV8Internal::strictTypeCheckingFloatAttributeAttributeGetterCallback, TestObjectV8Internal::strictTypeCheckingFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
{"strictTypeCheckingTestInterfaceAttribute", TestObjectV8Internal::strictTypeCheckingTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
+ {"strictTypeCheckingNullableTestInterfaceAttribute", TestObjectV8Internal::strictTypeCheckingNullableTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::strictTypeCheckingNullableTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
{"treatNullAsNullStringStringAttribute", TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
{"treatReturnedNullStringAsNullStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
{"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |