All prototypes should call didBecomePrototype()
[WebKit-https.git] / Source / WebCore / bindings / scripts / CodeGeneratorJS.pm
index 35636c9..f29422d 100644 (file)
@@ -7088,6 +7088,7 @@ sub GeneratePrototypeDeclaration
     push(@$outputArray, "    ${prototypeClassName}(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)\n");
     push(@$outputArray, "        : JSC::JSNonFinalObject(vm, structure)\n");
     push(@$outputArray, "    {\n");
+    push(@$outputArray, "        didBecomePrototype();\n");
     push(@$outputArray, "    }\n");
 
     if (PrototypeHasStaticPropertyTable($interface)) {
@@ -7322,7 +7323,9 @@ sub GenerateConstructorHelperMethods
 
     if (!$generatingNamedConstructor and $interface->parentType) {
         my $parentClassName = "JS" . $interface->parentType->name;
-        push(@$outputArray, "    return ${parentClassName}::getConstructor(vm, &globalObject);\n");
+        push(@$outputArray, "    auto result = ${parentClassName}::getConstructor(vm, &globalObject);\n");
+        push(@$outputArray, "    result.getObject()->didBecomePrototype();\n");
+        push(@$outputArray, "    return result;\n");
     } else {
         AddToImplIncludes("<JavaScriptCore/FunctionPrototype.h>");
         push(@$outputArray, "    UNUSED_PARAM(vm);\n");