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

[js] Rewrite a bit form get_property

This commit is contained in:
Witold Filipczyk 2021-05-21 21:42:14 +02:00
parent 28127b29b4
commit 3e7047ee47

View File

@ -47,6 +47,7 @@
#include "viewer/text/link.h"
#include "viewer/text/vs.h"
#include <string>
//static JSClass form_class; /* defined below */
@ -1671,6 +1672,11 @@ form_elements_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h
JS_IdToValue(ctx, id, &r_idval);
char *string = JS_EncodeString(ctx, r_idval.toString());
std::string test = string;
if (test == "item" || test == "namedItem") {
return JS_PropertyStub(ctx, hobj, hid, hvp);
}
form_elements_namedItem2(ctx, hobj, string, hvp);
return true;
}