Subject: | 1.10 has a regression where javascript reserved words can no longer be used as keys in perl hashes. |
For some reason, perl hashes are printed using as variable.key in Data-Javascript 1.10 rather than variable['key'], like they were in 1.08. This is a regression because now dumping a hash like { array => [], class => "monkey" } will give javascript errors.
--- /Users/kevinj/Data-JavaScript-1.10/JavaScript.pm 2005-11-13 00:50:00.000000000 -0800
+++ JavaScript.pm 2005-11-14 11:09:10.000000000 -0800
@@ -111,8 +111,7 @@
my ($k, $old_k, $v);
foreach $k (keys %$elem) {
$k = __quotemeta($old_k=$k);
- my $newsym = (($k =~ /^[a-z_]\w+$/i) ? "$sym.$k" :
- "$sym\['$k']");
+ my $newsym = "$sym\['$k']";
push(@list, __jsdump($newsym, $elem->{$old_k}, $dict, $undef));
}
return @list;