summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/scripts/CodeGeneratorJS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/scripts/CodeGeneratorJS.pm')
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 46ac42d..3be997f 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -226,7 +226,7 @@ sub IndexGetterReturnsStrings
{
my $type = shift;
- return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration";
+ return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList";
return 0;
}
@@ -643,6 +643,8 @@ sub GenerateHeader
if ($hasParent && $dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
$headerIncludes{"$implClassName.h"} = 1;
}
+
+ $headerIncludes{"<runtime/JSObjectWithGlobalObject.h>"} = 1;
$headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/;
@@ -935,8 +937,8 @@ sub GenerateHeader
# Add prototype declaration.
%structureFlags = ();
- push(@headerContent, "class ${className}Prototype : public JSC::JSObject {\n");
- push(@headerContent, " typedef JSC::JSObject Base;\n");
+ push(@headerContent, "class ${className}Prototype : public JSC::JSObjectWithGlobalObject {\n");
+ push(@headerContent, " typedef JSC::JSObjectWithGlobalObject Base;\n");
push(@headerContent, "public:\n");
if ($interfaceName eq "DOMWindow") {
push(@headerContent, " void* operator new(size_t);\n");
@@ -970,7 +972,7 @@ sub GenerateHeader
# Custom defineGetter function
push(@headerContent, " virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes);\n") if $dataNode->extendedAttributes->{"CustomPrototypeDefineGetter"};
- push(@headerContent, " ${className}Prototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }\n");
+ push(@headerContent, " ${className}Prototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }\n");
# structure flags
push(@headerContent, "protected:\n");
@@ -985,7 +987,7 @@ sub GenerateHeader
if ($numFunctions > 0) {
push(@headerContent,"// Functions\n\n");
foreach my $function (@{$dataNode->functions}) {
- next if $function->{overloadIndex} > 1;
+ next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
my $functionName = $codeGenerator->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($function->signature->name);
push(@headerContent, "JSC::JSValue JSC_HOST_CALL ${functionName}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);\n");
}
@@ -1254,7 +1256,7 @@ sub GenerateImplementation
}
foreach my $function (@{$dataNode->functions}) {
- next if $function->{overloadIndex} > 1;
+ next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
my $name = $function->signature->name;
push(@hashKeys, $name);
@@ -1440,9 +1442,9 @@ sub GenerateImplementation
push(@implContent, "JSObject* ${className}::createPrototype(ExecState* exec, JSGlobalObject* globalObject)\n");
push(@implContent, "{\n");
if ($hasParent && $parentClassName ne "JSC::DOMNodeFilter") {
- push(@implContent, " return new (exec) ${className}Prototype(${className}Prototype::createStructure(${parentClassName}Prototype::self(exec, globalObject)));\n");
+ push(@implContent, " return new (exec) ${className}Prototype(globalObject, ${className}Prototype::createStructure(${parentClassName}Prototype::self(exec, globalObject)));\n");
} else {
- push(@implContent, " return new (exec) ${className}Prototype(${className}Prototype::createStructure(globalObject->objectPrototype()));\n");
+ push(@implContent, " return new (exec) ${className}Prototype(globalObject, ${className}Prototype::createStructure(globalObject->objectPrototype()));\n");
}
push(@implContent, "}\n\n");
}
@@ -1781,7 +1783,7 @@ sub GenerateImplementation
my $functionName = $codeGenerator->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($function->signature->name);
- if (@{$function->{overloads}} > 1) {
+ if ($function->{overloads} && @{$function->{overloads}} > 1) {
# Append a number to an overloaded method's name to make it unique:
$functionName = $functionName . $function->{overloadIndex};
}
@@ -1953,7 +1955,7 @@ sub GenerateImplementation
}
push(@implContent, "}\n\n");
- if (@{$function->{overloads}} > 1 && $function->{overloadIndex} == @{$function->{overloads}}) {
+ if ($function->{overloads} && @{$function->{overloads}} > 1 && $function->{overloadIndex} == @{$function->{overloads}}) {
# Generate a function dispatching call to the rest of the overloads.
GenerateOverloadedPrototypeFunction($function, $dataNode, $implClassName);
}