X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/4be4e30906bcb8ee30b4d189205cb70bad6707ce..81345200c95645a1b0d2635520f96ad55dfde63f:/runtime/ErrorInstance.cpp diff --git a/runtime/ErrorInstance.cpp b/runtime/ErrorInstance.cpp index e8f7ac1..42e7c53 100644 --- a/runtime/ErrorInstance.cpp +++ b/runtime/ErrorInstance.cpp @@ -22,11 +22,11 @@ #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 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