Commit f26780c
committed
ucode: Add 'operator execute'
It can be useful to call a resource as if it was a function. This commit adds a way to do so.
When a non-callable is supplied to uc_vm_insn_call(), and it is an object or has a prototype, then the object/prototype stack is searched for a callable named 'operator()', and if found, that is called instead.
So in the script
var(...); is a functional synonym to var['operator()']();
Signed-off-by: Isaac de Wolff <[email protected]>1 parent 61679aa commit f26780c
1 file changed
+47
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2427 | 2427 | | |
2428 | 2428 | | |
2429 | 2429 | | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
2430 | 2444 | | |
2431 | 2445 | | |
2432 | 2446 | | |
| |||
2435 | 2449 | | |
2436 | 2450 | | |
2437 | 2451 | | |
2438 | | - | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
2442 | 2485 | | |
2443 | 2486 | | |
2444 | 2487 | | |
| |||
0 commit comments