From: Jacek Caban Subject: Re: [PATCH v4 2/6] jscript: Enumerate with and block scopes. Message-Id: Date: Fri, 18 Jun 2021 12:16:45 +0200 In-Reply-To: <20210617212523.1313394-2-pgofman@codeweavers.com> References: <20210617212523.1313394-1-pgofman@codeweavers.com> <20210617212523.1313394-2-pgofman@codeweavers.com> Hi Paul, Patches look mostly good to me now, I have one doubt through: On 6/17/21 11:25 PM, Paul Gofman wrote: > case STAT_WITH: { > with_statement_t*with_stat = (with_statement_t*)stat; > + statement_ctx_t stat_ctx = {0, TRUE}; > > hres = visit_expression(ctx, with_stat->expr); > if(FAILED(hres)) > return hres; > > - hres = visit_statement(ctx, with_stat->statement); > + if (ctx->parser->script->version >= SCRIPTLANGUAGEVERSION_ES5) > + { > + if (!alloc_local_scope(ctx, &with_stat->scope_index)) > + return E_OUTOFMEMORY; > + > + stat_ctx.scope_index = with_stat->scope_index; > + } Do we need to alloc local scope for with statement? They only use passed object for the scope and, unless I'm missing something, we should never need this local scope anyway. Thanks, Jacek