]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/ErrorConstructor.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / ErrorConstructor.cpp
index b143f5a187d6693f93a7fb532c64955fff760d61..30c4faae5f2613e78868d0e66065dcfa5e807601 100644 (file)
 #include "ErrorConstructor.h"
 
 #include "ErrorPrototype.h"
+#include "Interpreter.h"
 #include "JSGlobalObject.h"
 #include "JSString.h"
-#include "Operations.h"
+#include "JSCInlines.h"
 
 namespace JSC {
 
-ASSERT_HAS_TRIVIAL_DESTRUCTOR(ErrorConstructor);
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(ErrorConstructor);
 
-const ClassInfo ErrorConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorConstructor) };
+const ClassInfo ErrorConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(ErrorConstructor) };
 
-ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
-    : InternalFunction(globalObject, structure)
+ErrorConstructor::ErrorConstructor(VM& vm, Structure* structure)
+    : InternalFunction(vm, structure)
 {
 }
 
-void ErrorConstructor::finishCreation(ExecState* exec, ErrorPrototype* errorPrototype)
+void ErrorConstructor::finishCreation(VM& vm, ErrorPrototype* errorPrototype)
 {
-    Base::finishCreation(exec->vm(), errorPrototype->classInfo()->className);
+    Base::finishCreation(vm, errorPrototype->classInfo()->className);
     // ECMA 15.11.3.1 Error.prototype
-    putDirectWithoutTransition(exec->vm(), exec->propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly);
-    putDirectWithoutTransition(exec->vm(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum);
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, errorPrototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum);
 }
 
 // ECMA 15.9.3
 
-static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::constructWithErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
-    return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
+    return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 
 ConstructType ErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructWithErrorConstructor;
+    constructData.native.function = Interpreter::constructWithErrorConstructor;
     return ConstructTypeHost;
 }
 
-static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
-    return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
+    return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 
 CallType ErrorConstructor::getCallData(JSCell*, CallData& callData)
 {
-    callData.native.function = callErrorConstructor;
+    callData.native.function = Interpreter::callErrorConstructor;
     return CallTypeHost;
 }