From: Jacek Caban Subject: Re: [PATCH v3 02/11] jscript: Add a getter to obtain the function's code, if available. Message-Id: Date: Wed, 11 Dec 2019 18:32:07 +0100 In-Reply-To: References: <1303bac3ad3092538ac78d9257d3d976ff41f958.1576073190.git.gabrielopcode@gmail.com> On 12/11/19 3:08 PM, Gabriel Ivăncescu wrote: > diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c > index 7a44f50..3c3098f 100644 > --- a/dlls/jscript/function.c > +++ b/dlls/jscript/function.c > @@ -37,6 +37,7 @@ typedef struct { > struct _function_vtbl_t { > HRESULT (*call)(script_ctx_t*,FunctionInstance*,IDispatch*,unsigned,unsigned,jsval_t*,jsval_t*); > HRESULT (*toString)(FunctionInstance*,jsstr_t**); > + function_code_t* (*get_code)(FunctionInstance*); > void (*destructor)(FunctionInstance*); > }; > > @@ -524,6 +525,13 @@ static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval > return S_OK; > } > > +function_code_t *Function_get_code(jsdisp_t *jsthis) > +{ > + FunctionInstance *function = function_from_jsdisp(jsthis); > + > + return function->vtbl->get_code(function); > +} An assert with is_class() would be nice here. And more importantly, this patch introduces a dead code, please send it together with code actually using it. Thanks, Jacek