]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumberObject.cpp
JavaScriptCore-1097.3.3.tar.gz
[apple/javascriptcore.git] / runtime / NumberObject.cpp
index 0e8df1730fff84c4ba5c1525526cabf112b8c853..1fea254647a4ed03826691765542580e94b3dc15 100644 (file)
 namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(NumberObject);
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(NumberObject);
 
-const ClassInfo NumberObject::info = { "Number", 0, 0, 0 };
+const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(NumberObject) };
 
-NumberObject::NumberObject(PassRefPtr<Structure> structure)
-    : JSWrapperObject(structure)
+NumberObject::NumberObject(JSGlobalData& globalData, Structure* structure)
+    : JSWrapperObject(globalData, structure)
 {
 }
 
-JSValue NumberObject::getJSNumber()
+void NumberObject::finishCreation(JSGlobalData& globalData)
 {
-    return internalValue();
+    Base::finishCreation(globalData);
+    ASSERT(inherits(&s_info));
 }
 
-NumberObject* constructNumber(ExecState* exec, JSValue number)
+NumberObject* constructNumber(ExecState* exec, JSGlobalObject* globalObject, JSValue number)
 {
-    NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure());
-    object->setInternalValue(number);
+    NumberObject* object = NumberObject::create(exec->globalData(), globalObject->numberObjectStructure());
+    object->setInternalValue(exec->globalData(), number);
     return object;
 }