Jacek Caban : jscript: Move function name to NativeFunction.

Alexandre Julliard julliard at winehq.org
Wed Aug 14 20:17:23 CDT 2019


Module: wine
Branch: master
Commit: 462ab9b42b12dae252e5876998d72b8b8ab005c1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=462ab9b42b12dae252e5876998d72b8b8ab005c1

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug 14 13:18:39 2019 +0200

jscript: Move function name to NativeFunction.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/function.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index 447fe62..d373cbe 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -30,7 +30,6 @@ typedef struct _function_vtbl_t function_vtbl_t;
 typedef struct {
     jsdisp_t dispex;
     const function_vtbl_t *vtbl;
-    const WCHAR *name;
     DWORD flags;
     DWORD length;
 } FunctionInstance;
@@ -51,6 +50,7 @@ typedef struct {
 typedef struct {
     FunctionInstance function;
     builtin_invoke_t proc;
+    const WCHAR *name;
 } NativeFunction;
 
 typedef struct {
@@ -567,8 +567,9 @@ static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, ID
     return hres;
 }
 
-static HRESULT NativeFunction_toString(FunctionInstance *function, jsstr_t **ret)
+static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret)
 {
+    NativeFunction *function = (NativeFunction*)func;
     DWORD name_len;
     jsstr_t *str;
     WCHAR *ptr;
@@ -623,7 +624,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
     }
 
     function->proc = value_proc;
-    function->function.name = name;
+    function->name = name;
 
     *ret = &function->function.dispex;
     return S_OK;
@@ -886,13 +887,13 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
         return hres;
 
     prot->proc = FunctionProt_value;
-    prot->function.name = prototypeW;
+    prot->name = prototypeW;
 
     hres = create_function(ctx, &FunctionInst_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR|1,
                            TRUE, &prot->function.dispex, (void**)&constr);
     if(SUCCEEDED(hres)) {
         constr->proc = FunctionConstr_value;
-        constr->function.name = FunctionW;
+        constr->name = FunctionW;
         hres = jsdisp_define_data_property(&constr->function.dispex, prototypeW, 0, jsval_obj(&prot->function.dispex));
         if(SUCCEEDED(hres))
             hres = set_constructor_prop(ctx, &constr->function.dispex, &prot->function.dispex);




More information about the wine-cvs mailing list