[PATCH v4 01/12] jscript: Try to_primitive first when getting the default value.

Jacek Caban jacek at codeweavers.com
Fri Nov 19 05:01:22 CST 2021


Hi Gabriel,

On 11/18/21 7:43 PM, Gabriel Ivăncescu wrote:
> -        hres = prop_get(This, prop, &r);
> +        hres = E_FAIL;
> +        if(id == DISPID_VALUE)
> +            hres = to_primitive(This->ctx, jsval_obj(This), &r, NO_HINT);
> +        if(FAILED(hres))
> +            hres = prop_get(This, prop, &r);


You can't try to call to_primitive and ignore its failure. The call may 
have visible effects. The failure, for example, may be from a throw 
inside toString JavaScript code.


Why do you need that in the first place? The attached patch (on top of 
your patch) passes all tests. Unless there are some obscure special 
cases, it looks like we should be able to get rid of builtin 
DISPID_VALUE getters.


Thanks,

Jacek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211119/5a8217ff/attachment.bin>


More information about the wine-devel mailing list