lvm.js

changeset 113
1e49dfb8ccdc
parent 112
5318bb31b0ac
child 114
82d7b057d330
equal deleted inserted replaced
112:5318bb31b0ac 113:1e49dfb8ccdc
473 break; 473 break;
474 case OP_CALL: 474 case OP_CALL:
475 var f = frame.reg[INS_A(instruction)].precall(); // return JS or LValue 475 var f = frame.reg[INS_A(instruction)].precall(); // return JS or LValue
476 var A = INS_A(instruction), B = INS_B(instruction), C = INS_C(instruction); 476 var A = INS_A(instruction), B = INS_B(instruction), C = INS_C(instruction);
477 var undefined; 477 var undefined;
478 var args = frame.reg.slice(A+1, B==0?undefined:(A+B)); 478 var args;
479 for(var i=args.length+1;i<f.maxStackSize;i++) 479 if(B != 1)
480 args = frame.reg.slice(A+1, B==0?undefined:(A+B));
481 else
482 args = [];
483 for(var i=args.length;i<f.maxStackSize;i++)
480 args[i] = new LValue(this, "nil", null); 484 args[i] = new LValue(this, "nil", null);
481 if(typeof(f) == "function") 485 if(typeof(f) == "function")
482 { 486 {
483 // JS native function 487 // JS native function
484 var ret = this.call(f, args); 488 var ret = this.call(f, args);

mercurial