292 else |
293 else |
293 { |
294 { |
294 // Lua function |
295 // Lua function |
295 } |
296 } |
296 break; |
297 break; |
|
298 case OP_CLOSURE: |
|
299 var prototype_id = INS_Bx(instruction); |
|
300 var chunk = this.frame.f.chunk.prototypes[prototype_id]; |
|
301 if(chunk.numUpvalues>0) |
|
302 throw "Upvalues not yet implemented, sorry :)"; |
|
303 var f = new LFunction(chunk, this.frame.f.environment); |
|
304 this.frame.reg[INS_A(instruction)] = new LValue("function", f); |
|
305 break; |
297 case OP_RETURN: |
306 case OP_RETURN: |
298 this.callstack.pop(); |
307 this.callstack.pop(); |
299 break; |
308 break; |
300 default: |
309 default: |
301 throw "Unhandled opcode: "+INS_OPCODE(instruction); |
310 throw "Unhandled opcode: "+INS_OPCODE(instruction); |