diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 649ff47f7e4..ab9f434c94b 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -671,10 +671,21 @@ HRESULT continue_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_ return E_NOTIMPL; } -HRESULT break_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.8 */ +HRESULT break_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + branch_statement_t *stat = (branch_statement_t*)_stat; + + TRACE("\n"); + + if(stat->identifier) { + FIXME("indentifier not implemented\n"); + return E_NOTIMPL; + } + + rt->type = RT_BREAK; + V_VT(ret) = VT_EMPTY; + return S_OK; } /* ECMA-262 3rd Edition 12.9 */ diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 19b7cbe6368..af865e57fdc 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -446,4 +446,20 @@ case false: } ok(state === "false", "state = " + state); +state = ""; +switch(1) { +case "1": + ok(false, "unexpected case \"1\""); +case 1: + ok(state === "", "case 1: state = " + state); + state = "1"; +default: + ok(state === "1", "default: state = " + state); + state = "default"; + break; +case false: + ok(false, "unexpected case false"); +} +ok(state === "default", "state = " + state); + reportSuccess();