Jacek Caban : jscript: Don' t use builtin property for exposing Boolean constructor.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 4 10:51:17 CST 2015


Module: wine
Branch: master
Commit: 6eb49669aaf1a8f7f48af3b628950dd7f0a4d688
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6eb49669aaf1a8f7f48af3b628950dd7f0a4d688

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Feb  4 16:03:08 2015 +0100

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

---

 dlls/jscript/global.c      | 13 ++++---------
 dlls/jscript/tests/lang.js |  3 +++
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c
index 5ae6019..774ed05 100644
--- a/dlls/jscript/global.c
+++ b/dlls/jscript/global.c
@@ -129,14 +129,6 @@ static HRESULT JSGlobal_Array(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
     return constructor_call(ctx->array_constr, flags, argc, argv, r);
 }
 
-static HRESULT JSGlobal_Boolean(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
-        jsval_t *r)
-{
-    TRACE("\n");
-
-    return constructor_call(ctx->bool_constr, flags, argc, argv, r);
-}
-
 static HRESULT JSGlobal_Date(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
         jsval_t *r)
 {
@@ -1080,7 +1072,6 @@ static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
 
 static const builtin_prop_t JSGlobal_props[] = {
     {ArrayW,                     JSGlobal_Array,                     PROPF_CONSTR|1},
-    {BooleanW,                   JSGlobal_Boolean,                   PROPF_CONSTR|1},
     {CollectGarbageW,            JSGlobal_CollectGarbage,            PROPF_METHOD},
     {DateW,                      JSGlobal_Date,                      PROPF_CONSTR|7},
     {EnumeratorW,                JSGlobal_Enumerator,                PROPF_METHOD|7},
@@ -1206,6 +1197,10 @@ HRESULT init_global(script_ctx_t *ctx)
     if(FAILED(hres))
         return hres;
 
+    hres = jsdisp_propput_dontenum(ctx->global, BooleanW, jsval_obj(ctx->bool_constr));
+    if(FAILED(hres))
+        return hres;
+
     hres = jsdisp_propput_dontenum(ctx->global, ActiveXObjectW, jsval_obj(constr));
     jsdisp_release(constr);
     if(FAILED(hres))
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index a55bf75..b846eb2 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -1453,6 +1453,9 @@ ok(returnTest() === undefined, "returnTest = " + returnTest());
 ActiveXObject = 1;
 ok(ActiveXObject === 1, "ActiveXObject = " + ActiveXObject);
 
+Boolean = 1;
+ok(Boolean === 1, "Boolean = " + Boolean);
+
 /* Keep this test in the end of file */
 undefined = 6;
 ok(undefined === 6, "undefined = " + undefined);




More information about the wine-cvs mailing list