Author: Stephan <step...@stzal.com> Branch: Changeset: r70:e3a477e97e82 Date: 2011-05-18 12:06 +0200 http://bitbucket.org/pypy/lang-js/changeset/e3a477e97e82/
Log: implemented STORE_MEMBER_BITAND diff --git a/js/jscode.py b/js/jscode.py --- a/js/jscode.py +++ b/js/jscode.py @@ -590,6 +590,12 @@ op1 = prev.ToInt32(ctx) return W_IntNumber(op0 ^ op1) +class STORE_MEMBER_BITAND(BaseStoreMemberAssign): + def decision(self, ctx, value, prev): + op0 = value.ToInt32(ctx) + op1 = prev.ToInt32(ctx) + return W_IntNumber(op0 & op1) + class BaseStoreMemberPost(Opcode): def eval(self, ctx, stack): left = stack.pop() diff --git a/js/test/test_interp.py b/js/test/test_interp.py --- a/js/test/test_interp.py +++ b/js/test/test_interp.py @@ -719,3 +719,9 @@ yield assertv, 'var i = {x:0}; i.x^=1;', 1 yield assertv, 'var i = {x:1}; i.x^=0;', 1 yield assertv, 'var i = {x:1}; i.x^=1;', 0 + +def test_member_bitand(): + yield assertv, 'var i = {x:0}; i.x&=0;', 0 + yield assertv, 'var i = {x:0}; i.x&=1;', 0 + yield assertv, 'var i = {x:1}; i.x&=0;', 0 + yield assertv, 'var i = {x:1}; i.x&=1;', 1 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit