| 460 | |
| 461 | |
| 462 | int runInt(CppiaCtx *ctx) HXCPP_OVERRIDE |
| 463 | { |
| 464 | if (FUNC==afPush) |
| 465 | { |
| 466 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 467 | BCR_CHECK; |
| 468 | ELEM elem; |
| 469 | runValue(elem,ctx,args[0]); |
| 470 | BCR_CHECK; |
| 471 | int result = thisVal->push(elem); |
| 472 | return result; |
| 473 | } |
| 474 | if (FUNC==afPop) |
| 475 | { |
| 476 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 477 | BCR_CHECK; |
| 478 | return ValToInt(thisVal->pop()); |
| 479 | } |
| 480 | if (FUNC==afShift) |
| 481 | { |
| 482 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 483 | BCR_CHECK; |
| 484 | return ValToInt(thisVal->shift()); |
| 485 | } |
| 486 | if (FUNC==afContains) |
| 487 | { |
| 488 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 489 | BCR_CHECK; |
| 490 | ELEM elem; |
| 491 | runValue(elem,ctx,args[0]); |
| 492 | BCR_CHECK; |
| 493 | return thisVal->contains(elem); |
| 494 | } |
| 495 | if (FUNC==afRemove) |
| 496 | { |
| 497 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 498 | BCR_CHECK; |
| 499 | ELEM elem; |
| 500 | runValue(elem,ctx,args[0]); |
| 501 | BCR_CHECK; |
| 502 | return thisVal->remove(elem); |
| 503 | } |
| 504 | if (FUNC==afIndexOf) |
| 505 | { |
| 506 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 507 | BCR_CHECK; |
| 508 | ELEM elem; |
| 509 | runValue(elem,ctx,args[0]); |
| 510 | BCR_CHECK; |
| 511 | hx::Object *start = args[1]->runObject(ctx); |
| 512 | BCR_CHECK; |
| 513 | return thisVal->indexOf(elem,start); |
| 514 | } |
| 515 | if (FUNC==afLastIndexOf) |
| 516 | { |
| 517 | Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx); |
| 518 | BCR_CHECK; |
| 519 | ELEM elem; |