git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3696 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West committed 2006-12-18 18:10:31 +00:00
1 parent dee025e15e
commit b9245b3fe4
8 files changed
+52 -130

No files matched your search

@@ -2248,35 +2248,6 @@ static JSFunctionSpec fs_functions[] = {
};
SWITCH_SM_DECLARE(int) eval_some_js(char *code, JSContext *cx, JSObject *obj, jsval *rval)
{
JSScript *script = NULL;
char *cptr;
char *path = NULL;
int res = 0;
JS_ClearPendingException(cx);
if (code[0] == '~') {
cptr = code + 1;
script = JS_CompileScript(cx, obj, cptr, strlen(cptr), "inline", 1);
} else {
if (*code == '/') {
script = JS_CompileFile(cx, obj, code);
} else if ((path = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.script_dir, SWITCH_PATH_SEPARATOR, code))) {
script = JS_CompileFile(cx, obj, path);
switch_safe_free(path);
}
}
if (script) {
res = JS_ExecuteScript(cx, obj, script, rval) == JS_TRUE ? 1 : 0;
JS_DestroyScript(cx, script);
}
return res;
}
static int env_init(JSContext *cx, JSObject *javascript_object)
{