mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[mujs] js_try and js_endtry while setting properties.
For example name="submit".
This commit is contained in:
parent
2ced113660
commit
f9d5ec099b
@ -165,13 +165,24 @@ mjs_form_set_items2(js_State *J, void *node)
|
||||
mjs_push_form_control_object(J, fc->type, fs);
|
||||
js_setindex(J, -2, counter);
|
||||
|
||||
if (fc->id && strcmp(fc->id, "item") && strcmp(fc->id, "namedItem")) {
|
||||
if (fc->id) {
|
||||
if (js_try(J)) {
|
||||
js_pop(J, 1);
|
||||
goto next;
|
||||
}
|
||||
mjs_push_form_control_object(J, fc->type, fs);
|
||||
js_setproperty(J, -2, fc->id);
|
||||
} else if (fc->name && strcmp(fc->name, "item") && strcmp(fc->name, "namedItem")) {
|
||||
js_endtry(J);
|
||||
} else if (fc->name) {
|
||||
if (js_try(J)) {
|
||||
js_pop(J, 1);
|
||||
goto next;
|
||||
}
|
||||
mjs_push_form_control_object(J, fc->type, fs);
|
||||
js_setproperty(J, -2, fc->name);
|
||||
js_endtry(J);
|
||||
}
|
||||
next:
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user