Author: Stephan <[email protected]>
Branch:
Changeset: r293:80dc61db9048
Date: 2012-08-26 00:21 +0200
http://bitbucket.org/pypy/lang-js/changeset/80dc61db9048/
Log: amed to 298:7831b84f40c0
diff --git a/js/object_space.py b/js/object_space.py
--- a/js/object_space.py
+++ b/js/object_space.py
@@ -81,3 +81,22 @@
from js.jsobj import _w
return _w(fn(*args))
return f
+
+
+def hide_on_translate(*args):
+ default = None
+
+ def _wrap(f):
+ def _wrapped_f(*args):
+ from pypy.rlib.objectmodel import we_are_translated
+ if not we_are_translated():
+ return f(*args)
+
+ return default
+ return _wrapped_f
+
+ if len(args) == 1 and callable(args[0]):
+ return _wrap(args[0])
+ else:
+ default = args[0]
+ return _wrap
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit