Reviewed by Geoff.
[WebKit-https.git] / WebCore / bindings / scripts / CodeGeneratorJS.pm
index 0f62af79a21f8c44d09fa849aa9bfc0a20f9b40a..d9a449058c358a40f57646dd70111444e648a27e 100644 (file)
@@ -774,7 +774,7 @@ sub GenerateImplementation
     # Constructor
     if ($dataNode->extendedAttributes->{"DoNotCache"}) {
         push(@implContent, "${className}::$className($passType impl)\n");
-        push(@implContent, "    : $parentClassName(impl)\n");
+        push(@implContent, "    : $parentClassName(impl, ${className}Prototype::self())\n");
     } else {
         my $needsSVGContext = IsSVGTypeNeedingContextParameter($implClassName);
         if ($needsSVGContext) {
@@ -799,12 +799,14 @@ sub GenerateImplementation
         }
     }
 
-    if ($dataNode->extendedAttributes->{"DoNotCache"}) {
-        push(@implContent, "{\n    setPrototype(${className}Prototype::self());\n}\n\n");
-    } else {
-        push(@implContent, "{\n    setPrototype(${className}Prototype::self(exec));\n}\n\n");
+    push(@implContent, "{\n");
+
+    if (!$dataNode->extendedAttributes->{"DoNotCache"}) {
+        push(@implContent, "    setPrototype(${className}Prototype::self(exec));\n");
     }
 
+    push(@implContent, "}\n\n");
+
     # Destructor
     if (!$hasParent) {
         push(@implContent, "${className}::~$className()\n");