[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH 07/10] jscript: Directly return error code instead of using throw_uri_error.
From:       Jacek Caban <jacek () codeweavers ! com>
Date:       2020-01-31 16:23:16
Message-ID: 431b52e9-7b31-bfd2-af0d-7807c53adfbb () codeweavers ! com
[Download RAW message or body]

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
---
  dlls/jscript/error.c   | 5 -----
  dlls/jscript/global.c  | 6 +++---
  dlls/jscript/jscript.h | 1 -
  3 files changed, 3 insertions(+), 9 deletions(-)



["0007-jscript-Directly-return-error-code-instead-of-using-th.txt" (text/x-patch)]

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;



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic