Module: wine Branch: master Commit: 32a3a167b6d133f6836a3fc264b0251c315ac783 URL: http://source.winehq.org/git/wine.git/?a=commit;h=32a3a167b6d133f6836a3fc264...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Sep 17 23:30:37 2008 +0200
jscript: Added break statement implementation.
---
dlls/jscript/engine.c | 17 ++++++++++++++--- dlls/jscript/tests/lang.js | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 649ff47..ab9f434 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 19b7cbe..af865e5 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();