Skip to content

Commit

Permalink
Treat return values from sm_eval as errors only if the
Browse files Browse the repository at this point in the history
top-level property is "error" or the return value is
a list whose only entry is the tuple {"error":"notfound"}.
  • Loading branch information
Kelly McLaughlin committed Mar 30, 2011
1 parent 5df342f commit 79453d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c_src/spidermonkey_drv.c
Expand Up @@ -115,7 +115,7 @@ void run_js(void *jsargs) {
char *filename = read_string(&data);
char *code = read_string(&data);
result = sm_eval(dd->vm, filename, code, 1);
if (strstr(result, "{\"error\"") != NULL) {
if ((strncmp(result, "[{\"error\":\"notfound\"}]", 22) == 0) || (strncmp(result, "{\"error\"", 8) == 0)) {
send_error_string_response(dd, call_id, result);
}
else {
Expand Down

0 comments on commit 79453d3

Please sign in to comment.