Re: Jacek Caban : jscript: Added with statement implementation.
Hello Jacek, this patch introduces a gcc warning: dlls/jscript/engine.c:954: warning: empty body in an if-statement Alexandre Julliard wrote:
Module: wine Branch: master Commit: dfb867af56f4b15986482deef588d33d2458b101 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dfb867af56f4b15986482deef5...
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 19 00:43:53 2008 +0200
jscript: Added with statement implementation.
---
dlls/jscript/engine.c | 44 +++++++++++++++++++++++++++++++++++++++++--- dlls/jscript/tests/lang.js | 4 ++++ 2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index f4b065f..b89d808 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -924,12 +924,50 @@ HRESULT return_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t return S_OK; }
-HRESULT with_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.10 */ +HRESULT with_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + with_statement_t *stat = (with_statement_t*)_stat; + exprval_t exprval; + IDispatch *disp; + DispatchEx *obj; + VARIANT val; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + 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->scope_chain, obj, &ctx->scope_chain); + jsdisp_release(obj); + if(FAILED(hres)); Not sure if the if should be just removed or the two statements swapped and become if(FAILED(hres)) jsdisp_release(obj);
+ + hres = stat_eval(ctx, stat->statement, rt, ret); + + scope_pop(&ctx->scope_chain); + return hres; }
+/* ECMA-262 3rd Edition 12.12 */ HRESULT labelled_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) { FIXME("\n");
bye michael
participants (1)
-
Michael Stefaniuc