Skip to content
Snippets Groups Projects
Commit 13a9e174 authored by rswindell's avatar rswindell
Browse files

Install an empty MSVC "invalid parameter handler" in js_PrepareToExecute() so

that MSVC RTL functions will not terminate the program (e.g. jsexec, sbbsctrl)
if an invalid parameter is detected (e.g. unsupported format specifier in call
to strftime()).
parent b07f6fab
Branches
Tags
No related merge requests found
......@@ -627,6 +627,16 @@ JSObject* DLLCALL js_CreateInternalJsObject(JSContext* cx, JSObject* parent, js_
return(obj);
}
#if defined(_MSC_VER)
void msvc_invalid_parameter_handler(const wchar_t* expression,
const wchar_t* function,
const wchar_t* file,
unsigned int line,
uintptr_t pReserved)
{
}
#endif
void DLLCALL js_PrepareToExecute(JSContext *cx, JSObject *obj, const char *filename, const char* startup_dir)
{
JSString* str;
......@@ -658,4 +668,7 @@ void DLLCALL js_PrepareToExecute(JSContext *cx, JSObject *obj, const char *filen
JS_DefineProperty(cx, js, "startup_dir", STRING_TO_JSVAL(str)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY);
}
#if defined(_MSC_VER)
_set_invalid_parameter_handler(msvc_invalid_parameter_handler);
#endif
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment