Nasal: improve message for non-object member access

Based on some discussion on this ticket:

https://sourceforge.net/p/flightgear/codetickets/2186/

Make this message slightly clearer.
This commit is contained in:
James Turner 2020-04-28 09:34:30 +01:00
parent 8d6e543cc2
commit 57b0f70a55

View File

@ -503,7 +503,7 @@ static void setMember(naContext ctx, naRef obj, naRef fld, naRef value)
return; return;
} }
if(!IS_HASH(obj)) ERR(ctx, "non-objects have no members"); if(!IS_HASH(obj)) naRuntimeError(ctx, "non-object does not have member: %s", naStr_data(fld));
naHash_set(obj, fld, value); naHash_set(obj, fld, value);
ctx->opTop -= 2; ctx->opTop -= 2;
} }