Closed GoogleCodeExporter closed 9 years ago
Ok, i got more tests (attached file).
1) Seems that after i added:
@property
def length(self):
return len(self.arr)
it works.. But i guess it will be a lot more easier, the wrapper to check
__len__,
when length property is used in the JS context.
2) I got the __getitem__ working :)
3) for(var item in arr) is still not working, any ideas why?
Original comment by Liubomir...@gmail.com
on 10 Mar 2010 at 3:44
Attachments:
I think it is a great idea, I will try to support it more smooth later :)
Thanks
Original comment by flier...@gmail.com
on 10 Mar 2010 at 3:47
Please check out latest SVN code after r242 to verify it, thanks
def gen(x):
yield 1
yield 2
yield 3
with JSContext(Global()) as ctxt:
func = ctxt.eval("""(function (k) {
var result = [];
for (var prop in k) {
result.push(prop);
alert("key=" + prop + ", value=" + k[prop]);
}
return result;
})""")
print "gen", func(gen(3))
gen key=1, value=undefined
key=2, value=undefined
key=3, value=undefined
1,2,3
Original comment by flier...@gmail.com
on 14 Mar 2010 at 4:10
Attachments:
Original issue reported on code.google.com by
Liubomir...@gmail.com
on 10 Mar 2010 at 3:11