mirror of
https://github.com/bellard/quickjs.git
synced 2026-03-31 12:18:01 +00:00
Handle JS_PROP_AUTOINIT case in js_closure_define_global_var()
Fix https://github.com/bellard/quickjs/issues/455
This commit is contained in:
parent
080c01f346
commit
b1707d7f96
@ -16673,8 +16673,14 @@ static JSVarRef *js_closure_define_global_var(JSContext *ctx, JSClosureVar *cv,
|
||||
if (is_direct_or_indirect_eval)
|
||||
flags |= JS_PROP_CONFIGURABLE;
|
||||
|
||||
retry:
|
||||
prs = find_own_property(&pr, p, cv->var_name);
|
||||
if (prs) {
|
||||
if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT)) {
|
||||
if (JS_AutoInitProperty(ctx, p, cv->var_name, pr, prs))
|
||||
return NULL;
|
||||
goto retry;
|
||||
}
|
||||
if ((prs->flags & JS_PROP_TMASK) != JS_PROP_VARREF) {
|
||||
var_ref = js_global_object_get_uninitialized_var(ctx, p, cv->var_name);
|
||||
if (!var_ref)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user