diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/InternalFunction.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/InternalFunction.h | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/Source/JavaScriptCore/runtime/InternalFunction.h b/Source/JavaScriptCore/runtime/InternalFunction.h index e35f5f9f2..e392214a1 100644 --- a/Source/JavaScriptCore/runtime/InternalFunction.h +++ b/Source/JavaScriptCore/runtime/InternalFunction.h @@ -1,6 +1,6 @@ /* * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) - * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2006, 2007, 2008, 2016 Apple Inc. All rights reserved. * Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca) * Copyright (C) 2007 Maks Orlovich * @@ -29,40 +29,41 @@ namespace JSC { - class FunctionPrototype; +class FunctionPrototype; - class InternalFunction : public JSDestructibleObject { - public: - typedef JSDestructibleObject Base; +class InternalFunction : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + static const unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance | ImplementsDefaultHasInstance | TypeOfShouldCallGetCallData; - static JS_EXPORTDATA const ClassInfo s_info; + DECLARE_EXPORT_INFO; - JS_EXPORT_PRIVATE const String& name(ExecState*); - const String displayName(ExecState*); - const String calculatedDisplayName(ExecState*); + JS_EXPORT_PRIVATE const String& name(ExecState*); + const String displayName(ExecState*); + const String calculatedDisplayName(ExecState*); - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) - { - return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); - } + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) + { + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); + } - protected: - static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; + JS_EXPORT_PRIVATE static Structure* createSubclassStructure(ExecState*, JSValue newTarget, Structure*); - JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*); +protected: + JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); - JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); + JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); - static CallType getCallData(JSCell*, CallData&); - }; + static CallType getCallData(JSCell*, CallData&); +}; - InternalFunction* asInternalFunction(JSValue); +InternalFunction* asInternalFunction(JSValue); - inline InternalFunction* asInternalFunction(JSValue value) - { - ASSERT(asObject(value)->inherits(&InternalFunction::s_info)); - return static_cast<InternalFunction*>(asObject(value)); - } +inline InternalFunction* asInternalFunction(JSValue value) +{ + ASSERT(asObject(value)->inherits(InternalFunction::info())); + return static_cast<InternalFunction*>(asObject(value)); +} } // namespace JSC |