Jacek Caban : jscript: Throw TypeError in in_eval.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 12:25:05 CDT 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Aug 16 12:36:59 2010 +0200

jscript: Throw TypeError in in_eval.

---

 dlls/jscript/engine.c     |    6 ++----
 dlls/jscript/tests/api.js |    3 +++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 167b5d9..c06bef4 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -2065,10 +2065,8 @@ static HRESULT in_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *obj, jsexcept_t
     BSTR str;
     HRESULT hres;
 
-    if(V_VT(obj) != VT_DISPATCH) {
-        FIXME("throw TypeError\n");
-        return E_FAIL;
-    }
+    if(V_VT(obj) != VT_DISPATCH || !V_DISPATCH(obj))
+        return throw_type_error(ctx->parser->script, ei, IDS_OBJECT_EXPECTED, NULL);
 
     hres = to_string(ctx->parser->script, lval, ei, &str);
     if(FAILED(hres))
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 9a253dc..2e0ae0b 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -1891,6 +1891,9 @@ exception_test(function() {encodeURI('\udcaa');}, "URIError", -2146823264);
 exception_test(function() {(new Object()) instanceof 3;}, "TypeError", -2146823286);
 exception_test(function() {(new Object()) instanceof null;}, "TypeError", -2146823286);
 exception_test(function() {(new Object()) instanceof nullDisp;}, "TypeError", -2146823286);
+exception_test(function() {"test" in 3;}, "TypeError", -2146823281);
+exception_test(function() {"test" in null;}, "TypeError", -2146823281);
+exception_test(function() {"test" in nullDisp;}, "TypeError", -2146823281);
 
 function testThisExcept(func, number) {
     exception_test(function() {func.call(new Object())}, "TypeError", number);




More information about the wine-cvs mailing list