Commit 1c0fe600 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Always use bytecode for with statement.

parent 63a92175
...@@ -1313,11 +1313,8 @@ static HRESULT compile_break_statement(compiler_ctx_t *ctx, branch_statement_t * ...@@ -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) static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *stat)
{ {
statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1, -1}; statement_ctx_t stat_ctx = {0, TRUE, FALSE, -1, -1};
unsigned off_backup;
HRESULT hres; HRESULT hres;
off_backup = ctx->code_off;
hres = compile_expression(ctx, stat->expr); hres = compile_expression(ctx, stat->expr);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -1326,11 +1323,6 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta ...@@ -1326,11 +1323,6 @@ static HRESULT compile_with_statement(compiler_ctx_t *ctx, with_statement_t *sta
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
hres = compile_statement(ctx, &stat_ctx, stat->statement); 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)) if(FAILED(hres))
return hres; return hres;
......
...@@ -1068,44 +1068,6 @@ HRESULT return_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type ...@@ -1068,44 +1068,6 @@ HRESULT return_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type
} }
/* ECMA-262 3rd Edition 12.10 */ /* 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) HRESULT interp_push_scope(exec_ctx_t *ctx)
{ {
IDispatch *disp; IDispatch *disp;
......
...@@ -419,7 +419,6 @@ HRESULT forin_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) ...@@ -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 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 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 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 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; HRESULT try_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment