From c7fc18a6c771d6796e6dee67c9616467ce697821 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 12 Apr 2021 15:47:51 +0200 Subject: [PATCH] jscript: Ignore an attempt to set visible host object identifier's value in ES5 mode. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/jscript/engine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 106fdabd81c..06b0fd673b3 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1291,7 +1291,8 @@ static HRESULT interp_identifier_ref(script_ctx_t *ctx, BSTR identifier, unsigne exprval_set_disp_ref(&exprval, to_disp(script_obj), id); } - if(exprval.type == EXPRVAL_JSVAL || exprval.type == EXPRVAL_INVALID) { + if(exprval.type == EXPRVAL_INVALID || + (exprval.type == EXPRVAL_JSVAL && ctx->version < SCRIPTLANGUAGEVERSION_ES5)) { WARN("invalid ref\n"); exprval_release(&exprval); exprval_set_exception(&exprval, JS_E_OBJECT_EXPECTED);