]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NameConstructor.cpp
JavaScriptCore-7600.1.4.17.5.tar.gz
[apple/javascriptcore.git] / runtime / NameConstructor.cpp
index e6f85693a88ad2d7875b9aa32c727f0638578f01..392688305f6fe1e43c063f28bf5a56e5e02deacd 100644 (file)
 
 #include "JSGlobalObject.h"
 #include "NamePrototype.h"
-#include "Operations.h"
+#include "JSCInlines.h"
 
 namespace JSC {
 
-ASSERT_HAS_TRIVIAL_DESTRUCTOR(NameConstructor);
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NameConstructor);
 
 const ClassInfo NameConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(NameConstructor) };
 
-NameConstructor::NameConstructor(JSGlobalObject* globalObject, Structure* structure)
-    : InternalFunction(globalObject, structure)
+NameConstructor::NameConstructor(VM& vm, Structure* structure)
+    : InternalFunction(vm, structure)
 {
 }
 
-void NameConstructor::finishCreation(ExecState* exec, NamePrototype* prototype)
+void NameConstructor::finishCreation(VM& vm, NamePrototype* prototype)
 {
-    Base::finishCreation(exec->vm(), prototype->classInfo()->className);
-    putDirectWithoutTransition(exec->vm(), exec->propertyNames().prototype, prototype, DontEnum | DontDelete | ReadOnly);
-    putDirectWithoutTransition(exec->vm(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum);
+    Base::finishCreation(vm, prototype->classInfo()->className);
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum);
 }
 
 static EncodedJSValue JSC_HOST_CALL constructPrivateName(ExecState* exec)
 {
-    JSValue publicName = exec->argumentCount() ? exec->argument(0) : jsUndefined();
+    JSValue publicName = exec->argument(0);
     return JSValue::encode(NameInstance::create(exec->vm(), exec->lexicalGlobalObject()->privateNameStructure(), publicName.toString(exec)));
 }