Skip to content

Commit

Permalink
fixup: enable for closure too
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjiawen committed Feb 9, 2025
1 parent 6ea0420 commit 393c331
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -8886,8 +8886,7 @@ static int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj, JSAtom prop,
// try give function name in every possible way
if (JS_IsFunction(ctx, val)) {
JSObject *vf = JS_VALUE_GET_OBJ(val);
if (vf->class_id == JS_CLASS_BYTECODE_FUNCTION &&
vf->u.func.var_refs == NULL) {
if (vf->class_id == JS_CLASS_BYTECODE_FUNCTION) {
const char* name = get_func_name(ctx, val);
if (strcmp(name, "") == 0) {
JSValue js_value = JS_AtomToValue(ctx, prop);
Expand Down

0 comments on commit 393c331

Please sign in to comment.