+ return jsNumber(thisObj->jsExecutable()->parameterCount());
+}
+
+static inline WriteBarrierBase<Unknown>* createPrototypeProperty(JSGlobalData& globalData, JSGlobalObject* globalObject, JSFunction* function)
+{
+ ASSERT(!function->isHostFunction());
+
+ ExecState* exec = globalObject->globalExec();
+ if (WriteBarrierBase<Unknown>* location = function->getDirectLocation(globalData, exec->propertyNames().prototype))
+ return location;
+ JSObject* prototype = constructEmptyObject(exec, globalObject->emptyObjectStructure());
+ prototype->putDirect(globalData, exec->propertyNames().constructor, function, DontEnum);
+ function->putDirect(globalData, exec->propertyNames().prototype, prototype, DontDelete | DontEnum);
+ return function->getDirectLocation(exec->globalData(), exec->propertyNames().prototype);
+}
+
+void JSFunction::preventExtensions(JSGlobalData& globalData)
+{
+ if (!isHostFunction())
+ createPrototypeProperty(globalData, scope()->globalObject.get(), this);
+ JSObject::preventExtensions(globalData);