From 09bab6ef85710f93850c7e8fc34f6cb13829ac8b Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 9 Dec 2023 22:26:36 +0100 Subject: Revert "add_eval_variables: do not close over `this' twice" This reverts commit 9ff482dd8d5b1b252e77712e9418b5b253f4bbf8. Importing fix from upstream instead. --- lib/quickjs/quickjs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/quickjs/quickjs.c') diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index e6a5d2e9..ffc4977f 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -30216,8 +30216,7 @@ static void add_eval_variables(JSContext *ctx, JSFunctionDef *s) /* do not close top level last result */ if (vd->scope_level == 0 && vd->var_name != JS_ATOM__ret_ && - vd->var_name != JS_ATOM_NULL && - (!has_this_binding || vd->var_name != JS_ATOM_this)) { + vd->var_name != JS_ATOM_NULL) { get_closure_var(ctx, s, fd, FALSE, i, vd->var_name, FALSE, FALSE, JS_VAR_NORMAL); -- cgit 1.4.1-2-gfad0