X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..b80e619319b1def83d1e8b4f84042b661be1be7f:/runtime/JSAPIValueWrapper.h diff --git a/runtime/JSAPIValueWrapper.h b/runtime/JSAPIValueWrapper.h index e16fbba..10ded4c 100644 --- a/runtime/JSAPIValueWrapper.h +++ b/runtime/JSAPIValueWrapper.h @@ -23,9 +23,8 @@ #ifndef JSAPIValueWrapper_h #define JSAPIValueWrapper_h -#include - #include "JSCell.h" +#include "CallFrame.h" namespace JSC { @@ -36,18 +35,18 @@ namespace JSC { virtual bool isAPIValueWrapper() const { return true; } - virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const; - virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue&); - virtual bool toBoolean(ExecState*) const; - virtual double toNumber(ExecState*) const; - virtual UString toString(ExecState*) const; - virtual JSObject* toObject(ExecState*) const; + static PassRefPtr createStructure(JSValue prototype) + { + return Structure::create(prototype, TypeInfo(CompoundType, OverridesMarkChildren | OverridesGetPropertyNames), AnonymousSlotCount); + } + private: - JSAPIValueWrapper(JSValue value) - : JSCell(0) + JSAPIValueWrapper(ExecState* exec, JSValue value) + : JSCell(exec->globalData().apiWrapperStructure.get()) , m_value(value) { + ASSERT(!value.isCell()); } JSValue m_value; @@ -55,7 +54,7 @@ namespace JSC { inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value) { - return new (exec) JSAPIValueWrapper(value); + return new (exec) JSAPIValueWrapper(exec, value); } } // namespace JSC