Commit ae8c45c6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use jsdisp_define_property for Error object properties.

parent 827f4590
...@@ -193,15 +193,19 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr, ...@@ -193,15 +193,19 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = jsdisp_propput_dontenum(err, numberW, jsval_number((INT)number)); hres = jsdisp_define_data_property(err, numberW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_number((INT)number));
if(FAILED(hres)) { if(FAILED(hres)) {
jsdisp_release(err); jsdisp_release(err);
return hres; return hres;
} }
hres = jsdisp_propput_name(err, messageW, jsval_string(msg)); hres = jsdisp_define_data_property(err, messageW,
PROPF_WRITABLE | PROPF_ENUMERABLE | PROPF_CONFIGURABLE,
jsval_string(msg));
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(msg)); hres = jsdisp_define_data_property(err, descriptionW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_string(msg));
if(FAILED(hres)) { if(FAILED(hres)) {
jsdisp_release(err); jsdisp_release(err);
return hres; return hres;
...@@ -355,7 +359,8 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype) ...@@ -355,7 +359,8 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
hres = jsdisp_propput_dontenum(err, nameW, jsval_string(str)); hres = jsdisp_define_data_property(err, nameW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_string(str));
jsstr_release(str); jsstr_release(str);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL, hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment