[PATCH 9/9] jscript: Return the correct string for Object.toString(undefined) in ES5+ modes.

Jacek Caban jacek at codeweavers.com
Fri Dec 3 09:05:55 CST 2021


On 12/3/21 2:57 PM, Gabriel Ivăncescu wrote:
> diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c
> index 53f174d..fcc2afb 100644
> --- a/dlls/jscript/object.c
> +++ b/dlls/jscript/object.c
> @@ -57,6 +57,8 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
>       if(!jsdisp) {
>           if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5 && is_null(vthis))
>               str = L"[object Null]";
> +        else if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5 && is_undefined(vthis))
> +            str = L"[object Undefined]";


The fact that you need those version checks means that you miss a 
version check when calling those functions. I think that vthis should 
still always be an object for older modes.


Jacek




More information about the wine-devel mailing list