]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumberObject.cpp
JavaScriptCore-7600.1.4.15.12.tar.gz
[apple/javascriptcore.git] / runtime / NumberObject.cpp
index 0e8df1730fff84c4ba5c1525526cabf112b8c853..4df58e81b463e216e422457323b32b57d6a40b8e 100644 (file)
 
 #include "JSGlobalObject.h"
 #include "NumberPrototype.h"
+#include "JSCInlines.h"
 
 namespace JSC {
 
-ASSERT_CLASS_FITS_IN_CELL(NumberObject);
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(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(VM& vm, Structure* structure)
+    : JSWrapperObject(vm, structure)
 {
 }
 
-JSValue NumberObject::getJSNumber()
+void NumberObject::finishCreation(VM& vm)
 {
-    return internalValue();
+    Base::finishCreation(vm);
+    ASSERT(inherits(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->vm(), globalObject->numberObjectStructure());
+    object->setInternalValue(exec->vm(), number);
     return object;
 }