jscript: Use bytecode for assignment to member expression.
This commit is contained in:
parent
9aafd03110
commit
5b2c2c5cf9
|
@ -373,6 +373,22 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
|
|||
return E_OUTOFMEMORY;
|
||||
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:
|
||||
expr->expr.eval = assign_expression_eval;
|
||||
return compile_interp_fallback(ctx, &expr->expr);
|
||||
|
|
|
@ -3328,9 +3328,8 @@ HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
|
|||
}
|
||||
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = put_value(ctx, &exprval, &rval, ei);
|
||||
if(FAILED(hres))
|
||||
VariantClear(&rval);
|
||||
assert(exprval.type != EXPRVAL_IDREF);
|
||||
return throw_reference_error(ctx, ei, JS_E_ILLEGAL_ASSIGN, NULL);
|
||||
}
|
||||
|
||||
exprval_release(&exprval);
|
||||
|
|
Loading…
Reference in New Issue