]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/DateInstance.cpp
JavaScriptCore-1097.3.tar.gz
[apple/javascriptcore.git] / runtime / DateInstance.cpp
index d8ca072491b8583dfc81e1295a2d8b392a6447df..a502770c87508b72e4f2498dd9c76275ccb78feb 100644 (file)
 #include "config.h"
 #include "DateInstance.h"
 
+#include "JSDateMath.h"
 #include "JSGlobalObject.h"
 
 #include <math.h>
-#include <wtf/DateMath.h>
 #include <wtf/MathExtras.h>
 
 using namespace WTF;
 
 namespace JSC {
 
-const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0};
+const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)};
 
 DateInstance::DateInstance(ExecState* exec, Structure* structure)
     : JSWrapperObject(exec->globalData(), structure)
 {
+}
+
+void DateInstance::finishCreation(JSGlobalData& globalData)
+{
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
-    setInternalValue(exec->globalData(), jsNaN());
+    setInternalValue(globalData, jsNaN());
 }
 
-DateInstance::DateInstance(ExecState* exec, Structure* structure, double time)
-    : JSWrapperObject(exec->globalData(), structure)
+void DateInstance::finishCreation(JSGlobalData& globalData, double time)
 {
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
-    setInternalValue(exec->globalData(), jsNumber(timeClip(time)));
+    setInternalValue(globalData, jsNumber(timeClip(time)));
+}
+
+void DateInstance::destroy(JSCell* cell)
+{
+    jsCast<DateInstance*>(cell)->DateInstance::~DateInstance();
 }
 
 const GregorianDateTime* DateInstance::calculateGregorianDateTime(ExecState* exec) const