jscript: Move function name to NativeFunction.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cc22ee7f2e
commit
462ab9b42b
|
@ -30,7 +30,6 @@ typedef struct _function_vtbl_t function_vtbl_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
jsdisp_t dispex;
|
jsdisp_t dispex;
|
||||||
const function_vtbl_t *vtbl;
|
const function_vtbl_t *vtbl;
|
||||||
const WCHAR *name;
|
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
DWORD length;
|
DWORD length;
|
||||||
} FunctionInstance;
|
} FunctionInstance;
|
||||||
|
@ -51,6 +50,7 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FunctionInstance function;
|
FunctionInstance function;
|
||||||
builtin_invoke_t proc;
|
builtin_invoke_t proc;
|
||||||
|
const WCHAR *name;
|
||||||
} NativeFunction;
|
} NativeFunction;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -567,8 +567,9 @@ static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, ID
|
||||||
return hres;
|
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;
|
DWORD name_len;
|
||||||
jsstr_t *str;
|
jsstr_t *str;
|
||||||
WCHAR *ptr;
|
WCHAR *ptr;
|
||||||
|
@ -623,7 +624,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
|
||||||
}
|
}
|
||||||
|
|
||||||
function->proc = value_proc;
|
function->proc = value_proc;
|
||||||
function->function.name = name;
|
function->name = name;
|
||||||
|
|
||||||
*ret = &function->function.dispex;
|
*ret = &function->function.dispex;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -886,13 +887,13 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
prot->proc = FunctionProt_value;
|
prot->proc = FunctionProt_value;
|
||||||
prot->function.name = prototypeW;
|
prot->name = prototypeW;
|
||||||
|
|
||||||
hres = create_function(ctx, &FunctionInst_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR|1,
|
hres = create_function(ctx, &FunctionInst_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR|1,
|
||||||
TRUE, &prot->function.dispex, (void**)&constr);
|
TRUE, &prot->function.dispex, (void**)&constr);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
constr->proc = FunctionConstr_value;
|
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));
|
hres = jsdisp_define_data_property(&constr->function.dispex, prototypeW, 0, jsval_obj(&prot->function.dispex));
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
hres = set_constructor_prop(ctx, &constr->function.dispex, &prot->function.dispex);
|
hres = set_constructor_prop(ctx, &constr->function.dispex, &prot->function.dispex);
|
||||||
|
|
Loading…
Reference in New Issue