Commit 662a8525 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Fixed Global functions lengths.

parent 657c8327
...@@ -192,7 +192,8 @@ HRESULT create_activex_constr(script_ctx_t *ctx, DispatchEx **ret) ...@@ -192,7 +192,8 @@ HRESULT create_activex_constr(script_ctx_t *ctx, DispatchEx **ret)
if(FAILED(hres)) if(FAILED(hres))
return 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); jsdisp_release(prototype);
return hres; return hres;
......
...@@ -1166,7 +1166,7 @@ HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Dis ...@@ -1166,7 +1166,7 @@ HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Dis
if(FAILED(hres)) if(FAILED(hres))
return 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); jsdisp_release(&array->dispex);
return hres; return hres;
......
...@@ -191,7 +191,8 @@ HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Disp ...@@ -191,7 +191,8 @@ HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Disp
if(FAILED(hres)) if(FAILED(hres))
return 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); jsdisp_release(&bool->dispex);
return hres; return hres;
......
...@@ -2624,7 +2624,8 @@ HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Disp ...@@ -2624,7 +2624,8 @@ HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Disp
if(FAILED(hres)) if(FAILED(hres))
return 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); jsdisp_release(date);
return hres; return hres;
......
...@@ -381,7 +381,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype) ...@@ -381,7 +381,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype)
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = create_builtin_function(ctx, constr_val[i], names[i], NULL, 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); jsdisp_release(&err->dispex);
VariantClear(&v); VariantClear(&v);
......
...@@ -673,7 +673,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, DispatchEx *object_prototype) ...@@ -673,7 +673,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, DispatchEx *object_prototype)
prot->value_proc = FunctionProt_value; prot->value_proc = FunctionProt_value;
prot->name = prototypeW; 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)) { if(SUCCEEDED(hres)) {
constr->value_proc = FunctionConstr_value; constr->value_proc = FunctionConstr_value;
constr->name = FunctionW; constr->name = FunctionW;
......
...@@ -859,44 +859,44 @@ static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W ...@@ -859,44 +859,44 @@ static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
} }
static const builtin_prop_t JSGlobal_props[] = { static const builtin_prop_t JSGlobal_props[] = {
{ActiveXObjectW, JSGlobal_ActiveXObject, PROPF_CONSTR}, {ActiveXObjectW, JSGlobal_ActiveXObject, PROPF_CONSTR|1},
{ArrayW, JSGlobal_Array, PROPF_CONSTR}, {ArrayW, JSGlobal_Array, PROPF_CONSTR|1},
{BooleanW, JSGlobal_Boolean, PROPF_CONSTR}, {BooleanW, JSGlobal_Boolean, PROPF_CONSTR|1},
{CollectGarbageW, JSGlobal_CollectGarbage, PROPF_METHOD}, {CollectGarbageW, JSGlobal_CollectGarbage, PROPF_METHOD},
{DateW, JSGlobal_Date, PROPF_CONSTR}, {DateW, JSGlobal_Date, PROPF_CONSTR|7},
{EnumeratorW, JSGlobal_Enumerator, PROPF_METHOD}, {EnumeratorW, JSGlobal_Enumerator, PROPF_METHOD|7},
{ErrorW, JSGlobal_Error, PROPF_CONSTR}, {ErrorW, JSGlobal_Error, PROPF_CONSTR|1},
{EvalErrorW, JSGlobal_EvalError, PROPF_CONSTR}, {EvalErrorW, JSGlobal_EvalError, PROPF_CONSTR|1},
{FunctionW, JSGlobal_Function, PROPF_CONSTR}, {FunctionW, JSGlobal_Function, PROPF_CONSTR|1},
{_GetObjectW, JSGlobal_GetObject, PROPF_METHOD}, {_GetObjectW, JSGlobal_GetObject, PROPF_METHOD|2},
{InfinityW, JSGlobal_Infinity, 0}, {InfinityW, JSGlobal_Infinity, 0},
/* {MathW, JSGlobal_Math, 0}, */ /* {MathW, JSGlobal_Math, 0}, */
{NaNW, JSGlobal_NaN, 0}, {NaNW, JSGlobal_NaN, 0},
{NumberW, JSGlobal_Number, PROPF_CONSTR}, {NumberW, JSGlobal_Number, PROPF_CONSTR|1},
{ObjectW, JSGlobal_Object, PROPF_CONSTR}, {ObjectW, JSGlobal_Object, PROPF_CONSTR|1},
{RangeErrorW, JSGlobal_RangeError, PROPF_CONSTR}, {RangeErrorW, JSGlobal_RangeError, PROPF_CONSTR|1},
{ReferenceErrorW, JSGlobal_ReferenceError, PROPF_CONSTR}, {ReferenceErrorW, JSGlobal_ReferenceError, PROPF_CONSTR|1},
{RegExpW, JSGlobal_RegExp, PROPF_CONSTR}, {RegExpW, JSGlobal_RegExp, PROPF_CONSTR|2},
{ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD}, {ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD},
{ScriptEngineBuildVersionW, JSGlobal_ScriptEngineBuildVersion, PROPF_METHOD}, {ScriptEngineBuildVersionW, JSGlobal_ScriptEngineBuildVersion, PROPF_METHOD},
{ScriptEngineMajorVersionW, JSGlobal_ScriptEngineMajorVersion, PROPF_METHOD}, {ScriptEngineMajorVersionW, JSGlobal_ScriptEngineMajorVersion, PROPF_METHOD},
{ScriptEngineMinorVersionW, JSGlobal_ScriptEngineMinorVersion, PROPF_METHOD}, {ScriptEngineMinorVersionW, JSGlobal_ScriptEngineMinorVersion, PROPF_METHOD},
{StringW, JSGlobal_String, PROPF_CONSTR}, {StringW, JSGlobal_String, PROPF_CONSTR|1},
{SyntaxErrorW, JSGlobal_SyntaxError, PROPF_CONSTR}, {SyntaxErrorW, JSGlobal_SyntaxError, PROPF_CONSTR|1},
{TypeErrorW, JSGlobal_TypeError, PROPF_CONSTR}, {TypeErrorW, JSGlobal_TypeError, PROPF_CONSTR|1},
{URIErrorW, JSGlobal_URIError, PROPF_CONSTR}, {URIErrorW, JSGlobal_URIError, PROPF_CONSTR|1},
{VBArrayW, JSGlobal_VBArray, PROPF_METHOD}, {VBArrayW, JSGlobal_VBArray, PROPF_METHOD|1},
{decodeURIW, JSGlobal_decodeURI, PROPF_METHOD}, {decodeURIW, JSGlobal_decodeURI, PROPF_METHOD|1},
{decodeURIComponentW, JSGlobal_decodeURIComponent, PROPF_METHOD}, {decodeURIComponentW, JSGlobal_decodeURIComponent, PROPF_METHOD|1},
{encodeURIW, JSGlobal_encodeURI, PROPF_METHOD}, {encodeURIW, JSGlobal_encodeURI, PROPF_METHOD|1},
{encodeURIComponentW, JSGlobal_encodeURIComponent, PROPF_METHOD}, {encodeURIComponentW, JSGlobal_encodeURIComponent, PROPF_METHOD|1},
{escapeW, JSGlobal_escape, PROPF_METHOD}, {escapeW, JSGlobal_escape, PROPF_METHOD|1},
{evalW, JSGlobal_eval, PROPF_METHOD|1}, {evalW, JSGlobal_eval, PROPF_METHOD|1},
{isFiniteW, JSGlobal_isFinite, PROPF_METHOD}, {isFiniteW, JSGlobal_isFinite, PROPF_METHOD|1},
{isNaNW, JSGlobal_isNaN, PROPF_METHOD}, {isNaNW, JSGlobal_isNaN, PROPF_METHOD|1},
{parseFloatW, JSGlobal_parseFloat, PROPF_METHOD}, {parseFloatW, JSGlobal_parseFloat, PROPF_METHOD|1},
{parseIntW, JSGlobal_parseInt, PROPF_METHOD|2}, {parseIntW, JSGlobal_parseInt, PROPF_METHOD|2},
{unescapeW, JSGlobal_unescape, PROPF_METHOD} {unescapeW, JSGlobal_unescape, PROPF_METHOD|1}
}; };
static const builtin_info_t JSGlobal_info = { static const builtin_info_t JSGlobal_info = {
......
...@@ -346,7 +346,8 @@ HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di ...@@ -346,7 +346,8 @@ HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di
return hres; return hres;
V_VT(&number->num) = VT_I4; 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); jsdisp_release(&number->dispex);
return hres; return hres;
......
...@@ -3885,7 +3885,8 @@ HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di ...@@ -3885,7 +3885,8 @@ HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = create_builtin_function(ctx, RegExpConstr_value, RegExpW, NULL, PROPF_CONSTR, &regexp->dispex, ret); hres = create_builtin_function(ctx, RegExpConstr_value, RegExpW, NULL,
PROPF_CONSTR|2, &regexp->dispex, ret);
jsdisp_release(&regexp->dispex); jsdisp_release(&regexp->dispex);
return hres; return hres;
......
...@@ -1705,7 +1705,7 @@ HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di ...@@ -1705,7 +1705,7 @@ HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx *object_prototype, Di
return hres; return hres;
hres = create_builtin_function(ctx, StringConstr_value, StringW, &StringConstr_info, 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); jsdisp_release(&string->dispex);
return hres; return hres;
......
...@@ -1941,4 +1941,43 @@ testFunctions(Function.prototype, [ ...@@ -1941,4 +1941,43 @@ testFunctions(Function.prototype, [
["toString", 0] ["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(); reportSuccess();
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