mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Add js_hasproperty function.
This commit is contained in:
@@ -27,13 +27,13 @@ static int Fp_toString(js_State *J, int argc)
|
||||
js_Function *F = self->u.f.function;
|
||||
n = strlen("function () { ... }");
|
||||
n += strlen(F->name);
|
||||
for (i = 0; i < F->numparams; i++)
|
||||
for (i = 0; i < F->numparams; ++i)
|
||||
n += strlen(F->params[i]) + 1;
|
||||
s = malloc(n);
|
||||
strcpy(s, "function ");
|
||||
strcat(s, F->name);
|
||||
strcat(s, "(");
|
||||
for (i = 0; i < F->numparams; i++) {
|
||||
for (i = 0; i < F->numparams; ++i) {
|
||||
if (i > 0) strcat(s, ",");
|
||||
strcat(s, F->params[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user