Closed GoogleCodeExporter closed 9 years ago
Sorry... I changed the location of the debug_onBeforeCompile and
debug_onAfterCompile but the error occurs regardless.
Original comment by ATM1...@gmail.com
on 5 Aug 2010 at 6:11
Ok I tracked down this error a bit further. Please disregard my first post, I
did a bad copy/paste job.
Basically this works (debug_onBeforeCompile and debug_onAfterCompile are not
part of my JSParser class):
def debug_onBeforeCompile(event):
print event
def debug_onAfterCompile(event):
print event
class JSParser:
'''
JavaScript Parser
'''
def __init__(self):
self.context = PyV8.JSContext( Global() )
self.context.enter()
PyV8.debugger.enabled = True
PyV8.debugger.onBeforeCompile = lambda event: debug_onBeforeCompile(event)
PyV8.debugger.onAfterCompile = lambda event: debug_onAfterCompile(event)
def evaljs(self,js_to_eval):
self.context.eval(js_to_eval)
This does not work: (debug_onBeforeCompile and debug_onAfterCompile ARE part of
my JSParser class:
class JSParser:
'''
JavaScript Parser
'''
def __init__(self):
self.context = PyV8.JSContext( Global() )
self.context.enter()
PyV8.debugger.enabled = True
PyV8.debugger.onBeforeCompile = lambda event: self.debug_onBeforeCompile(event)
PyV8.debugger.onAfterCompile = lambda event: self.debug_onAfterCompile(event)
def evaljs(self,js_to_eval):
self.context.eval(js_to_eval)
def debug_onBeforeCompile(self,event):
print "Before Compile"
def debug_onAfterCompile(self,event):
print "After Compile"
Original comment by ATM1...@gmail.com
on 5 Aug 2010 at 6:32
ok :)
Original comment by flier...@gmail.com
on 6 Aug 2010 at 2:27
Original issue reported on code.google.com by
ATM1...@gmail.com
on 5 Aug 2010 at 6:07