0ad/source/scripting/JSUtil.cpp
janwas 37c87a6579 # housekeeping
add new JSUtil, automatically included via SpiderMonkey.h.
move JS_ASSERT there and rename JSU_ASSERT.
move scriptglue's REQUIRE_PARAMS there and rename to JSU_*
replace if(argc < x) bail() code with those macros.

This was SVN commit r4169.
2006-07-26 13:10:13 +00:00

16 lines
351 B
C++

#include "precompiled.h"
#include "SpiderMonkey.h"
jsval jsu_report_param_error(JSContext* cx, jsval* rval)
{
JS_ReportError(cx, "Invalid parameter(s) or count");
if(rval)
*rval = JSVAL_NULL;
// yes, we had an error, but returning JS_FALSE would cause SpiderMonkey
// to abort. that would be hard to debug.
return JS_TRUE;
}