diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c79c48f13fa..ff5e6a896c3 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 d2470c78016..96db21f601a 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 5fcbbaeb0de..969ea13ac92 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 3ccb362da5f..7e43ffb76a4 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();