Subject: | Incorrect handling of numbers in encode_js |
The example given in the documentation is:
<script>
var int_from_perl = #~ encode_js($number) ~#;
var str_from_perl = '#~ encode_js($string) ~#';
</script>
However, if $number is negative (say, -100) the output becomes:
var int_from_perl = \-100;
Which is a syntax error.