jscript: Don't use builtin property for exposing ActiveXObject constructor.

This commit is contained in:
Jacek Caban 2014-10-13 12:36:30 +02:00 committed by Alexandre Julliard
parent 1c957ceb96
commit 0eec97e29b
3 changed files with 13 additions and 15 deletions

View File

@ -249,14 +249,6 @@ static HRESULT JSGlobal_RegExp(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
return constructor_call(ctx->regexp_constr, flags, argc, argv, r);
}
static HRESULT JSGlobal_ActiveXObject(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
TRACE("\n");
return constructor_call(ctx->activex_constr, flags, argc, argv, r);
}
static HRESULT JSGlobal_VBArray(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
@ -1087,7 +1079,6 @@ static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
}
static const builtin_prop_t JSGlobal_props[] = {
{ActiveXObjectW, JSGlobal_ActiveXObject, PROPF_CONSTR|1},
{ArrayW, JSGlobal_Array, PROPF_CONSTR|1},
{BooleanW, JSGlobal_Boolean, PROPF_CONSTR|1},
{CollectGarbageW, JSGlobal_CollectGarbage, PROPF_METHOD},
@ -1146,10 +1137,6 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
hres = create_activex_constr(ctx, &ctx->activex_constr);
if(FAILED(hres))
return hres;
hres = create_array_constr(ctx, object_prototype, &ctx->array_constr);
if(FAILED(hres))
return hres;
@ -1187,7 +1174,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
HRESULT init_global(script_ctx_t *ctx)
{
jsdisp_t *math, *object_prototype;
jsdisp_t *math, *object_prototype, *constr;
HRESULT hres;
if(ctx->global)
@ -1215,6 +1202,15 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
hres = create_activex_constr(ctx, &constr);
if(FAILED(hres))
return hres;
hres = jsdisp_propput_dontenum(ctx->global, ActiveXObjectW, jsval_obj(constr));
jsdisp_release(constr);
if(FAILED(hres))
return hres;
hres = jsdisp_propput_dontenum(ctx->global, undefinedW, jsval_undefined());
if(FAILED(hres))
return hres;

View File

@ -395,7 +395,6 @@ struct _script_ctx_t {
jsdisp_t *global;
jsdisp_t *function_constr;
jsdisp_t *activex_constr;
jsdisp_t *array_constr;
jsdisp_t *bool_constr;
jsdisp_t *date_constr;

View File

@ -1450,6 +1450,9 @@ function returnTest() {
ok(returnTest() === undefined, "returnTest = " + returnTest());
ActiveXObject = 1;
ok(ActiveXObject === 1, "ActiveXObject = " + ActiveXObject);
/* Keep this test in the end of file */
undefined = 6;
ok(undefined === 6, "undefined = " + undefined);