Skip Menu |
 

This queue is for tickets about the Data-JavaScript-Anon CPAN distribution.

Report information
The Basics
Id: 24413
Status: new
Priority: 0/
Queue: Data-JavaScript-Anon

People
Owner: Nobody in particular
Requestors: Sergiy.Borodych [...] gmail.com
Cc:
AdminCc:

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



Subject: bug when CODE in HASH
Date: Wed, 17 Jan 2007 14:52:37 +0200
To: bug-Data-JavaScript-Anon [...] rt.cpan.org
From: Sergey Borodich <bor [...] univ.kiev.ua>
Download (untitled) / with headers
text/plain 1.5k
When found CODE in HASH module generate broken javascript code perl code: $VAR1 = { 'constraint_methods' => { 'phone' => sub { "DUMMY" }, 'last_name' => sub { "DUMMY" }, 'email' => sub { "DUMMY" }, 'first_name' => sub { "DUMMY" } }, 'required' => [ 'login', 'password', 'password2', 'email', 'first_name', 'last_name', }; generated code: var signup_form = { constraint_methods: { phone: , last_name: , email: , first_name: }, required: [ "login", ... but code like "phone: ," is broken $errstr: CODE was found in the dump struct. Data::JavaScript::Anon only supports objects based on, or references to SCALAR, ARRAY and HASH type variables. problem near line 90 anon_dump don't check for undef return from recursive himself call I suggest return "" (empty string) here like diff /usr/lib/perl5/vendor_perl/5.8.8/Data/JavaScript/Anon.pm.orig /usr/lib/perl5/vendor_perl/5.8.8/Data/JavaScript/Anon.pm 90c90 < . $class->anon_dump( $something->{$_}, $processed ) --- Show quoted text
> . ($class->anon_dump(
$something->{$_}, $processed ) || '""') OR check for undef return and not add this key to javascript code never -- Sergey Borodich http://bor.org.ua


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.