X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/ExceptionHelpers.h?ds=sidebyside diff --git a/runtime/ExceptionHelpers.h b/runtime/ExceptionHelpers.h index 66d8136..305ebef 100644 --- a/runtime/ExceptionHelpers.h +++ b/runtime/ExceptionHelpers.h @@ -29,43 +29,36 @@ #ifndef ExceptionHelpers_h #define ExceptionHelpers_h +#include "ErrorInstance.h" #include "JSObject.h" namespace JSC { -typedef JSObject* (*ErrorFactory)(ExecState*, const String&); +typedef JSObject* (*ErrorFactory)(ExecState*, const String&, ErrorInstance::SourceAppender); JSObject* createTerminatedExecutionException(VM*); -bool isTerminatedExecutionException(JSObject*); -JS_EXPORT_PRIVATE bool isTerminatedExecutionException(JSValue); -JS_EXPORT_PRIVATE JSObject* createError(ExecState*, ErrorFactory, JSValue, const String&); +JS_EXPORT_PRIVATE bool isTerminatedExecutionException(Exception*); +JS_EXPORT_PRIVATE JSObject* createError(ExecState*, JSValue, const String&, ErrorInstance::SourceAppender); JS_EXPORT_PRIVATE JSObject* createStackOverflowError(ExecState*); -JSObject* createStackOverflowError(JSGlobalObject*); -JSObject* createOutOfMemoryError(JSGlobalObject*); JSObject* createUndefinedVariableError(ExecState*, const Identifier&); JSObject* createNotAnObjectError(ExecState*, JSValue); -JSObject* createInvalidParameterError(ExecState*, const char* op, JSValue); +JSObject* createInvalidFunctionApplyParameterError(ExecState*, JSValue); +JSObject* createInvalidInParameterError(ExecState*, JSValue); +JSObject* createInvalidInstanceofParameterError(ExecState*, JSValue); JSObject* createNotAConstructorError(ExecState*, JSValue); JSObject* createNotAFunctionError(ExecState*, JSValue); JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const String&); JSString* errorDescriptionForValue(ExecState*, JSValue); -JSObject* throwOutOfMemoryError(ExecState*); -JSObject* throwStackOverflowError(ExecState*); -JSObject* throwTerminatedExecutionException(ExecState*); +JS_EXPORT_PRIVATE JSObject* throwOutOfMemoryError(ExecState*); +JS_EXPORT_PRIVATE JSObject* throwStackOverflowError(ExecState*); +JS_EXPORT_PRIVATE JSObject* throwTerminatedExecutionException(ExecState*); -class TerminatedExecutionError : public JSNonFinalObject { -private: - TerminatedExecutionError(VM& vm) - : JSNonFinalObject(vm, vm.terminatedExecutionErrorStructure.get()) - { - } - - static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); - +class TerminatedExecutionError final : public JSNonFinalObject { public: typedef JSNonFinalObject Base; + static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal; static TerminatedExecutionError* create(VM& vm) { @@ -80,6 +73,15 @@ public: } DECLARE_EXPORT_INFO; + +private: + explicit TerminatedExecutionError(VM& vm) + : JSNonFinalObject(vm, vm.terminatedExecutionErrorStructure.get()) + { + } + + static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); + }; } // namespace JSC