29 lines
1010 B
C
29 lines
1010 B
C
#include "cell.h"
|
|
|
|
// TODO: Reimplement stack depth for register VM
|
|
JSC_CCALL(debug_stack_depth, return number2js(js, 0))
|
|
|
|
// TODO: Reimplement debug introspection for register VM
|
|
JSC_CCALL(debug_build_backtrace, return JS_NewArray(js))
|
|
JSC_CCALL(debug_closure_vars, return JS_NewObject(js))
|
|
JSC_CCALL(debug_set_closure_var, return JS_NULL;)
|
|
JSC_CCALL(debug_local_vars, return JS_NewObject(js))
|
|
JSC_CCALL(debug_fn_info, return JS_NewObject(js))
|
|
JSC_CCALL(debug_backtrace_fns, return JS_NewArray(js))
|
|
|
|
static const JSCFunctionListEntry js_debug_funcs[] = {
|
|
MIST_FUNC_DEF(debug, stack_depth, 0),
|
|
MIST_FUNC_DEF(debug, build_backtrace, 0),
|
|
MIST_FUNC_DEF(debug, closure_vars, 1),
|
|
MIST_FUNC_DEF(debug, set_closure_var, 3),
|
|
MIST_FUNC_DEF(debug, local_vars, 1),
|
|
MIST_FUNC_DEF(debug, fn_info, 1),
|
|
MIST_FUNC_DEF(debug, backtrace_fns,0),
|
|
};
|
|
|
|
JSValue js_debug_use(JSContext *js) {
|
|
JSValue mod = JS_NewObject(js);
|
|
JS_SetPropertyFunctionList(js,mod,js_debug_funcs,countof(js_debug_funcs));
|
|
return mod;
|
|
}
|