Author: Stephan <[email protected]>
Branch:
Changeset: r175:d0517e606515
Date: 2012-01-06 15:39 +0100
http://bitbucket.org/pypy/lang-js/changeset/d0517e606515/
Log: moved debugging builtins into builtins_global
diff --git a/js/builtins.py b/js/builtins.py
--- a/js/builtins.py
+++ b/js/builtins.py
@@ -170,10 +170,6 @@
#v = int(time.time()*1000)
#return create_object('Date', Value = W_IntNumber(v))
-def pypy_repr(this, *args):
- o = args[0]
- return W_String(repr(o))
-
#@specialize.memo()
#def get_value_of(type):
#class W_ValueValueOf(W_NewBuiltin):
@@ -629,7 +625,8 @@
## debugging
if not we_are_translated():
- put_native_function(w_Global, 'pypy_repr', pypy_repr)
+ put_native_function(w_Global, 'pypy_repr', global_builtins.pypy_repr)
+ put_native_function(w_Global, 'inspect', global_builtins.inspect)
put_native_function(w_Global, 'load', make_loadjs(interp))
diff --git a/js/builtins_global.py b/js/builtins_global.py
--- a/js/builtins_global.py
+++ b/js/builtins_global.py
@@ -84,3 +84,11 @@
i += 1
res.append(ch)
return ''.join(res)
+
+def pypy_repr(this, *args):
+ o = args[0]
+ return repr(o)
+
+def inspect(this, *args):
+ import pdb; pdb.set_trace();
+
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit