javascript parseInt("08") return the value 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
firefox (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
the javascript function parseInt returns 0 when used with the string "08" or "09" :
parseInt("08") returns the value 0
parseInt("09") returns the value 0
but
parseInt("01") returns the value 1
parseInt("02") returns the value 2
and so on until "07"
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: firefox 7.0.1+build1+
ProcVersionSign
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelMo
AddonCompatChec
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
BuildID: 20110928224508
Card0.Amixer.info:
Card hw:0 'NVidia'/'HDA NVidia at 0xfe020000 irq 21'
Mixer name : 'Nvidia MCP77/78 HDMI'
Components : 'HDA:10ec0888,
Controls : 44
Simple ctrls : 23
Channel: release
CurrentDmesg: Error: command ['sh', '-c', 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm: /var/log/dmesg: Permission denied
Date: Tue Nov 8 14:17:38 2011
ForcedLayersAccel: False
IncompatibleExt
IpRoute:
192.168.7.0/24 dev eth1 proto kernel scope link src 192.168.7.1 metric 1
169.254.0.0/16 dev eth1 scope link metric 1000
default via 192.168.7.126 dev eth1 proto static
Plugins:
Shockwave Flash - Lib=libflashpla
QuickTime Plug-in 7.6.6 - Lib=libtotem-
DivX® Web Player - Lib=libtotem-
Windows Media Player Plug-in 10 (compatible; Totem) - Lib=libtotem-
VLC Multimedia Plugin (compatible Totem 2.32.0) - Lib=libtotem-
ProcEnviron:
LANGUAGE=fr_FR:en
LANG=fr_FR.UTF-8
SHELL=/bin/bash
Profiles: Profile0 (Default) - LastVersion=
RunningIncompat
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/11/2010
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS M3N-HD/HDMI ACPI BIOS Revision 2703
dmi.board.name: M3N-HD/HDMI
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: 1.XX
dmi.chassis.
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: System Product Name
dmi.product.
dmi.sys.vendor: System manufacturer
That's expected. Numbers with a leading zero are considered octal numbers in Javascript, and "8" and "9" are not valid octal digits (which is why everything up to "07" works).