- added a 'new' intrinsic to create new objects from inside scripts.
This is not tested yet and likely to not working correctly yet. Will be fixed once I get far enough to use it later.
This commit is contained in:
parent
d5962b290c
commit
8578a5a12e
6 changed files with 106 additions and 0 deletions
|
|
@ -759,6 +759,14 @@ begin:
|
|||
assert(0);
|
||||
NEXTOP;
|
||||
|
||||
OP(NEW_K):
|
||||
OP(NEW):
|
||||
{
|
||||
PClass *cls = (PClass*)(op == OP_NEW ? reg.a[C] : konsta[C].v);
|
||||
reg.a[B] = cls->CreateNew();
|
||||
NEXTOP;
|
||||
}
|
||||
|
||||
OP(TRY):
|
||||
assert(try_depth < MAX_TRY_DEPTH);
|
||||
if (try_depth >= MAX_TRY_DEPTH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue