Jacek Caban : jscript: Directly return error code instead of using throw_uri_error.

Alexandre Julliard julliard at winehq.org
Sun Feb 2 12:56:45 CST 2020


Module: wine
Branch: master
Commit: 22247369677c9f5c56dbdcbeda9b2749e76011cd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=22247369677c9f5c56dbdcbeda9b2749e76011cd

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jan 31 17:23:16 2020 +0100

jscript: Directly return error code instead of using throw_uri_error.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/error.c   | 5 -----
 dlls/jscript/global.c  | 6 +++---
 dlls/jscript/jscript.h | 1 -
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c
index 084e8ce953..5071096016 100644
--- a/dlls/jscript/error.c
+++ b/dlls/jscript/error.c
@@ -445,11 +445,6 @@ HRESULT throw_type_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
     return throw_error(ctx, error, str, ctx->type_error_constr);
 }
 
-HRESULT throw_uri_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
-{
-    return throw_error(ctx, error, str, ctx->uri_error_constr);
-}
-
 jsdisp_t *create_builtin_error(script_ctx_t *ctx)
 {
     jsdisp_t *constr = ctx->error_constr, *r;
diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c
index 2b5f3894ca..e2758bfc66 100644
--- a/dlls/jscript/global.c
+++ b/dlls/jscript/global.c
@@ -632,7 +632,7 @@ static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
             i = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, ptr, 1, NULL, 0, NULL, NULL)*3;
             if(!i) {
                 jsstr_release(str);
-                return throw_uri_error(ctx, JS_E_INVALID_URI_CHAR, NULL);
+                return JS_E_INVALID_URI_CHAR;
             }
 
             len += i;
@@ -710,7 +710,7 @@ static HRESULT JSGlobal_decodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
 
             if(!res) {
                 jsstr_release(str);
-                return throw_uri_error(ctx, JS_E_INVALID_URI_CODING, NULL);
+                return JS_E_INVALID_URI_CODING;
             }
 
             ptr += i*3+2;
@@ -783,7 +783,7 @@ static HRESULT JSGlobal_encodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
             size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, ptr, 1, NULL, 0, NULL, NULL);
             if(!size) {
                 jsstr_release(str);
-                return throw_uri_error(ctx, JS_E_INVALID_URI_CHAR, NULL);
+                return JS_E_INVALID_URI_CHAR;
             }
             len += size*3;
         }
diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
index cf5870f8a1..ec5cd08e4d 100644
--- a/dlls/jscript/jscript.h
+++ b/dlls/jscript/jscript.h
@@ -314,7 +314,6 @@ struct _function_code_t *Function_get_code(jsdisp_t*) DECLSPEC_HIDDEN;
 
 HRESULT throw_syntax_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
 HRESULT throw_type_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
-HRESULT throw_uri_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
 jsdisp_t *create_builtin_error(script_ctx_t *ctx) DECLSPEC_HIDDEN;
 
 HRESULT create_object(script_ctx_t*,jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list