Forráskód Böngészése

Add asserts to more internal errors

Tom Care 8 éve
szülő
commit
397ba30a03

+ 3 - 0
lib/Common/Exceptions/Throw.cpp

@@ -69,16 +69,19 @@ namespace Js {
     void Throw::FatalInternalError()
     {
         int scenario = 2;
+        AssertMsg(false, "Fatal internal error");
         ReportFatalException(NULL, E_FAIL, Fatal_Internal_Error, scenario);
     }
 
     void Throw::FatalInternalErrorEx(int scenario)
     {
+        AssertMsg(false, "Fatal internal error");
         ReportFatalException(NULL, E_FAIL, Fatal_Internal_Error, scenario);
     }
 
     void Throw::FatalProjectionError()
     {
+        AssertMsg(false, "Fatal projection error");
         RaiseException((DWORD)DBG_TERMINATE_PROCESS, EXCEPTION_NONCONTINUABLE, 0, NULL);
     }
 

+ 4 - 0
lib/Runtime/Library/JavascriptError.cpp

@@ -263,12 +263,14 @@ namespace Js
     \
     void __declspec(noreturn) JavascriptError::err_method(ScriptContext* scriptContext, int32 hCode, EXCEPINFO* pei) \
     { \
+        if (hCode == VBSERR_InternalError) AssertMsg(false, "Internal error"); \
         JavascriptError *pError = create_method(scriptContext); \
         SetMessageAndThrowError(scriptContext, pError, hCode, pei); \
     } \
     \
     void __declspec(noreturn) JavascriptError::err_method(ScriptContext* scriptContext, int32 hCode, PCWSTR varName) \
     { \
+        if (hCode == VBSERR_InternalError) AssertMsg(false, "Internal error"); \
         JavascriptLibrary *library = scriptContext->GetLibrary(); \
         JavascriptError *pError = library->create_method(); \
         JavascriptError::SetErrorMessage(pError, hCode, varName, scriptContext); \
@@ -277,6 +279,7 @@ namespace Js
     \
     void __declspec(noreturn) JavascriptError::err_method(ScriptContext* scriptContext, int32 hCode, JavascriptString* varName) \
     { \
+        if (hCode == VBSERR_InternalError) AssertMsg(false, "Internal error"); \
         JavascriptLibrary *library = scriptContext->GetLibrary(); \
         JavascriptError *pError = library->create_method(); \
         JavascriptError::SetErrorMessage(pError, hCode, varName->GetSz(), scriptContext); \
@@ -285,6 +288,7 @@ namespace Js
     \
     void __declspec(noreturn) JavascriptError::err_method##Var(ScriptContext* scriptContext, int32 hCode, ...) \
     { \
+        if (hCode == VBSERR_InternalError) AssertMsg(false, "Internal error"); \
         JavascriptLibrary *library = scriptContext->GetLibrary(); \
         JavascriptError *pError = library->create_method(); \
         va_list argList; \