added a new class variable declarator 'var' or 'variable'

supported  | .. | style declartion at the class level.
added the RDONLY flag to the object header
wrote some code to support default values for class-level variables such as instance variables
This commit is contained in:
hyunghwan.chung
2017-04-19 16:46:44 +00:00
parent a768bd8803
commit 4656bf128e
21 changed files with 864 additions and 476 deletions

View File

@ -1638,6 +1638,14 @@ static moo_pfrc_t pf_basic_at_put (moo_t* moo, moo_ooi_t nargs)
moo->errnum = MOO_EINVAL;
return MOO_PF_FAILURE;
}
if (MOO_OBJ_GET_FLAGS_RDONLY(rcv))
{
/* TODO: better error handlign */
moo->errnum = MOO_EPERM;
return MOO_PF_FAILURE;
}
pos = MOO_STACK_GETARG(moo, nargs, 0);
val = MOO_STACK_GETARG(moo, nargs, 1);