jscript: Fixed Global functions lengths.
diff --git a/dlls/jscript/activex.c b/dlls/jscript/activex.c index cb94d4e..60e33e0 100644 --- a/dlls/jscript/activex.c +++ b/dlls/jscript/activex.c
@@ -192,7 +192,8 @@ if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, ActiveXObject_value, ActiveXObjectW, NULL, PROPF_CONSTR, prototype, ret); + hres = create_builtin_function(ctx, ActiveXObject_value, ActiveXObjectW, NULL, + PROPF_CONSTR|1, prototype, ret); jsdisp_release(prototype); return hres;
diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 941e414..e4ee4db 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c
@@ -1166,7 +1166,7 @@ if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, ArrayConstr_value, ArrayW, NULL, PROPF_CONSTR, &array->dispex, ret); + hres = create_builtin_function(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 1fca406..4f23678 100644 --- a/dlls/jscript/bool.c +++ b/dlls/jscript/bool.c
@@ -191,7 +191,8 @@ if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, BoolConstr_value, BooleanW, NULL, PROPF_CONSTR, &bool->dispex, ret); + hres = create_builtin_function(ctx, BoolConstr_value, BooleanW, NULL, + PROPF_CONSTR|1, &bool->dispex, ret); jsdisp_release(&bool->dispex); return hres;
diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index f8d3522..71d3751 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c
@@ -2624,7 +2624,8 @@ if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, DateConstr_value, DateW, &DateConstr_info, PROPF_CONSTR, date, ret); + hres = create_builtin_function(ctx, DateConstr_value, DateW, &DateConstr_info, + PROPF_CONSTR|7, date, ret); jsdisp_release(date); return hres;
diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 9530a4c..2b193ef 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c
@@ -381,7 +381,7 @@ if(SUCCEEDED(hres)) hres = create_builtin_function(ctx, constr_val[i], names[i], NULL, - PROPF_CONSTR, &err->dispex, constr_addr[i]); + PROPF_CONSTR|1, &err->dispex, constr_addr[i]); jsdisp_release(&err->dispex); VariantClear(&v);
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index b0fb79d..64e645a 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c
@@ -673,7 +673,7 @@ prot->value_proc = FunctionProt_value; prot->name = prototypeW; - hres = create_function(ctx, NULL, PROPF_CONSTR, TRUE, &prot->dispex, &constr); + hres = create_function(ctx, NULL, PROPF_CONSTR|1, TRUE, &prot->dispex, &constr); if(SUCCEEDED(hres)) { constr->value_proc = FunctionConstr_value; constr->name = FunctionW;
diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index ef86f26..4282d06 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c
@@ -859,44 +859,44 @@ } static const builtin_prop_t JSGlobal_props[] = { - {ActiveXObjectW, JSGlobal_ActiveXObject, PROPF_CONSTR}, - {ArrayW, JSGlobal_Array, PROPF_CONSTR}, - {BooleanW, JSGlobal_Boolean, PROPF_CONSTR}, + {ActiveXObjectW, JSGlobal_ActiveXObject, PROPF_CONSTR|1}, + {ArrayW, JSGlobal_Array, PROPF_CONSTR|1}, + {BooleanW, JSGlobal_Boolean, PROPF_CONSTR|1}, {CollectGarbageW, JSGlobal_CollectGarbage, PROPF_METHOD}, - {DateW, JSGlobal_Date, PROPF_CONSTR}, - {EnumeratorW, JSGlobal_Enumerator, PROPF_METHOD}, - {ErrorW, JSGlobal_Error, PROPF_CONSTR}, - {EvalErrorW, JSGlobal_EvalError, PROPF_CONSTR}, - {FunctionW, JSGlobal_Function, PROPF_CONSTR}, - {_GetObjectW, JSGlobal_GetObject, PROPF_METHOD}, + {DateW, JSGlobal_Date, PROPF_CONSTR|7}, + {EnumeratorW, JSGlobal_Enumerator, PROPF_METHOD|7}, + {ErrorW, JSGlobal_Error, PROPF_CONSTR|1}, + {EvalErrorW, JSGlobal_EvalError, PROPF_CONSTR|1}, + {FunctionW, JSGlobal_Function, PROPF_CONSTR|1}, + {_GetObjectW, JSGlobal_GetObject, PROPF_METHOD|2}, {InfinityW, JSGlobal_Infinity, 0}, /* {MathW, JSGlobal_Math, 0}, */ {NaNW, JSGlobal_NaN, 0}, - {NumberW, JSGlobal_Number, PROPF_CONSTR}, - {ObjectW, JSGlobal_Object, PROPF_CONSTR}, - {RangeErrorW, JSGlobal_RangeError, PROPF_CONSTR}, - {ReferenceErrorW, JSGlobal_ReferenceError, PROPF_CONSTR}, - {RegExpW, JSGlobal_RegExp, PROPF_CONSTR}, + {NumberW, JSGlobal_Number, PROPF_CONSTR|1}, + {ObjectW, JSGlobal_Object, PROPF_CONSTR|1}, + {RangeErrorW, JSGlobal_RangeError, PROPF_CONSTR|1}, + {ReferenceErrorW, JSGlobal_ReferenceError, PROPF_CONSTR|1}, + {RegExpW, JSGlobal_RegExp, PROPF_CONSTR|2}, {ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD}, {ScriptEngineBuildVersionW, JSGlobal_ScriptEngineBuildVersion, PROPF_METHOD}, {ScriptEngineMajorVersionW, JSGlobal_ScriptEngineMajorVersion, PROPF_METHOD}, {ScriptEngineMinorVersionW, JSGlobal_ScriptEngineMinorVersion, PROPF_METHOD}, - {StringW, JSGlobal_String, PROPF_CONSTR}, - {SyntaxErrorW, JSGlobal_SyntaxError, PROPF_CONSTR}, - {TypeErrorW, JSGlobal_TypeError, PROPF_CONSTR}, - {URIErrorW, JSGlobal_URIError, PROPF_CONSTR}, - {VBArrayW, JSGlobal_VBArray, PROPF_METHOD}, - {decodeURIW, JSGlobal_decodeURI, PROPF_METHOD}, - {decodeURIComponentW, JSGlobal_decodeURIComponent, PROPF_METHOD}, - {encodeURIW, JSGlobal_encodeURI, PROPF_METHOD}, - {encodeURIComponentW, JSGlobal_encodeURIComponent, PROPF_METHOD}, - {escapeW, JSGlobal_escape, PROPF_METHOD}, + {StringW, JSGlobal_String, PROPF_CONSTR|1}, + {SyntaxErrorW, JSGlobal_SyntaxError, PROPF_CONSTR|1}, + {TypeErrorW, JSGlobal_TypeError, PROPF_CONSTR|1}, + {URIErrorW, JSGlobal_URIError, PROPF_CONSTR|1}, + {VBArrayW, JSGlobal_VBArray, PROPF_METHOD|1}, + {decodeURIW, JSGlobal_decodeURI, PROPF_METHOD|1}, + {decodeURIComponentW, JSGlobal_decodeURIComponent, PROPF_METHOD|1}, + {encodeURIW, JSGlobal_encodeURI, PROPF_METHOD|1}, + {encodeURIComponentW, JSGlobal_encodeURIComponent, PROPF_METHOD|1}, + {escapeW, JSGlobal_escape, PROPF_METHOD|1}, {evalW, JSGlobal_eval, PROPF_METHOD|1}, - {isFiniteW, JSGlobal_isFinite, PROPF_METHOD}, - {isNaNW, JSGlobal_isNaN, PROPF_METHOD}, - {parseFloatW, JSGlobal_parseFloat, PROPF_METHOD}, + {isFiniteW, JSGlobal_isFinite, PROPF_METHOD|1}, + {isNaNW, JSGlobal_isNaN, PROPF_METHOD|1}, + {parseFloatW, JSGlobal_parseFloat, PROPF_METHOD|1}, {parseIntW, JSGlobal_parseInt, PROPF_METHOD|2}, - {unescapeW, JSGlobal_unescape, PROPF_METHOD} + {unescapeW, JSGlobal_unescape, PROPF_METHOD|1} }; static const builtin_info_t JSGlobal_info = {
diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c index 757316c..00de9ab 100644 --- a/dlls/jscript/number.c +++ b/dlls/jscript/number.c
@@ -346,7 +346,8 @@ return hres; V_VT(&number->num) = VT_I4; - hres = create_builtin_function(ctx, NumberConstr_value, NumberW, NULL, PROPF_CONSTR, &number->dispex, ret); + hres = create_builtin_function(ctx, NumberConstr_value, NumberW, NULL, + PROPF_CONSTR|1, &number->dispex, ret); jsdisp_release(&number->dispex); return hres;
diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index e911d0f..fa5672f 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c
@@ -3885,7 +3885,8 @@ if(FAILED(hres)) return hres; - hres = create_builtin_function(ctx, RegExpConstr_value, RegExpW, NULL, PROPF_CONSTR, ®exp->dispex, ret); + hres = create_builtin_function(ctx, RegExpConstr_value, RegExpW, NULL, + PROPF_CONSTR|2, ®exp->dispex, ret); jsdisp_release(®exp->dispex); return hres;
diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 55b6b85..b78de0b8 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c
@@ -1705,7 +1705,7 @@ return hres; hres = create_builtin_function(ctx, StringConstr_value, StringW, &StringConstr_info, - PROPF_CONSTR, &string->dispex, ret); + PROPF_CONSTR|1, &string->dispex, ret); jsdisp_release(&string->dispex); return hres;
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index be85566..7963016 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js
@@ -1941,4 +1941,43 @@ ["toString", 0] ]); +ok(ActiveXObject.length == 1, "ActiveXObject.length = " + ActiveXObject.length); +ok(Array.length == 1, "Array.length = " + Array.length); +ok(Boolean.length == 1, "Boolean.length = " + Boolean.length); +ok(CollectGarbage.length == 0, "CollectGarbage.length = " + CollectGarbage.length); +//ok(Date.length == 7, "Date.length = " + Date.length); +ok(Enumerator.length == 7, "Enumerator.length = " + Enumerator.length); +ok(Error.length == 1, "Error.length = " + Error.length); +ok(EvalError.length == 1, "EvalError.length = " + EvalError.length); +ok(Function.length == 1, "Function.length = " + Function.length); +ok(GetObject.length == 2, "GetObject.length = " + GetObject.length); +ok(Number.length == 1, "Number.length = " + Number.length); +ok(Object.length == 0, "Object.length = " + Object.length); +ok(RangeError.length == 1, "RangeError.length = " + RangeError.length); +ok(ReferenceError.length == 1, "ReferenceError.length = " + ReferenceError.length); +ok(RegExp.length == 2, "RegExp.length = " + RegExp.length); +ok(ScriptEngine.length == 0, "ScriptEngine.length = " + ScriptEngine.length); +ok(ScriptEngineBuildVersion.length == 0, + "ScriptEngineBuildVersion.length = " + ScriptEngineBuildVersion.length); +ok(ScriptEngineMajorVersion.length == 0, + "ScriptEngineMajorVersion.length = " + ScriptEngineMajorVersion.length); +ok(ScriptEngineMinorVersion.length == 0, + "ScriptEngineMinorVersion.length = " + ScriptEngineMinorVersion.length); +//ok(String.length == 1, "String.length = " + String.length); +ok(SyntaxError.length == 1, "SyntaxError.length = " + SyntaxError.length); +ok(TypeError.length == 1, "TypeError.length = " + TypeError.length); +ok(URIError.length == 1, "URIError.length = " + URIError.length); +ok(VBArray.length == 1, "VBArray.length = " + VBArray.length); +ok(decodeURI.length == 1, "decodeURI.length = " + decodeURI.length); +ok(decodeURIComponent.length == 1, "decodeURIComponent.length = " + decodeURIComponent.length); +ok(encodeURI.length == 1, "encodeURI.length = " + encodeURI.length); +ok(encodeURIComponent.length == 1, "encodeURIComponent.length = " + encodeURIComponent.length); +ok(escape.length == 1, "escape.length = " + escape.length); +ok(eval.length == 1, "eval.length = " + eval.length); +ok(isFinite.length == 1, "isFinite.length = " + isFinite.length); +ok(isNaN.length == 1, "isNaN.length = " + isNaN.length); +ok(parseFloat.length == 1, "parseFloat.length = " + parseFloat.length); +ok(parseInt.length == 2, "parseInt.length = " + parseInt.length); +ok(unescape.length == 1, "unescape.length = " + unescape.length); + reportSuccess();