forked from 0ad/0ad
janwas
37c87a6579
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.
16 lines
351 B
C++
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;
|
|
}
|