Index: third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp |
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp |
index 15db3d12ff4162670166d0b9fb23fb85ae56c18b..f78b72d4c0d0bfa1a3cba93ca081ab4ca4a13431 100644 |
--- a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp |
+++ b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp |
@@ -129,28 +129,32 @@ v8::Local<v8::Function> V8PerContextData::ConstructorForTypeSlowCase( |
return v8::Local<v8::Function>(); |
} |
- v8::Local<v8::Value> prototype_value; |
- if (!interface_object |
- ->Get(current_context, V8AtomicString(isolate_, "prototype")) |
- .ToLocal(&prototype_value) || |
- !prototype_value->IsObject()) |
- return v8::Local<v8::Function>(); |
- v8::Local<v8::Object> prototype_object = prototype_value.As<v8::Object>(); |
- if (prototype_object->InternalFieldCount() == |
- kV8PrototypeInternalFieldcount && |
- type->wrapper_type_prototype == |
- WrapperTypeInfo::kWrapperTypeObjectPrototype) { |
- prototype_object->SetAlignedPointerInInternalField( |
- kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type)); |
- } |
- type->PreparePrototypeAndInterfaceObject(current_context, world, |
- prototype_object, interface_object, |
- interface_template); |
- if (type->wrapper_type_prototype == |
- WrapperTypeInfo::kWrapperTypeExceptionPrototype) { |
- if (!V8CallBoolean(prototype_object->SetPrototype( |
- current_context, error_prototype_.NewLocal(isolate_)))) { |
+ v8::Local<v8::Object> prototype_object; |
+ if (type->wrapper_type_prototype != |
+ WrapperTypeInfo::kWrapperTypeNoPrototype) { |
+ v8::Local<v8::Value> prototype_value; |
+ if (!interface_object |
+ ->Get(current_context, V8AtomicString(isolate_, "prototype")) |
+ .ToLocal(&prototype_value) || |
+ !prototype_value->IsObject()) |
return v8::Local<v8::Function>(); |
+ prototype_object = prototype_value.As<v8::Object>(); |
+ if (prototype_object->InternalFieldCount() == |
+ kV8PrototypeInternalFieldcount && |
+ type->wrapper_type_prototype == |
+ WrapperTypeInfo::kWrapperTypeObjectPrototype) { |
+ prototype_object->SetAlignedPointerInInternalField( |
+ kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type)); |
+ } |
+ type->PreparePrototypeAndInterfaceObject(current_context, world, |
+ prototype_object, interface_object, |
+ interface_template); |
+ if (type->wrapper_type_prototype == |
+ WrapperTypeInfo::kWrapperTypeExceptionPrototype) { |
+ if (!V8CallBoolean(prototype_object->SetPrototype( |
+ current_context, error_prototype_.NewLocal(isolate_)))) { |
+ return v8::Local<v8::Function>(); |
+ } |
} |
} |