310 break; |
310 break; |
311 case OP_CLOSURE: |
311 case OP_CLOSURE: |
312 var prototype_id = INS_Bx(instruction); |
312 var prototype_id = INS_Bx(instruction); |
313 var chunk = this.frame.f.chunk.prototypes[prototype_id]; |
313 var chunk = this.frame.f.chunk.prototypes[prototype_id]; |
314 var f = new LFunction(chunk, this.frame.f.environment); |
314 var f = new LFunction(chunk, this.frame.f.environment); |
|
315 this.frame.reg[INS_A(instruction)] = new LValue("function", f); |
315 for(var i=0;i<chunk.numUpvalues;i++) |
316 for(var i=0;i<chunk.numUpvalues;i++) |
316 { |
317 { |
317 var upval_instruction = this.frame.f.instructions[this.frame.pc++]; |
318 var upval_instruction = this.frame.f.instructions[this.frame.pc++]; |
318 switch(INS_OPCODE(upval_instruction)) |
319 switch(INS_OPCODE(upval_instruction)) |
319 { |
320 { |