Skip Menu |
 

This queue is for tickets about the JavaScript CPAN distribution.

Report information
The Basics
Id: 46356
Status: new
Priority: 0/
Queue: JavaScript

People
Owner: Nobody in particular
Requestors: zhurs [...] ya.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.12
Fixed in: (no value)



Subject: Emptified arrays in arguments of function call
Download (untitled) / with headers
text/plain 340b
When I pass perl array to javascript function as argument, it become empty after call. % perl -e 'use JavaScript; use Data::Dumper; my $cx = JavaScript::Runtime->new()->create_context(); $cx->eval(qq!function f1(arr) {}!); my $arr = [1,2]; $cx->call("f1", $arr); print Dumper $arr' $VAR1 = []; Attached patch fixed this issue in my case.
Subject: arg_array.patch
Download arg_array.patch
text/x-diff 546b
--- libjavascript-perl-1.12.orig/PJS_TypeConversion.c +++ libjavascript-perl-1.12/PJS_TypeConversion.c @@ -208,7 +208,7 @@ av_length = av_len(av); for(cnt = 0; cnt <= av_length; cnt++) { jsval value; - if (PJS_ConvertPerlToJSType(cx, seen, obj, av_shift(av), &value) == JS_FALSE) { + if (PJS_ConvertPerlToJSType(cx, seen, obj, *(av_fetch(av, cnt, 0)), &value) == JS_FALSE) { *rval = JSVAL_VOID; return JS_FALSE; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.