@@ -28382,12 +28382,13 @@ static void add_eval_variables(JSContext *ctx, JSFunctionDef *s)
28382
28382
is_arg_scope = (scope_idx == ARG_SCOPE_END);
28383
28383
if (!is_arg_scope) {
28384
28384
/* add unscoped variables */
28385
+ /* XXX: propagate is_const and var_kind too ? */
28385
28386
for(i = 0; i < fd->arg_count; i++) {
28386
28387
vd = &fd->args[i];
28387
28388
if (vd->var_name != JS_ATOM_NULL) {
28388
28389
get_closure_var(ctx, s, fd,
28389
- TRUE, i, vd->var_name, FALSE, FALSE,
28390
- JS_VAR_NORMAL);
28390
+ TRUE, i, vd->var_name, FALSE,
28391
+ vd->is_lexical, JS_VAR_NORMAL);
28391
28392
}
28392
28393
}
28393
28394
for(i = 0; i < fd->var_count; i++) {
@@ -28397,8 +28398,8 @@ static void add_eval_variables(JSContext *ctx, JSFunctionDef *s)
28397
28398
vd->var_name != JS_ATOM__ret_ &&
28398
28399
vd->var_name != JS_ATOM_NULL) {
28399
28400
get_closure_var(ctx, s, fd,
28400
- FALSE, i, vd->var_name, FALSE, FALSE,
28401
- JS_VAR_NORMAL);
28401
+ FALSE, i, vd->var_name, FALSE,
28402
+ vd->is_lexical, JS_VAR_NORMAL);
28402
28403
}
28403
28404
}
28404
28405
} else {
@@ -28407,8 +28408,8 @@ static void add_eval_variables(JSContext *ctx, JSFunctionDef *s)
28407
28408
/* do not close top level last result */
28408
28409
if (vd->scope_level == 0 && is_var_in_arg_scope(vd)) {
28409
28410
get_closure_var(ctx, s, fd,
28410
- FALSE, i, vd->var_name, FALSE, FALSE,
28411
- JS_VAR_NORMAL);
28411
+ FALSE, i, vd->var_name, FALSE,
28412
+ vd->is_lexical, JS_VAR_NORMAL);
28412
28413
}
28413
28414
}
28414
28415
}
0 commit comments