Author: Stephan <[email protected]>
Branch:
Changeset: r83:f50a2a4bdda0
Date: 2011-05-18 19:30 +0200
http://bitbucket.org/pypy/lang-js/changeset/f50a2a4bdda0/
Log: implemented STORE_MEMBER_SUB
diff --git a/js/jscode.py b/js/jscode.py
--- a/js/jscode.py
+++ b/js/jscode.py
@@ -639,9 +639,9 @@
def operation(self, ctx, value):
return decrement(ctx, value)
-class STORE_MEMBER_SUB(BaseStoreMember):
- def operation(self, *args):
- raise NotImplementedError
+class STORE_MEMBER_SUB(BaseStoreMemberAssign):
+ def decision(self, ctx, value, prev):
+ return sub(ctx, prev, value)
class BaseStore(Opcode):
def __init__(self, name):
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
@@ -672,6 +672,10 @@
yield assertv, "var x = {y:2}; --x.y; x.y;", 1
yield assertv, "var x = {y:2}; --x.y;", 1
+def test_member_sub():
+ yield assertv, "var x = {y:10}; x.y-=5; x.y", 5
+ yield assertv, "var x = {y:10}; x.y-=5;", 5
+
def switch_test_code(x):
return """
function f(x) {
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit