Example #1
0
 def newbinding_fromframe(self, frame):
     names = frame.bytecode.cellvars + frame.bytecode.freevars
     cells = [None] * len(frame.cells)
     for i in xrange(len(frame.cells)):
         cells[i] = frame.cells[i].upgrade_to_closure(self, frame, i)
     return W_BindingObject(self, names, cells, frame.w_self,
                            frame.lexical_scope)
Example #2
0
 def newbinding_fromblock(self, block):
     names = block.bytecode.cellvars + block.bytecode.freevars
     cells = block.cells[:]
     return W_BindingObject(self, names, cells, block.w_self,
                            block.lexical_scope)