| Index: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
|
| ===================================================================
|
| --- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (revision 144312)
|
| +++ Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (working copy)
|
| @@ -2147,8 +2147,11 @@
|
| }
|
| }
|
|
|
| + my $maybeObserveFeature = GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"});
|
| +
|
| my @beforeArgumentList;
|
| my @afterArgumentList;
|
| +
|
| my $toActiveDOMObject = "0";
|
| if ($codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) {
|
| $toActiveDOMObject = "${v8InterfaceName}::toActiveDOMObject";
|
| @@ -2163,10 +2166,10 @@
|
| push(@implContent, <<END);
|
| WrapperTypeInfo ${v8InterfaceName}Constructor::info = { ${v8InterfaceName}Constructor::GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObject, $toEventTarget, 0, ${v8InterfaceName}::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype };
|
|
|
| -static v8::Handle<v8::Value> namedConstructor(const v8::Arguments& args)
|
| +static v8::Handle<v8::Value> ${v8InterfaceName}ConstructorCallback(const v8::Arguments& args)
|
| {
|
| + ${maybeObserveFeature}
|
| END
|
| - push(@implContent, GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"}));
|
| push(@implContent, GenerateConstructorHeader());
|
| push(@implContent, <<END);
|
| Document* document = currentDocument(BindingState::instance());
|
| @@ -2221,18 +2224,16 @@
|
| V8DOMWrapper::associateObjectWithWrapper(impl.release(), &${v8InterfaceName}Constructor::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
|
| return wrapper;
|
| END
|
| +
|
| if ($raisesExceptions) {
|
| push(@implContent, " fail:\n");
|
| push(@implContent, " return setDOMException(ec, args.GetIsolate());\n");
|
| }
|
| +
|
| + push(@implContent, "}\n");
|
| +
|
| push(@implContent, <<END);
|
| -}
|
|
|
| -static v8::Handle<v8::Value> namedConstructorCallback(const v8::Arguments& args)
|
| -{
|
| - return namedConstructor(args);
|
| -}
|
| -
|
| v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}Constructor::GetTemplate(v8::Isolate* isolate)
|
| {
|
| static v8::Persistent<v8::FunctionTemplate> cachedTemplate;
|
| @@ -2240,7 +2241,7 @@
|
| return cachedTemplate;
|
|
|
| v8::HandleScope scope;
|
| - v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(namedConstructorCallback);
|
| + v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(${v8InterfaceName}ConstructorCallback);
|
|
|
| v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
|
| instance->SetInternalFieldCount(${v8InterfaceName}::internalFieldCount);
|
|
|