jscript: Added break statement implementation.

This commit is contained in:
Jacek Caban 2008-09-17 23:30:37 +02:00 committed by Alexandre Julliard
parent 2b16387708
commit 32a3a167b6
2 changed files with 30 additions and 3 deletions

View File

@ -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 */

View File

@ -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();