jscript: Use jsdisp_propput_dontenum where appropriate.

This commit is contained in:
Jacek Caban 2012-11-05 15:04:01 +01:00 committed by Alexandre Julliard
parent 57f7a6fa4e
commit ea34e01493
3 changed files with 16 additions and 11 deletions

View File

@ -190,7 +190,7 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
if(FAILED(hres))
return hres;
hres = jsdisp_propput_name(err, numberW, jsval_number((INT)number));
hres = jsdisp_propput_dontenum(err, numberW, jsval_number((INT)number));
if(FAILED(hres)) {
jsdisp_release(err);
return hres;
@ -201,7 +201,7 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
if(str) {
hres = jsdisp_propput_name(err, messageW, jsval_string(str));
if(SUCCEEDED(hres))
hres = jsdisp_propput_name(err, descriptionW, jsval_string(str));
hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(str));
jsstr_release(str);
}else {
hres = E_OUTOFMEMORY;
@ -357,7 +357,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
return E_OUTOFMEMORY;
}
hres = jsdisp_propput_name(err, nameW, jsval_string(str));
hres = jsdisp_propput_dontenum(err, nameW, jsval_string(str));
jsstr_release(str);
if(SUCCEEDED(hres))
hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL,

View File

@ -104,16 +104,21 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, unsigned ar
}
for(i=0; i < argc; i++) {
hres = jsdisp_propput_idx(args, i, argv[i]);
WCHAR buf[12];
static const WCHAR formatW[] = {'%','d',0};
sprintfW(buf, formatW, i);
hres = jsdisp_propput_dontenum(args, buf, argv[i]);
if(FAILED(hres))
break;
}
if(SUCCEEDED(hres)) {
hres = jsdisp_propput_name(args, lengthW, jsval_number(argc));
hres = jsdisp_propput_dontenum(args, lengthW, jsval_number(argc));
if(SUCCEEDED(hres))
hres = jsdisp_propput_name(args, caleeW, jsval_disp(calee));
hres = jsdisp_propput_dontenum(args, caleeW, jsval_disp(calee));
}
if(FAILED(hres)) {
@ -592,7 +597,7 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_
static inline HRESULT set_prototype(script_ctx_t *ctx, jsdisp_t *dispex, jsdisp_t *prototype)
{
return jsdisp_propput_name(dispex, prototypeW, jsval_obj(prototype));
return jsdisp_propput_dontenum(dispex, prototypeW, jsval_obj(prototype));
}
HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name,

View File

@ -1245,19 +1245,19 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
hres = jsdisp_propput_name(ctx->global, MathW, jsval_obj(math));
hres = jsdisp_propput_dontenum(ctx->global, MathW, jsval_obj(math));
jsdisp_release(math);
if(FAILED(hres))
return hres;
hres = jsdisp_propput_name(ctx->global, undefinedW, jsval_undefined());
hres = jsdisp_propput_dontenum(ctx->global, undefinedW, jsval_undefined());
if(FAILED(hres))
return hres;
hres = jsdisp_propput_name(ctx->global, NaNW, jsval_number(NAN));
hres = jsdisp_propput_dontenum(ctx->global, NaNW, jsval_number(NAN));
if(FAILED(hres))
return hres;
hres = jsdisp_propput_name(ctx->global, InfinityW, jsval_number(INFINITY));
hres = jsdisp_propput_dontenum(ctx->global, InfinityW, jsval_number(INFINITY));
return hres;
}