diff --git a/libs/js/src/jsexn.c b/libs/js/src/jsexn.c index 74030db63a..a550e1fcd7 100644 --- a/libs/js/src/jsexn.c +++ b/libs/js/src/jsexn.c @@ -425,6 +425,7 @@ InitExceptionObject(JSContext *cx, JSObject *obj, JSString *message, APPEND_CHAR_TO_STACK('('); for (i = 0; i < fp->argc; i++) { + /* Avoid toSource bloat and fallibility for object types. */ v = fp->argv[i]; if (JSVAL_IS_PRIMITIVE(v)) { diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 2cb1d3ecd6..76dbef44f0 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1120,13 +1120,12 @@ static switch_status_t js_common_callback(switch_core_session_t *session, void * jss->stack_depth++; - if (cb_state->jss_a && cb_state->jss_a->session && cb_state->jss_a->session == session) { argv[argc++] = OBJECT_TO_JSVAL(cb_state->session_obj_a); } else if (cb_state->jss_b && cb_state->jss_b->session && cb_state->jss_b->session == session) { argv[argc++] = OBJECT_TO_JSVAL(cb_state->session_obj_b); } else { - argv[argc++] = OBJECT_TO_JSVAL(cb_state->session_state); + argv[argc++] = OBJECT_TO_JSVAL(cb_state->session_state->obj); } switch (itype) {