Module: wine Branch: master Commit: c6412d98d9b3693bd7c15e6aa59d8b53ca737360 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c6412d98d9b3693bd7c15e6aa5...
Author: Piotr Caban piotr.caban@gmail.com Date: Fri Jul 24 09:36:16 2009 +0200
jscript: Add "illegal assignment" error.
---
dlls/jscript/engine.c | 6 ++---- dlls/jscript/jscript_En.rc | 1 + dlls/jscript/resource.h | 1 + dlls/jscript/tests/api.js | 1 + 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c79c48f..ff5e6a8 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -232,10 +232,8 @@ static HRESULT disp_get_id(IDispatch *disp, BSTR name, DWORD flags, DISPID *id) /* ECMA-262 3rd Edition 8.7.2 */ static HRESULT put_value(script_ctx_t *ctx, exprval_t *ref, VARIANT *v, jsexcept_t *ei) { - if(ref->type != EXPRVAL_IDREF) { - FIXME("throw ReferemceError\n"); - return E_FAIL; - } + if(ref->type != EXPRVAL_IDREF) + return throw_reference_error(ctx, ei, IDS_ILLEGAL_ASSIGN, NULL);
return disp_propput(ref->u.idref.disp, ref->u.idref.id, ctx->lcid, v, ei, NULL/*FIXME*/); } diff --git a/dlls/jscript/jscript_En.rc b/dlls/jscript/jscript_En.rc index d2470c7..96db21f 100644 --- a/dlls/jscript/jscript_En.rc +++ b/dlls/jscript/jscript_En.rc @@ -32,6 +32,7 @@ STRINGTABLE DISCARDABLE IDS_NOT_FUNC "Function expected" IDS_NOT_DATE "'[object]' is not a date object" IDS_NOT_NUM "Number expected" + IDS_ILLEGAL_ASSIGN "Illegal assignment" IDS_UNDEFINED "'|' is undefined" IDS_NOT_BOOL "Boolean object expected" IDS_INVALID_LENGTH "Array length must be a finite positive integer" diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index 5fcbbae..969ea13 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -28,6 +28,7 @@ #define IDS_NOT_FUNC 0x138A #define IDS_NOT_DATE 0x138E #define IDS_NOT_NUM 0x1389 +#define IDS_ILLEGAL_ASSIGN 0x1390 #define IDS_UNDEFINED 0x1391 #define IDS_NOT_BOOL 0x1392 #define IDS_INVALID_LENGTH 0x13A5 diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 3ccb362..7e43ffb 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1328,5 +1328,6 @@ exception_test(function() {eval("switch");}, "SyntaxError", -2146827283); exception_test(function() {eval("if(false");}, "SyntaxError", -2146827282); exception_test(function() {eval("for(i=0; i<10; i++");}, "SyntaxError", -2146827282); exception_test(function() {eval("while(true");}, "SyntaxError", -2146827282); +exception_test(function() {test = function() {}}, "ReferenceError", -2146823280);
reportSuccess();