From 954dd16fb146250b08940aaf103864399214fed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Mon, 31 Jul 2023 18:50:59 +0300 Subject: [PATCH] jscript: Use the object containing the prop for builtin getters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since they act like values. Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/dispex.c | 2 +- dlls/mshtml/tests/es5.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 0dd575434c1..ef72860f627 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -454,7 +454,7 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, switch(prop->type) { case PROP_BUILTIN: - hres = prop->u.p->getter(This->ctx, This, r); + hres = prop->u.p->getter(This->ctx, prop_obj, r); break; case PROP_JSVAL: hres = jsval_copy(prop->u.val, r); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index cef3c77c207..38a70740698 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1720,6 +1720,9 @@ sync_test("builtin_context", function() { ok(obj === window, "obj = " + obj); obj = (function() { return this; }).call(42); ok(obj.valueOf() === 42, "obj = " + obj); + + obj = Object.create([100]); + ok(obj.length === 1, "obj.length = " + obj.length); }); sync_test("host this", function() {