]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/ErrorInstance.cpp
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / runtime / ErrorInstance.cpp
index e8f7ac16231eb9a9f8cfd7d8123184850b9350f8..42e7c533c9b24da34e94c3900c2605c900340044 100644 (file)
 #include "ErrorInstance.h"
 
 #include "JSScope.h"
-#include "Operations.h"
+#include "JSCInlines.h"
 
 namespace JSC {
 
-ASSERT_HAS_TRIVIAL_DESTRUCTOR(ErrorInstance);
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(ErrorInstance);
 
 const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorInstance) };
 
@@ -36,4 +36,15 @@ ErrorInstance::ErrorInstance(VM& vm, Structure* structure)
 {
 }
 
+void ErrorInstance::finishCreation(VM& vm, const String& message, Vector<StackFrame> stackTrace)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+    if (!message.isNull())
+        putDirect(vm, vm.propertyNames->message, jsString(&vm, message), DontEnum);
+    
+    if (!stackTrace.isEmpty())
+        putDirect(vm, vm.propertyNames->stack, vm.interpreter->stackTraceAsString(vm.topCallFrame, stackTrace), DontEnum);
+}
+    
 } // namespace JSC