1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Neither SEE nor SpiderMonkey tolerate return outside functions

This commit is contained in:
2006-01-30 11:52:58 +01:00
parent b4d9b7f5a6
commit 1dae2926fd

View File

@ -865,22 +865,18 @@ try_submit_given_form(struct session *ses, struct document_view *doc_view,
if (init_string(&code)) {
struct view_state *vs = doc_view->vs;
struct ecmascript_interpreter *interpreter;
int res = 1;
unsigned char *ret = form->onsubmit;
int res;
if (vs->ecmascript_fragile)
ecmascript_reset_state(vs);
interpreter = vs->ecmascript;
assert(interpreter);
#ifdef CONFIG_ECMASCRIPT_SEE
{
unsigned char *ret = form->onsubmit;
/* SEE doesn't like return outside functions */
while ((ret = strstr(ret, "return "))) {
while (*ret != ' ') *ret++ = ' ';
}
/* SEE and SpiderMonkey do not like return outside
* functions. */
while ((ret = strstr(ret, "return "))) {
while (*ret != ' ') *ret++ = ' ';
}
#endif
add_to_string(&code, form->onsubmit);
res = ecmascript_eval_boolback(interpreter, &code);
done_string(&code);