Commit c6412d98 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Add "illegal assignment" error.

parent 2fba39df
......@@ -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*/);
}
......
......@@ -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"
......
......@@ -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
......@@ -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();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment