mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[spidermonkey] spidermonkey_check_if_function_name()
This commit is contained in:
parent
b459f64be8
commit
6659cad7ab
@ -124,3 +124,15 @@ spidermonkey_InitClass(JSContext *cx, JSObject *obj,
|
|||||||
|
|
||||||
return proto;
|
return proto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
spidermonkey_check_if_function_name(const spidermonkeyFunctionSpec funcs[], const char *string)
|
||||||
|
{
|
||||||
|
for (int i = 0; funcs[i].name; i++) {
|
||||||
|
if (!strcmp(funcs[i].name, string)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -53,6 +53,8 @@ JSObject *spidermonkey_InitClass(JSContext *cx, JSObject *obj,
|
|||||||
JSPropertySpec *static_ps,
|
JSPropertySpec *static_ps,
|
||||||
const spidermonkeyFunctionSpec *static_fs);
|
const spidermonkeyFunctionSpec *static_fs);
|
||||||
|
|
||||||
|
bool spidermonkey_check_if_function_name(const spidermonkeyFunctionSpec funcs[], const char *string);
|
||||||
|
|
||||||
static char *jsval_to_string(JSContext *ctx, JS::HandleValue hvp);
|
static char *jsval_to_string(JSContext *ctx, JS::HandleValue hvp);
|
||||||
static char *jsid_to_string(JSContext *ctx, JS::HandleId hid);
|
static char *jsid_to_string(JSContext *ctx, JS::HandleId hid);
|
||||||
|
|
||||||
|
@ -1093,11 +1093,9 @@ document_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, J
|
|||||||
}
|
}
|
||||||
string = jsid_to_string(ctx, hid);
|
string = jsid_to_string(ctx, hid);
|
||||||
|
|
||||||
for (int i = 0; document_funcs[i].name; i++) {
|
if (spidermonkey_check_if_function_name(document_funcs, string)) {
|
||||||
if (!strcmp(document_funcs[i].name, string)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach (form, document->forms) {
|
foreach (form, document->forms) {
|
||||||
if (!form->name || c_strcasecmp(string, form->name))
|
if (!form->name || c_strcasecmp(string, form->name))
|
||||||
|
Loading…
Reference in New Issue
Block a user