Skip Menu |

This queue is for tickets about the JavaScript-Duktape-XS CPAN distribution.

Report information
The Basics
Id: 129924
Status: new
Priority: 0/
Queue: JavaScript-Duktape-XS

People
Owner: Nobody in particular
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

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



Subject: Wrong decision about perl datatypes
Below is example when perl treats scalar as string ("042"), and even JSON::XS converts it to JSON string, but JavaScript::Duktape::XS treats it as a number. I think that behaviour is not consistent with perl. $ cat 2.pl use strict; use warnings; use JavaScript::Duktape::XS; use JSON::XS; my $vm = JavaScript::Duktape::XS->new(); my $x = "042"; die if $x == 13; print "orig: $x\n"; print "orig json ". encode_json({x => $x})."\n"; $vm->set('xx', $x); print "result: ".$vm->get('xx')."\n"; print "result json: ".encode_json({x => $vm->get('xx')})."\n"; $ perl 2.pl orig: 042 orig json {"x":"042"} result: 42 result json: {"x":42}