diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 5004eb58788..68814120177 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -1183,7 +1183,7 @@ HRESULT create_array_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdis if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, ArrayConstr_value, ArrayW, NULL, PROPF_CONSTR|1, &array->dispex, ret); + hres = create_builtin_constructor(ctx, ArrayConstr_value, ArrayW, NULL, PROPF_CONSTR|1, &array->dispex, ret); jsdisp_release(&array->dispex); return hres; diff --git a/dlls/jscript/bool.c b/dlls/jscript/bool.c index 6ddcf9e5cf7..14bb1a3944c 100644 --- a/dlls/jscript/bool.c +++ b/dlls/jscript/bool.c @@ -190,7 +190,7 @@ HRESULT create_bool_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, BoolConstr_value, BooleanW, NULL, + hres = create_builtin_constructor(ctx, BoolConstr_value, BooleanW, NULL, PROPF_CONSTR|1, &bool->dispex, ret); jsdisp_release(&bool->dispex); diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 4dad1e29f0b..465f7b28a62 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2631,7 +2631,7 @@ HRESULT create_date_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, DateConstr_value, DateW, &DateConstr_info, + hres = create_builtin_constructor(ctx, DateConstr_value, DateW, &DateConstr_info, PROPF_CONSTR|7, date, ret); jsdisp_release(date); diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index b1a83de86fd..ce43eb5746d 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -264,7 +264,7 @@ HRESULT create_object_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi { static const WCHAR ObjectW[] = {'O','b','j','e','c','t',0}; - return create_builtin_function(ctx, ObjectConstr_value, ObjectW, NULL, PROPF_CONSTR, + return create_builtin_constructor(ctx, ObjectConstr_value, ObjectW, NULL, PROPF_CONSTR, object_prototype, ret); } diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index 8e5445f2671..996f9f0808d 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -4143,7 +4143,7 @@ HRESULT create_regexp_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, RegExpConstr_value, RegExpW, &RegExpConstr_info, + hres = create_builtin_constructor(ctx, RegExpConstr_value, RegExpW, &RegExpConstr_info, PROPF_CONSTR|2, ®exp->dispex, ret); jsdisp_release(®exp->dispex); diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 46d779a93aa..9b23005e080 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1669,7 +1669,7 @@ HRESULT create_string_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, StringConstr_value, StringW, &StringConstr_info, + hres = create_builtin_constructor(ctx, StringConstr_value, StringW, &StringConstr_info, PROPF_CONSTR|1, &string->dispex, ret); jsdisp_release(&string->dispex); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 75306f10a94..c37b7c74ed1 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -91,7 +91,19 @@ ok(Function.prototype.prototype === undefined, "Function.prototype.prototype is ok(Date.prototype !== undefined, "Date.prototype is undefined"); ok(Date.prototype.prototype === undefined, "Date.prototype is not undefined"); -ok(Number.prototype.constructor === Number, "Number.prototype.constructor !== Number"); +function testConstructor(constr, name) { + ok(constr.prototype.constructor === constr, name + ".prototype.constructor !== " + name); +} + +testConstructor(Object, "Object"); +testConstructor(String, "String"); +testConstructor(Array, "Array"); +testConstructor(Boolean, "Boolean"); +testConstructor(Number, "Number"); +testConstructor(RegExp, "RegExp"); +//testConstructor(Function, "Function"); +testConstructor(Date, "Date"); +testConstructor(VBArray, "VBArray"); Function.prototype.test = true; ok(testFunc1.test === true, "testFunc1.test !== true"); diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c index 87bdf88f994..ac0c6def0c0 100644 --- a/dlls/jscript/vbarray.c +++ b/dlls/jscript/vbarray.c @@ -326,7 +326,7 @@ HRESULT create_vbarray_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsd if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, VBArrayConstr_value, VBArrayW, NULL, PROPF_CONSTR|1, &vbarray->dispex, ret); + hres = create_builtin_constructor(ctx, VBArrayConstr_value, VBArrayW, NULL, PROPF_CONSTR|1, &vbarray->dispex, ret); jsdisp_release(&vbarray->dispex); return hres;