| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
|
| index 4599e4c503401dbbb7ca3c5893d269ca12cb3035..f47387e1ed7fab3f0e6d18de26e3861ff89815f1 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
|
| @@ -100,6 +100,41 @@ v8::Local<v8::FunctionTemplate> V8TestInterfaceEventTargetConstructor::domTempla
|
| return result;
|
| }
|
|
|
| +void V8TestInterfaceEventTargetConstructor::NamedConstructorAttributeGetter(
|
| + v8::Local<v8::Name> propertyName,
|
| + const v8::PropertyCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceEventTarget");
|
| + v8::Local<v8::Value> data = info.Data();
|
| + DCHECK(data->IsExternal());
|
| + V8PerContextData* perContextData =
|
| + V8PerContextData::from(info.Holder()->CreationContext());
|
| + if (!perContextData)
|
| + return;
|
| +
|
| + v8::Local<v8::Function> namedConstructorInterface = perContextData->constructorForType(WrapperTypeInfo::unwrap(data));
|
| + v8::Local<v8::Function> interface = perContextData->constructorForType(&V8TestInterfaceEventTarget::wrapperTypeInfo);
|
| +
|
| + // Set the prototype of named constructors to the regular constructor.
|
| + v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
|
| + auto privateProperty = V8PrivateProperty::getNamedConstructorInitialized(info.GetIsolate());
|
| + v8::Local<v8::Value> privateValue = privateProperty.get(context, namedConstructorInterface);
|
| + if (privateValue.IsEmpty()) {
|
| + v8::MaybeLocal<v8::Value> interfacePrototype = interface->Get(context, v8AtomicString(info.GetIsolate(), "prototype"));
|
| + if (interfacePrototype.IsEmpty())
|
| + exceptionState.throwTypeError("Could not get prototype for V8TestInterfaceEventTarget.");
|
| +
|
| + v8::Maybe<bool> setResult = namedConstructorInterface->Set(context, v8AtomicString(info.GetIsolate(), "prototype"), interfacePrototype.ToLocalChecked());
|
| + if (setResult.IsNothing() || setResult.ToChecked() != true) {
|
| + exceptionState.throwTypeError("Could not set prototype for TestInterfaceEventTarget.");
|
| + }
|
| +
|
| + privateProperty.set(context, namedConstructorInterface, v8::True(info.GetIsolate()));
|
| + }
|
| +
|
| + v8SetReturnValue(
|
| + info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
|
| +}
|
| +
|
| static void installV8TestInterfaceEventTargetTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
|
| // Initialize the interface object's template.
|
| V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterfaceEventTarget::wrapperTypeInfo.interfaceName, V8EventTarget::domTemplate(isolate, world), V8TestInterfaceEventTarget::internalFieldCount);
|
|
|