[pypy-commit] lang-js default: implemented STORE_MEMBER_SUB

stepahn noreply at buildbot.pypy.org
Wed May 18 19:27:59 CEST 2011


Author: Stephan <stephan at stzal.com>
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) {


More information about the pypy-commit mailing list