diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index e4c53322b8d..076b76889cc 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1327,11 +1327,8 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t BOOL have_default = FALSE; statement_t *stat_iter; case_clausule_t *iter; - unsigned off_backup; HRESULT hres; - off_backup = ctx->code_off; - hres = compile_expression(ctx, stat->expr); if(FAILED(hres)) return hres; @@ -1394,11 +1391,6 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t for(stat_iter = iter->stat; stat_iter && (!iter->next || iter->next->stat != stat_iter); stat_iter = stat_iter->next) { hres = compile_statement(ctx, &stat_ctx, stat_iter); - if(hres == E_NOTIMPL) { - ctx->code_off = off_backup; - stat->stat.eval = switch_statement_eval; - return compile_interp_fallback(ctx, &stat->stat); - } if(FAILED(hres)) break; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 6e8ae3c15ba..746002f19d8 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -915,74 +915,6 @@ static HRESULT interp_case(exec_ctx_t *ctx) return S_OK; } -/* ECMA-262 3rd Edition 12.13 */ -HRESULT switch_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) -{ - switch_statement_t *stat = (switch_statement_t*)_stat; - case_clausule_t *iter, *default_clausule = NULL; - statement_t *stat_iter; - VARIANT val, cval; - BOOL b; - HRESULT hres; - - TRACE("\n"); - - hres = expr_eval(ctx, stat->expr, &rt->ei, &val); - if(FAILED(hres)) - return hres; - - for(iter = stat->case_list; iter; iter = iter->next) { - if(!iter->expr) { - default_clausule = iter; - continue; - } - - hres = expr_eval(ctx, iter->expr, &rt->ei, &cval); - if(FAILED(hres)) - break; - - hres = equal2_values(&val, &cval, &b); - VariantClear(&cval); - if(FAILED(hres) || b) - break; - } - - VariantClear(&val); - if(FAILED(hres)) - return hres; - - if(!iter) - iter = default_clausule; - - V_VT(&val) = VT_EMPTY; - if(iter) { - VARIANT tmp; - - for(stat_iter = iter->stat; stat_iter; stat_iter = stat_iter->next) { - hres = stat_eval(ctx, stat_iter, rt, &tmp); - if(FAILED(hres)) - break; - - VariantClear(&val); - val = tmp; - - if(rt->type != RT_NORMAL) - break; - } - } - - if(FAILED(hres)) { - VariantClear(&val); - return hres; - } - - if(rt->type == RT_BREAK) - rt->type = RT_NORMAL; - - *ret = val; - return S_OK; -} - /* ECMA-262 3rd Edition 12.13 */ static HRESULT interp_throw(exec_ctx_t *ctx) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index f4f06c16a0e..385778ed723 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -417,7 +417,6 @@ HRESULT while_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 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; typedef struct {