def eval(self, ctx): value = ctx.stack.pop() left = ctx.stack.pop() typ = type(left) if typ in PRIMITIVES: if typ == NULL_TYPE: raise MakeError('TypeError', "Cannot set property '%s' of null" % self.prop) elif typ == UNDEFINED_TYPE: raise MakeError('TypeError', "Cannot set property '%s' of undefined" % self.prop) ctx.stack.append(BINARY_OPERATIONS[self.op](get_member_dot(left, self.prop, ctx.space), value)) return else: ctx.stack.append(BINARY_OPERATIONS[self.op](get_member_dot(left, self.prop, ctx.space), value)) left.put(self.prop, ctx.stack[-1])
def eval(self, ctx): args = ctx.stack.pop() base = ctx.stack.pop() func = get_member_dot(base, self.prop, ctx.space) return bytecode_call(ctx, func, base, args)
def eval(self, ctx): left = ctx.stack.pop() target = to_number(get_member_dot(left, self.prop, ctx.space)) + self.cb if type(left) not in PRIMITIVES: left.put(self.prop, target) ctx.stack.append(target + self.ca)
def eval(self, ctx): value = ctx.stack.pop() left = ctx.stack.pop() typ = type(left) if typ in PRIMITIVES: if typ == NULL_TYPE: raise MakeError('TypeError', "Cannot set property '%s' of null" % self.prop) elif typ == UNDEFINED_TYPE: raise MakeError( 'TypeError', "Cannot set property '%s' of undefined" % self.prop) ctx.stack.append(BINARY_OPERATIONS[self.op](get_member_dot( left, self.prop, ctx.space), value)) return else: ctx.stack.append(BINARY_OPERATIONS[self.op](get_member_dot( left, self.prop, ctx.space), value)) left.put(self.prop, ctx.stack[-1])
def eval(self, ctx): obj = ctx.stack.pop() ctx.stack.append(get_member_dot(obj, self.prop, ctx.space))