Also use designated initializers for builtin_info_t in preparation for further refactoring.
From: Jacek Caban jacek@codeweavers.com
--- dlls/jscript/dispex.c | 2 +- dlls/jscript/tests/lang.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 57882bf499e..493dcf7fbc9 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -2029,7 +2029,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret) { - if(prop->type == PROP_PROTREF) { + if(prop->type == PROP_PROTREF || prop->type == PROP_DELETED) { *ret = TRUE; return S_OK; } diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 30d8a338fd3..2ddfc3a8341 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -1712,6 +1712,18 @@ try { } })();
+(function() { + function constr() {} + constr.prototype = { prop: 1 }; + var o = new constr(), r; + ok(o.prop === 1, "o.prop = " + o.prop); + r = delete constr.prototype.prop; + ok(r === true, "delete returned " + r); + ok(o.prop === undefined, "o.prop = " + o.prop); + r = delete o["prop"]; + ok(r === true, "delete returned " + r); +})(); + if (false) if (true) ok(false, "if evaluated");
From: Jacek Caban jacek@codeweavers.com
--- dlls/jscript/array.c | 32 +++++++--------- dlls/jscript/arraybuf.c | 64 ++++++++++--------------------- dlls/jscript/bool.c | 17 +++------ dlls/jscript/date.c | 25 ++++-------- dlls/jscript/dispex.c | 8 +--- dlls/jscript/engine.c | 14 +++---- dlls/jscript/enumerator.c | 30 ++++----------- dlls/jscript/error.c | 18 +++------ dlls/jscript/function.c | 80 +++++++++++++++------------------------ dlls/jscript/global.c | 9 ++--- dlls/jscript/jscript.c | 9 +---- dlls/jscript/json.c | 9 ++--- dlls/jscript/jsregexp.c | 42 ++++++++------------ dlls/jscript/math.c | 8 +--- dlls/jscript/number.c | 15 ++------ dlls/jscript/object.c | 27 +++++-------- dlls/jscript/set.c | 76 ++++++++++++++----------------------- dlls/jscript/string.c | 34 +++++++---------- dlls/jscript/vbarray.c | 11 +++--- 19 files changed, 185 insertions(+), 343 deletions(-)
diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 078e2ce7d4c..a8e2934b78d 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -1640,12 +1640,11 @@ static const builtin_prop_t Array_props[] = { };
static const builtin_info_t Array_info = { - JSCLASS_ARRAY, - NULL, - ARRAY_SIZE(Array_props), - Array_props, - Array_destructor, - Array_on_put + .class = JSCLASS_ARRAY, + .props_cnt = ARRAY_SIZE(Array_props), + .props = Array_props, + .destructor = Array_destructor, + .on_put = Array_on_put, };
static const builtin_prop_t ArrayInst_props[] = { @@ -1653,12 +1652,11 @@ static const builtin_prop_t ArrayInst_props[] = { };
static const builtin_info_t ArrayInst_info = { - JSCLASS_ARRAY, - NULL, - ARRAY_SIZE(ArrayInst_props), - ArrayInst_props, - Array_destructor, - Array_on_put + .class = JSCLASS_ARRAY, + .props_cnt = ARRAY_SIZE(ArrayInst_props), + .props = ArrayInst_props, + .destructor = Array_destructor, + .on_put = Array_on_put, };
/* ECMA-262 5.1 Edition 15.4.3.2 */ @@ -1761,12 +1759,10 @@ static const builtin_prop_t ArrayConstr_props[] = { };
static const builtin_info_t ArrayConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(ArrayConstr_props), - ArrayConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(ArrayConstr_props), + .props = ArrayConstr_props, };
HRESULT create_array_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) diff --git a/dlls/jscript/arraybuf.c b/dlls/jscript/arraybuf.c index 62dfe614d65..f12720d42b0 100644 --- a/dlls/jscript/arraybuf.c +++ b/dlls/jscript/arraybuf.c @@ -121,12 +121,9 @@ static const builtin_prop_t ArrayBuffer_props[] = { };
static const builtin_info_t ArrayBuffer_info = { - JSCLASS_ARRAYBUFFER, - NULL, - ARRAY_SIZE(ArrayBuffer_props), - ArrayBuffer_props, - NULL, - NULL + .class = JSCLASS_ARRAYBUFFER, + .props_cnt = ARRAY_SIZE(ArrayBuffer_props), + .props = ArrayBuffer_props, };
static const builtin_prop_t ArrayBufferInst_props[] = { @@ -134,12 +131,9 @@ static const builtin_prop_t ArrayBufferInst_props[] = { };
static const builtin_info_t ArrayBufferInst_info = { - JSCLASS_ARRAYBUFFER, - NULL, - ARRAY_SIZE(ArrayBufferInst_props), - ArrayBufferInst_props, - NULL, - NULL + .class = JSCLASS_ARRAYBUFFER, + .props_cnt = ARRAY_SIZE(ArrayBufferInst_props), + .props = ArrayBufferInst_props, };
static HRESULT create_arraybuf(script_ctx_t *ctx, DWORD size, ArrayBufferInstance **ret) @@ -214,12 +208,10 @@ static const builtin_prop_t ArrayBufferConstr_props[] = { };
static const builtin_info_t ArrayBufferConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(ArrayBufferConstr_props), - ArrayBufferConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(ArrayBufferConstr_props), + .props = ArrayBufferConstr_props, };
static inline DataViewInstance *dataview_this(jsval_t vthis) @@ -610,29 +602,17 @@ static HRESULT DataView_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op o }
static const builtin_info_t DataView_info = { - JSCLASS_DATAVIEW, - NULL, - ARRAY_SIZE(DataView_props), - DataView_props, - DataView_destructor, - NULL, - NULL, - NULL, - NULL, - DataView_gc_traverse + .class = JSCLASS_DATAVIEW, + .props_cnt = ARRAY_SIZE(DataView_props), + .props = DataView_props, + .destructor = DataView_destructor, + .gc_traverse = DataView_gc_traverse };
static const builtin_info_t DataViewInst_info = { - JSCLASS_DATAVIEW, - NULL, - 0, - NULL, - DataView_destructor, - NULL, - NULL, - NULL, - NULL, - DataView_gc_traverse + .class = JSCLASS_DATAVIEW, + .destructor = DataView_destructor, + .gc_traverse = DataView_gc_traverse };
static HRESULT DataViewConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -701,12 +681,8 @@ static HRESULT DataViewConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags }
static const builtin_info_t DataViewConstr_info = { - JSCLASS_FUNCTION, - Function_value, - 0, - NULL, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, };
HRESULT init_arraybuf_constructors(script_ctx_t *ctx) diff --git a/dlls/jscript/bool.c b/dlls/jscript/bool.c index 57c5cf5b4c6..a4bbdec3a80 100644 --- a/dlls/jscript/bool.c +++ b/dlls/jscript/bool.c @@ -119,20 +119,15 @@ static const builtin_prop_t Bool_props[] = { };
static const builtin_info_t Bool_info = { - JSCLASS_BOOLEAN, - Bool_value, - ARRAY_SIZE(Bool_props), - Bool_props, - NULL, - NULL + .class = JSCLASS_BOOLEAN, + .call = Bool_value, + .props_cnt = ARRAY_SIZE(Bool_props), + .props = Bool_props, };
static const builtin_info_t BoolInst_info = { - JSCLASS_BOOLEAN, - Bool_value, - 0, NULL, - NULL, - NULL + .class = JSCLASS_BOOLEAN, + .call = Bool_value, };
static HRESULT BoolConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index b1846fb3245..d39b52177f6 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -1900,20 +1900,13 @@ static const builtin_prop_t Date_props[] = { };
static const builtin_info_t Date_info = { - JSCLASS_DATE, - NULL, - ARRAY_SIZE(Date_props), - Date_props, - NULL, - NULL + .class = JSCLASS_DATE, + .props_cnt = ARRAY_SIZE(Date_props), + .props = Date_props, };
static const builtin_info_t DateInst_info = { - JSCLASS_DATE, - NULL, - 0, NULL, - NULL, - NULL + .class = JSCLASS_DATE, };
static HRESULT create_date(script_ctx_t *ctx, jsdisp_t *object_prototype, DOUBLE time, DateInstance **ret) @@ -2436,12 +2429,10 @@ static const builtin_prop_t DateConstr_props[] = { };
static const builtin_info_t DateConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(DateConstr_props), - DateConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(DateConstr_props), + .props = DateConstr_props, };
HRESULT create_date_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 493dcf7fbc9..e8bd0be64b4 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -2204,13 +2204,7 @@ HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *b return S_OK; }
-static const builtin_info_t dispex_info = { - JSCLASS_NONE, - NULL, - 0, NULL, - NULL, - NULL -}; +static const builtin_info_t dispex_info = { .class = JSCLASS_NONE };
HRESULT create_dispex(script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype, jsdisp_t **dispex) { diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 76e6a271bdf..66bd5a98ff1 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -546,15 +546,11 @@ static HRESULT scope_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op op,
static const builtin_info_t scope_info = { JSCLASS_NONE, - NULL, - 0, - NULL, - scope_destructor, - NULL, - scope_idx_length, - scope_idx_get, - scope_idx_put, - scope_gc_traverse + .destructor = scope_destructor, + .idx_length = scope_idx_length, + .idx_get = scope_idx_get, + .idx_put = scope_idx_put, + .gc_traverse = scope_gc_traverse };
static HRESULT scope_push(script_ctx_t *ctx, scope_chain_t *scope, IDispatch *obj, scope_chain_t **ret) diff --git a/dlls/jscript/enumerator.c b/dlls/jscript/enumerator.c index d962c65d229..ed671f5cbbe 100644 --- a/dlls/jscript/enumerator.c +++ b/dlls/jscript/enumerator.c @@ -182,25 +182,15 @@ static const builtin_prop_t Enumerator_props[] = { };
static const builtin_info_t Enumerator_info = { - JSCLASS_ENUMERATOR, - NULL, - ARRAY_SIZE(Enumerator_props), - Enumerator_props, - NULL, - NULL + .class = JSCLASS_ENUMERATOR, + .props_cnt = ARRAY_SIZE(Enumerator_props), + .props = Enumerator_props, };
static const builtin_info_t EnumeratorInst_info = { - JSCLASS_ENUMERATOR, - NULL, - 0, - NULL, - Enumerator_destructor, - NULL, - NULL, - NULL, - NULL, - Enumerator_gc_traverse + .class = JSCLASS_ENUMERATOR, + .destructor = Enumerator_destructor, + .gc_traverse = Enumerator_gc_traverse };
static HRESULT alloc_enumerator(script_ctx_t *ctx, jsdisp_t *object_prototype, EnumeratorInstance **ret) @@ -324,12 +314,8 @@ static HRESULT EnumeratorConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD fla }
static const builtin_info_t EnumeratorConstr_info = { - JSCLASS_FUNCTION, - Function_value, - 0, - NULL, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, };
HRESULT create_enumerator_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 81e3a3a9739..e1f04aef38c 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -139,21 +139,15 @@ static const builtin_prop_t Error_props[] = { };
static const builtin_info_t Error_info = { - JSCLASS_ERROR, - Error_value, - ARRAY_SIZE(Error_props), - Error_props, - NULL, - NULL + .class = JSCLASS_ERROR, + .call = Error_value, + .props_cnt = ARRAY_SIZE(Error_props), + .props = Error_props, };
static const builtin_info_t ErrorInst_info = { - JSCLASS_ERROR, - Error_value, - 0, - NULL, - NULL, - NULL + .class = JSCLASS_ERROR, + .call = Error_value, };
static HRESULT alloc_error(script_ctx_t *ctx, jsdisp_t *prototype, diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 68f841b38a1..75f313b0975 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -185,15 +185,13 @@ static HRESULT Arguments_gc_traverse(struct gc_ctx *gc_ctx, enum gc_traverse_op }
static const builtin_info_t Arguments_info = { - JSCLASS_ARGUMENTS, - Arguments_value, - 0, NULL, - Arguments_destructor, - NULL, - Arguments_idx_length, - Arguments_idx_get, - Arguments_idx_put, - Arguments_gc_traverse + .class = JSCLASS_ARGUMENTS, + .call = Arguments_value, + .destructor = Arguments_destructor, + .idx_length = Arguments_idx_length, + .idx_get = Arguments_idx_get, + .idx_put = Arguments_idx_put, + .gc_traverse = Arguments_gc_traverse };
HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame) @@ -602,16 +600,12 @@ static const builtin_prop_t Function_props[] = { };
static const builtin_info_t Function_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(Function_props), - Function_props, - Function_destructor, - NULL, - NULL, - NULL, - NULL, - Function_gc_traverse + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(Function_props), + .props = Function_props, + .destructor = Function_destructor, + .gc_traverse = Function_gc_traverse };
static const builtin_prop_t FunctionInst_props[] = { @@ -621,16 +615,12 @@ static const builtin_prop_t FunctionInst_props[] = { };
static const builtin_info_t FunctionInst_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(FunctionInst_props), - FunctionInst_props, - Function_destructor, - NULL, - NULL, - NULL, - NULL, - Function_gc_traverse + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(FunctionInst_props), + .props = FunctionInst_props, + .destructor = Function_destructor, + .gc_traverse = Function_gc_traverse };
static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_info, const function_vtbl_t *vtbl, size_t size, @@ -808,16 +798,12 @@ static const builtin_prop_t InterpretedFunction_props[] = { };
static const builtin_info_t InterpretedFunction_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(InterpretedFunction_props), - InterpretedFunction_props, - Function_destructor, - NULL, - NULL, - NULL, - NULL, - Function_gc_traverse + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(InterpretedFunction_props), + .props = InterpretedFunction_props, + .destructor = Function_destructor, + .gc_traverse = Function_gc_traverse };
static HRESULT InterpretedFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, @@ -940,16 +926,12 @@ static const builtin_prop_t BindFunction_props[] = { };
static const builtin_info_t BindFunction_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(BindFunction_props), - BindFunction_props, - Function_destructor, - NULL, - NULL, - NULL, - NULL, - Function_gc_traverse + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(BindFunction_props), + .props = BindFunction_props, + .destructor = Function_destructor, + .gc_traverse = Function_gc_traverse };
static HRESULT BindFunction_call(script_ctx_t *ctx, FunctionInstance *func, jsval_t vthis, unsigned flags, diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index cc108b84e4b..2653d72cd2b 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -905,12 +905,9 @@ static const builtin_prop_t JSGlobal_props[] = { };
static const builtin_info_t JSGlobal_info = { - JSCLASS_GLOBAL, - NULL, - ARRAY_SIZE(JSGlobal_props), - JSGlobal_props, - NULL, - NULL + .class = JSCLASS_GLOBAL, + .props_cnt = ARRAY_SIZE(JSGlobal_props), + .props = JSGlobal_props, };
static HRESULT init_object_prototype_accessors(script_ctx_t *ctx, jsdisp_t *object_prototype) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 6829f80f299..fc07c818edf 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -122,14 +122,7 @@ static inline BOOL is_started(script_ctx_t *ctx)
HRESULT create_named_item_script_obj(script_ctx_t *ctx, named_item_t *item) { - static const builtin_info_t disp_info = { - JSCLASS_GLOBAL, - NULL, - 0, NULL, - NULL, - NULL - }; - + static const builtin_info_t disp_info = { .class = JSCLASS_GLOBAL }; return create_dispex(ctx, &disp_info, NULL, &item->script_obj); }
diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index 277a5e01144..a8c026b8587 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -948,12 +948,9 @@ static const builtin_prop_t JSON_props[] = { };
static const builtin_info_t JSON_info = { - JSCLASS_JSON, - NULL, - ARRAY_SIZE(JSON_props), - JSON_props, - NULL, - NULL + .class = JSCLASS_JSON, + .props_cnt = ARRAY_SIZE(JSON_props), + .props = JSON_props, };
HRESULT create_json(script_ctx_t *ctx, jsdisp_t **ret) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 70673ec190e..d184f2f2685 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -570,16 +570,12 @@ static const builtin_prop_t RegExp_props[] = { };
static const builtin_info_t RegExp_info = { - JSCLASS_REGEXP, - RegExp_value, - ARRAY_SIZE(RegExp_props), - RegExp_props, - RegExp_destructor, - NULL, - NULL, - NULL, - NULL, - RegExp_gc_traverse + .class = JSCLASS_REGEXP, + .call = RegExp_value, + .props_cnt = ARRAY_SIZE(RegExp_props), + .props = RegExp_props, + .destructor = RegExp_destructor, + .gc_traverse = RegExp_gc_traverse };
static const builtin_prop_t RegExpInst_props[] = { @@ -591,16 +587,12 @@ static const builtin_prop_t RegExpInst_props[] = { };
static const builtin_info_t RegExpInst_info = { - JSCLASS_REGEXP, - RegExp_value, - ARRAY_SIZE(RegExpInst_props), - RegExpInst_props, - RegExp_destructor, - NULL, - NULL, - NULL, - NULL, - RegExp_gc_traverse + .class = JSCLASS_REGEXP, + .call = RegExp_value, + .props_cnt = ARRAY_SIZE(RegExpInst_props), + .props = RegExpInst_props, + .destructor = RegExp_destructor, + .gc_traverse = RegExp_gc_traverse };
static HRESULT alloc_regexp(script_ctx_t *ctx, jsstr_t *str, jsdisp_t *object_prototype, RegExpInstance **ret) @@ -961,12 +953,10 @@ static const builtin_prop_t RegExpConstr_props[] = { };
static const builtin_info_t RegExpConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(RegExpConstr_props), - RegExpConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(RegExpConstr_props), + .props = RegExpConstr_props, };
HRESULT create_regexp_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index 362b877cb5e..7739f27ab0f 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -491,12 +491,8 @@ static const builtin_prop_t Math_props[] = { };
static const builtin_info_t Math_info = { - JSCLASS_MATH, - NULL, - ARRAY_SIZE(Math_props), - Math_props, - NULL, - NULL + .class = JSCLASS_MATH, .props_cnt = ARRAY_SIZE(Math_props), + .props = Math_props, };
HRESULT create_math(script_ctx_t *ctx, jsdisp_t **ret) diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c index 27c3d5ecfee..711d9bee89f 100644 --- a/dlls/jscript/number.c +++ b/dlls/jscript/number.c @@ -586,20 +586,13 @@ static const builtin_prop_t Number_props[] = { };
static const builtin_info_t Number_info = { - JSCLASS_NUMBER, - NULL, - ARRAY_SIZE(Number_props), - Number_props, - NULL, - NULL + .class = JSCLASS_NUMBER, + .props_cnt = ARRAY_SIZE(Number_props), + .props = Number_props, };
static const builtin_info_t NumberInst_info = { - JSCLASS_NUMBER, - NULL, - 0, NULL, - NULL, - NULL + .class = JSCLASS_NUMBER, };
static HRESULT NumberConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index 16ecc3dea3c..f25287b7a15 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -465,20 +465,15 @@ static const builtin_prop_t Object_props[] = { };
static const builtin_info_t Object_info = { - JSCLASS_OBJECT, - NULL, - ARRAY_SIZE(Object_props), - Object_props, - Object_destructor, - NULL + .class = JSCLASS_OBJECT, + .props_cnt = ARRAY_SIZE(Object_props), + .props = Object_props, + .destructor = Object_destructor, };
static const builtin_info_t ObjectInst_info = { - JSCLASS_OBJECT, - NULL, - 0, NULL, - Object_destructor, - NULL + .class = JSCLASS_OBJECT, + .destructor = Object_destructor, };
static void release_property_descriptor(property_desc_t *desc) @@ -1069,12 +1064,10 @@ static const builtin_prop_t ObjectConstr_props[] = { };
static const builtin_info_t ObjectConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(ObjectConstr_props), - ObjectConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(ObjectConstr_props), + .props = ObjectConstr_props, };
static HRESULT ObjectConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/set.c b/dlls/jscript/set.c index 7e49e31a5d5..f2fe562e519 100644 --- a/dlls/jscript/set.c +++ b/dlls/jscript/set.c @@ -401,25 +401,19 @@ static const builtin_prop_t Map_props[] = { };
static const builtin_info_t Map_prototype_info = { - JSCLASS_OBJECT, - Map_value, - ARRAY_SIZE(Map_prototype_props), - Map_prototype_props, - NULL, - NULL + .class = JSCLASS_OBJECT, + .call = Map_value, + .props_cnt = ARRAY_SIZE(Map_prototype_props), + .props = Map_prototype_props, };
static const builtin_info_t Map_info = { - JSCLASS_MAP, - Map_value, - ARRAY_SIZE(Map_props), - Map_props, - Map_destructor, - NULL, - NULL, - NULL, - NULL, - Map_gc_traverse + .class = JSCLASS_MAP, + .call = Map_value, + .props_cnt = ARRAY_SIZE(Map_props), + .props = Map_props, + .destructor = Map_destructor, + .gc_traverse = Map_gc_traverse, };
static HRESULT Map_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -560,25 +554,19 @@ static const builtin_prop_t Set_prototype_props[] = { };
static const builtin_info_t Set_prototype_info = { - JSCLASS_OBJECT, - Set_value, - ARRAY_SIZE(Set_prototype_props), - Set_prototype_props, - NULL, - NULL + .class = JSCLASS_OBJECT, + .call = Set_value, + .props_cnt = ARRAY_SIZE(Set_prototype_props), + .props = Set_prototype_props, };
static const builtin_info_t Set_info = { - JSCLASS_SET, - Set_value, - ARRAY_SIZE(Map_props), - Map_props, - Map_destructor, - NULL, - NULL, - NULL, - NULL, - Map_gc_traverse + .class = JSCLASS_SET, + .call = Set_value, + .props_cnt = ARRAY_SIZE(Map_props), + .props = Map_props, + .destructor = Map_destructor, + .gc_traverse = Map_gc_traverse, };
static HRESULT Set_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -857,25 +845,17 @@ static const builtin_prop_t WeakMap_prototype_props[] = { };
static const builtin_info_t WeakMap_prototype_info = { - JSCLASS_OBJECT, - WeakMap_value, - ARRAY_SIZE(WeakMap_prototype_props), - WeakMap_prototype_props, - NULL, - NULL + .class = JSCLASS_OBJECT, + .call = WeakMap_value, + .props_cnt = ARRAY_SIZE(WeakMap_prototype_props), + .props = WeakMap_prototype_props, };
static const builtin_info_t WeakMap_info = { - JSCLASS_WEAKMAP, - WeakMap_value, - 0, - NULL, - WeakMap_destructor, - NULL, - NULL, - NULL, - NULL, - WeakMap_gc_traverse + .class = JSCLASS_WEAKMAP, + .call = WeakMap_value, + .destructor = WeakMap_destructor, + .gc_traverse = WeakMap_gc_traverse, };
static HRESULT WeakMap_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 4033f0a2b56..38a80eecb2a 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1569,12 +1569,10 @@ static const builtin_prop_t String_props[] = { };
static const builtin_info_t String_info = { - JSCLASS_STRING, - NULL, - ARRAY_SIZE(String_props), - String_props, - String_destructor, - NULL + .class = JSCLASS_STRING, + .props_cnt = ARRAY_SIZE(String_props), + .props = String_props, + .destructor = String_destructor, };
static const builtin_prop_t StringInst_props[] = { @@ -1582,14 +1580,12 @@ static const builtin_prop_t StringInst_props[] = { };
static const builtin_info_t StringInst_info = { - JSCLASS_STRING, - NULL, - ARRAY_SIZE(StringInst_props), - StringInst_props, - String_destructor, - NULL, - String_idx_length, - String_idx_get + .class = JSCLASS_STRING, + .props_cnt = ARRAY_SIZE(StringInst_props), + .props = StringInst_props, + .destructor = String_destructor, + .idx_length = String_idx_length, + .idx_get = String_idx_get, };
/* ECMA-262 3rd Edition 15.5.3.2 */ @@ -1703,12 +1699,10 @@ static const builtin_prop_t StringConstr_props[] = { };
static const builtin_info_t StringConstr_info = { - JSCLASS_FUNCTION, - Function_value, - ARRAY_SIZE(StringConstr_props), - StringConstr_props, - NULL, - NULL + .class = JSCLASS_FUNCTION, + .call = Function_value, + .props_cnt = ARRAY_SIZE(StringConstr_props), + .props = StringConstr_props, };
HRESULT create_string_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c index 998dc230818..c46b331e787 100644 --- a/dlls/jscript/vbarray.c +++ b/dlls/jscript/vbarray.c @@ -247,12 +247,11 @@ static const builtin_prop_t VBArray_props[] = { };
static const builtin_info_t VBArray_info = { - JSCLASS_VBARRAY, - VBArray_value, - ARRAY_SIZE(VBArray_props), - VBArray_props, - VBArray_destructor, - NULL + .class = JSCLASS_VBARRAY, + .call = VBArray_value, + .props_cnt = ARRAY_SIZE(VBArray_props), + .props = VBArray_props, + .destructor = VBArray_destructor, };
static HRESULT alloc_vbarray(script_ctx_t *ctx, jsdisp_t *object_prototype, VBArrayInstance **ret)