marylinh / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Reference error in the context based cached object #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. define a write function which will just print out values. 

def write(self, val): 
    print val 

2. code like this: 

write(obj) 
write(obj) 

(obj is the global object itself) 

3.

What is the expected output? What do you see instead?

The first call to write will succeed and the second call *sometimes* 
fails with: 
TypeError: Property 'write' of object #<error> is not a function 
Sometimes it takes more than two calls: 
write(obj) 
write(obj) 
write(obj) 
write(obj)  <---  TypeError: Property 'write' of object #<error> is 
not a function 
I can't really provide a specific piece of code that will result in 
this error each time, but the code is so simple I can't see how the 
global object becomes "#<error>" all of a sudden.

Please use labels and text to provide additional information.

http://groups.google.com/group/pyv8/browse_thread/thread/ee786b7ef83353ba?hl=en

Original issue reported on code.google.com by flier...@gmail.com on 9 Feb 2011 at 7:56

GoogleCodeExporter commented 9 years ago
mcot said:

This is solved for now.  I had an extra context.enter() being called
from some old code.  I guess thats a good case for moving to using the
"with" statement.

Original comment by flier...@gmail.com on 15 Feb 2011 at 2:04

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 15 Feb 2011 at 2:05