Hi Markus,
As you know, pyv8 will automatic convert the primitive type
between Python and Javascript, including bool, int, long, string/
unicode, float, datetime/date/time. The other Python object, such as
list, tuple and dict, could be access with index or name. So, if you
want to explicit convert a Python list to Javascript array, I think
you could use PyV8.JSArray class, which will wrap a list as a pure
Javascript Array, but it will COPY the Python list content to a new
Javascript array. On the other hand, you could modify the list with
index if you don't use JSArray.
with PyV8.JSContext(Globals()) as ctx:
print ctx.eval("""array[1]""")
print ctx.eval('(function(arg) { return arg instanceof Array; })')
(ctx.locals.array)
print ctx.eval('(function(arg) { return arg instanceof Array; })')
(['a', 'b', 'c'])
print ctx.eval('(function(arg) { return arg instanceof Array; })')
(PyV8.JSArray(['a', 'b', 'c']))
print ctx.eval('(function(arg) { return
Object.prototype.toString.call(arg); })')(['a', 'b', 'c'])
print ctx.eval('(function(arg) { return
Object.prototype.toString.call(arg); })')(PyV8.JSArray(['a', 'b',
'c']))