Jacek Caban : jscript: Use jsdisp_propput_dontenum where appropriate.

Alexandre Julliard julliard at winehq.org
Mon Nov 5 13:32:25 CST 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Nov  5 15:04:01 2012 +0100

jscript: Use jsdisp_propput_dontenum where appropriate.

---

 dlls/jscript/error.c    |    6 +++---
 dlls/jscript/function.c |   13 +++++++++----
 dlls/jscript/global.c   |    8 ++++----
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c
index e127bfc..f7b0443 100644
--- a/dlls/jscript/error.c
+++ b/dlls/jscript/error.c
@@ -190,7 +190,7 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
     if(FAILED(hres))
         return hres;
 
-    hres = jsdisp_propput_name(err, numberW, jsval_number((INT)number));
+    hres = jsdisp_propput_dontenum(err, numberW, jsval_number((INT)number));
     if(FAILED(hres)) {
         jsdisp_release(err);
         return hres;
@@ -201,7 +201,7 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
     if(str) {
         hres = jsdisp_propput_name(err, messageW, jsval_string(str));
         if(SUCCEEDED(hres))
-            hres = jsdisp_propput_name(err, descriptionW, jsval_string(str));
+            hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(str));
         jsstr_release(str);
     }else {
         hres = E_OUTOFMEMORY;
@@ -357,7 +357,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
             return E_OUTOFMEMORY;
         }
 
-        hres = jsdisp_propput_name(err, nameW, jsval_string(str));
+        hres = jsdisp_propput_dontenum(err, nameW, jsval_string(str));
         jsstr_release(str);
         if(SUCCEEDED(hres))
             hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL,
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index c5bcd2e..299fafb 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -104,16 +104,21 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, unsigned ar
     }
 
     for(i=0; i < argc; i++) {
-        hres = jsdisp_propput_idx(args, i, argv[i]);
+        WCHAR buf[12];
+
+        static const WCHAR formatW[] = {'%','d',0};
+
+        sprintfW(buf, formatW, i);
+        hres = jsdisp_propput_dontenum(args, buf, argv[i]);
         if(FAILED(hres))
             break;
     }
 
     if(SUCCEEDED(hres)) {
-        hres = jsdisp_propput_name(args, lengthW, jsval_number(argc));
+        hres = jsdisp_propput_dontenum(args, lengthW, jsval_number(argc));
 
         if(SUCCEEDED(hres))
-            hres = jsdisp_propput_name(args, caleeW, jsval_disp(calee));
+            hres = jsdisp_propput_dontenum(args, caleeW, jsval_disp(calee));
     }
 
     if(FAILED(hres)) {
@@ -592,7 +597,7 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_
 
 static inline HRESULT set_prototype(script_ctx_t *ctx, jsdisp_t *dispex, jsdisp_t *prototype)
 {
-    return jsdisp_propput_name(dispex, prototypeW, jsval_obj(prototype));
+    return jsdisp_propput_dontenum(dispex, prototypeW, jsval_obj(prototype));
 }
 
 HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name,
diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c
index 8809ddc..0668e86 100644
--- a/dlls/jscript/global.c
+++ b/dlls/jscript/global.c
@@ -1245,19 +1245,19 @@ HRESULT init_global(script_ctx_t *ctx)
     if(FAILED(hres))
         return hres;
 
-    hres = jsdisp_propput_name(ctx->global, MathW, jsval_obj(math));
+    hres = jsdisp_propput_dontenum(ctx->global, MathW, jsval_obj(math));
     jsdisp_release(math);
     if(FAILED(hres))
         return hres;
 
-    hres = jsdisp_propput_name(ctx->global, undefinedW, jsval_undefined());
+    hres = jsdisp_propput_dontenum(ctx->global, undefinedW, jsval_undefined());
     if(FAILED(hres))
         return hres;
 
-    hres = jsdisp_propput_name(ctx->global, NaNW, jsval_number(NAN));
+    hres = jsdisp_propput_dontenum(ctx->global, NaNW, jsval_number(NAN));
     if(FAILED(hres))
         return hres;
 
-    hres = jsdisp_propput_name(ctx->global, InfinityW, jsval_number(INFINITY));
+    hres = jsdisp_propput_dontenum(ctx->global, InfinityW, jsval_number(INFINITY));
     return hres;
 }




More information about the wine-cvs mailing list