rterror.cpp 1.5 KB

1234567891011121314151617181920212223242526272829
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #include <ParserPch.h>
  6. #include "rtError.h"
  7. // PUBLIC ERROR codes
  8. // verify HR is as-expected for the Legacy (private) error JSERR_CantExecute
  9. C_ASSERT(JSCRIPT_E_CANTEXECUTE != JSERR_CantExecute);
  10. // verify the HR value (as MAKE_HRESULT(SEVERITY_ERROR, FACILITY_CONTROL, 0x1393))
  11. C_ASSERT(JSERR_CantExecute == 0x800A1393);
  12. // verify HR matches between public SDK and private (.h) files
  13. C_ASSERT(JSCRIPT_E_CANTEXECUTE == JSPUBLICERR_CantExecute);
  14. // verify the HR value (as MAKE_HRESULT(SEVERITY_ERROR, FACILITY_JSCRIPT, 0x0001))
  15. C_ASSERT(JSPUBLICERR_CantExecute == 0x89020001L);
  16. // /PUBLIC ERROR codes
  17. // boundary check - all errNum should be capped to 10,000 (RTERROR_STRINGFORMAT_OFFSET) - except for VBSERR_CantDisplayDate==32812
  18. #define VERIFY_BOUNDARY_ERRNUM(name,errnum) C_ASSERT(name == VBSERR_CantDisplayDate || errnum < RTERROR_STRINGFORMAT_OFFSET);
  19. #define RT_ERROR_MSG(name, errnum, str1, str2, jst, errorNumSource) VERIFY_BOUNDARY_ERRNUM(name, errnum)
  20. #define RT_PUBLICERROR_MSG(name, errnum, str1, str2, jst, errorNumSource) VERIFY_BOUNDARY_ERRNUM(name, errnum)
  21. #include "rterrors.h"
  22. #undef RT_PUBLICERROR_MSG
  23. #undef RT_ERROR_MSG