[PATCH 5/9] jscript: Pass a jsval "this" to builtin functions.

Jacek Caban jacek at codeweavers.com
Fri Dec 3 09:01:17 CST 2021


Hi Gabriel,

On 12/3/21 2:57 PM, Gabriel Ivăncescu wrote:
> -static HRESULT Object_isPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
> +static HRESULT Object_isPrototypeOf(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv,
>           jsval_t *r)
>   {
> -    jsdisp_t *jsdisp;
> +    jsdisp_t *jsthis, *jsdisp;
>       BOOL ret = FALSE;
>   
> +    if(!is_object_instance(vthis))
> +        return JS_E_OBJECT_EXPECTED;


This is not what spec says. I caught this one, but it shows a wider 
problem: a ton of builtin functions are supposed to call to_object on 
this argument. With later patches, they will start failing instead. In 
fact, to_object on this argument is so common that maybe we could 
continue doing that before calling the function based on some flag in 
the description, opt-in or opt-out. Did you review the spec in that context?


Thanks,

Jacek




More information about the wine-devel mailing list