Author: Stephan <[email protected]>
Branch: 
Changeset: r368:d4640c906e90
Date: 2013-03-20 16:22 +0100
http://bitbucket.org/pypy/lang-js/changeset/d4640c906e90/

Log:    pass function name into printable location

diff --git a/js/functions.py b/js/functions.py
--- a/js/functions.py
+++ b/js/functions.py
@@ -160,6 +160,7 @@
     def __init__(self, name, js_code):
         assert isinstance(name, unicode)
         JsExecutableCode.__init__(self, js_code)
+        js_code._function_name_ = name
         self._name_ = name
 
     def name(self):
diff --git a/js/jscode.py b/js/jscode.py
--- a/js/jscode.py
+++ b/js/jscode.py
@@ -10,7 +10,10 @@
 def get_printable_location(pc, debug, jscode):
     if pc < jscode._opcode_count():
         opcode = jscode._get_opcode(pc)
-        return '%d: %s' % (pc, str(opcode))
+        if jscode._function_name_ is not None:
+            return '%d: %s function: %s' % (pc, str(opcode), 
str(jscode._function_name_))
+        else:
+            return '%d: %s' % (pc, str(opcode))
     else:
         return '%d: %s' % (pc, 'end of opcodes')
 
@@ -47,6 +50,7 @@
         self._estimated_stack_size = -1
         self._symbols = symbol_map
         self.parameters = symbol_map.parameters[:]
+        self._function_name_ = None
 
     def variables(self):
         return self._symbols.variables
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to