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

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


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

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

jscript: Directly return error code instead of using throw_reference_error.

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

---

 dlls/jscript/engine.c  | 8 ++++----
 dlls/jscript/error.c   | 5 -----
 dlls/jscript/jscript.h | 1 -
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 2fa171764b..b700988f55 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -898,7 +898,7 @@ static HRESULT interp_throw_ref(script_ctx_t *ctx)
 
     TRACE("%08x\n", arg);
 
-    return throw_reference_error(ctx, arg, NULL);
+    return arg;
 }
 
 static HRESULT interp_throw_type(script_ctx_t *ctx)
@@ -1161,7 +1161,7 @@ static HRESULT interp_refval(script_ctx_t *ctx)
     TRACE("\n");
 
     if(!stack_topn_exprval(ctx, 0, &ref))
-        return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL);
+        return JS_E_ILLEGAL_ASSIGN;
 
     hres = exprval_propget(ctx, &ref, &v);
     if(FAILED(hres))
@@ -2527,7 +2527,7 @@ static HRESULT interp_assign(script_ctx_t *ctx)
 
     if(!stack_pop_exprval(ctx, &ref)) {
         jsval_release(v);
-        return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL);
+        return JS_E_ILLEGAL_ASSIGN;
     }
 
     hres = exprval_propput(ctx, &ref, v);
@@ -2551,7 +2551,7 @@ static HRESULT interp_assign_call(script_ctx_t *ctx)
     TRACE("%u\n", argc);
 
     if(!stack_topn_exprval(ctx, argc+1, &ref))
-        return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL);
+        return JS_E_ILLEGAL_ASSIGN;
 
     hres = exprval_call(ctx, &ref, DISPATCH_PROPERTYPUT, argc+1, stack_args(ctx, argc+1), NULL);
     if(FAILED(hres))
diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c
index 13bc0e6ba4..8a49c973dc 100644
--- a/dlls/jscript/error.c
+++ b/dlls/jscript/error.c
@@ -435,11 +435,6 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
     return error;
 }
 
-HRESULT throw_reference_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
-{
-    return throw_error(ctx, error, str, ctx->reference_error_constr);
-}
-
 HRESULT throw_regexp_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
 {
     return throw_error(ctx, error, str, ctx->regexp_error_constr);
diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
index fa7058d201..678c02acf6 100644
--- a/dlls/jscript/jscript.h
+++ b/dlls/jscript/jscript.h
@@ -312,7 +312,6 @@ HRESULT Function_get_value(script_ctx_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN;
 struct _function_code_t *Function_get_code(jsdisp_t*) DECLSPEC_HIDDEN;
 #define DEFAULT_FUNCTION_VALUE {NULL, Function_value,0, Function_get_value}
 
-HRESULT throw_reference_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
 HRESULT throw_regexp_error(script_ctx_t*,HRESULT,const WCHAR*) 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;




More information about the wine-cvs mailing list