jscript: Always use bytecode for with statement.

This commit is contained in:
Jacek Caban 2011-12-29 11:06:13 +01:00 committed by Alexandre Julliard
parent 63a9217539
commit 1c0fe6002d
3 changed files with 0 additions and 47 deletions

View File

@ -1313,11 +1313,8 @@ static HRESULT compile_break_statement(compiler_ctx_t *ctx, branch_statement_t *
static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *stat)
{
statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1, -1};
unsigned off_backup;
HRESULT hres;
off_backup = ctx->code_off;
hres = compile_expression(ctx, stat->expr);
if(FAILED(hres))
return hres;
@ -1326,11 +1323,6 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta
return E_OUTOFMEMORY;
hres = compile_statement(ctx, &stat_ctx, stat->statement);
if(hres == E_NOTIMPL) {
ctx->code_off = off_backup;
stat->stat.eval = with_statement_eval;
return compile_interp_fallback(ctx, &stat->stat);
}
if(FAILED(hres))
return hres;

View File

@ -1067,44 +1067,6 @@ HRESULT return_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type
return S_OK;
}
/* ECMA-262 3rd Edition 12.10 */
HRESULT with_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret)
{
with_statement_t *stat = (with_statement_t*)_stat;
IDispatch *disp;
jsdisp_t *obj;
VARIANT val;
HRESULT hres;
TRACE("\n");
hres = expr_eval(ctx, stat->expr, &rt->ei, &val);
if(FAILED(hres))
return hres;
hres = to_object(ctx, &val, &disp);
VariantClear(&val);
if(FAILED(hres))
return hres;
obj = iface_to_jsdisp((IUnknown*)disp);
IDispatch_Release(disp);
if(!obj) {
FIXME("disp id not jsdisp\n");
return E_NOTIMPL;
}
hres = scope_push(ctx->exec_ctx->scope_chain, obj, &ctx->exec_ctx->scope_chain);
jsdisp_release(obj);
if(FAILED(hres))
return hres;
hres = stat_eval(ctx, stat->statement, rt, ret);
scope_pop(&ctx->exec_ctx->scope_chain);
return hres;
}
/* ECMA-262 3rd Edition 12.10 */
HRESULT interp_push_scope(exec_ctx_t *ctx)
{

View File

@ -419,7 +419,6 @@ HRESULT forin_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*)
HRESULT continue_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT break_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT return_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT with_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT switch_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT try_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;