Commit 5b2c2c5c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use bytecode for assignment to member expression.

parent 9aafd031
...@@ -373,6 +373,22 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_ ...@@ -373,6 +373,22 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
break; break;
} }
case EXPR_MEMBER: {
member_expression_t *member_expr = (member_expression_t*)expr->expression1;
hres = compile_expression(ctx, member_expr->expression);
if(FAILED(hres))
return hres;
/* FIXME: Potential optimization */
hres = push_instr_str(ctx, OP_str, member_expr->identifier);
if(FAILED(hres))
return hres;
if(push_instr(ctx, OP_memberid) == -1)
return E_OUTOFMEMORY;
break;
}
default: default:
expr->expr.eval = assign_expression_eval; expr->expr.eval = assign_expression_eval;
return compile_interp_fallback(ctx, &expr->expr); return compile_interp_fallback(ctx, &expr->expr);
......
...@@ -3328,9 +3328,8 @@ HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla ...@@ -3328,9 +3328,8 @@ HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
} }
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = put_value(ctx, &exprval, &rval, ei); assert(exprval.type != EXPRVAL_IDREF);
if(FAILED(hres)) return throw_reference_error(ctx, ei, JS_E_ILLEGAL_ASSIGN, NULL);
VariantClear(&rval);
} }
exprval_release(&exprval); exprval_release(&exprval);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment