[PATCH v5 02/11] jscript: Use to_primitive when getting the default value for js objects.

Jacek Caban jacek at codeweavers.com
Mon Nov 22 08:41:19 CST 2021


On 11/22/21 1:52 PM, Gabriel Ivăncescu wrote:
> On 22/11/2021 14:22, Jacek Caban wrote:
>> Hi Gabriel,
>>
>> On 11/19/21 7:03 PM, Gabriel Ivăncescu wrote:
>>> diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
>>> index 69897cd..d37fbd1 100644
>>> --- a/dlls/jscript/jscript.h
>>> +++ b/dlls/jscript/jscript.h
>>> @@ -230,6 +230,9 @@ typedef struct {
>>>       builtin_setter_t setter;
>>>   } builtin_prop_t;
>>> +HRESULT 
>>> jsdisp_builtin_get_default_value(script_ctx_t*,jsdisp_t*,jsval_t*) 
>>> DECLSPEC_HIDDEN;
>>> +#define JSDISP_DEFINE_BUILTIN_VALUE(value) {NULL, value,0, 
>>> jsdisp_builtin_get_default_value}
>>
>>
>> Could we just handle DISPID_VALUE in dispex.c callers without using 
>> builtin_prop_t at all?
>>
>>
>> Thanks,
>>
>> Jacek
>>
>
> How are we going to handle the methods then, for the jsdisps that have 
> them? For example, Function_value. Wouldn't it require special-casing 
> them? I thought it's less "elegant" since it doesn't re-use the same 
> code path as now, just different builtin data.


I meant it only for getter, Function_value is for calling DISPID_VALUE. 
If getter is the same in every builtin_info_t, then it means that it's 
redundant, which is not really elegant. DISPID_VALUE is special in many 
ways, I don't see what's wrong with handling it separately.


Jacek




More information about the wine-devel mailing list