| Index: Source/bindings/core/v8/V8Binding.cpp
|
| diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
|
| index b010879387e759cdfb0c3588e03603a0eaeb03f1..956026bf0e9d01f35f727a489aac371f031ce90d 100644
|
| --- a/Source/bindings/core/v8/V8Binding.cpp
|
| +++ b/Source/bindings/core/v8/V8Binding.cpp
|
| @@ -74,6 +74,21 @@
|
|
|
| namespace blink {
|
|
|
| +namespace {
|
| +
|
| +template<class Callback>
|
| +void v8ConstructorAttributeGetter(const Callback& info)
|
| +{
|
| + v8::Local<v8::Value> data = info.Data();
|
| + ASSERT(data->IsExternal());
|
| + V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
|
| + if (!perContextData)
|
| + return;
|
| + v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| void setArityTypeError(ExceptionState& exceptionState, const char* valid, unsigned provided)
|
| {
|
| exceptionState.throwTypeError(ExceptionMessages::invalidArity(valid, provided));
|
| @@ -1045,4 +1060,14 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
|
| return InspectorFunctionCallEvent::data(context, info.scriptId(), info.resourceName(), info.lineNumber());
|
| }
|
|
|
| +void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +{
|
| + v8ConstructorAttributeGetter(info);
|
| +}
|
| +
|
| +void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| +{
|
| + v8ConstructorAttributeGetter(info);
|
| +}
|
| +
|
| } // namespace blink
|
|
|