Opened 5 years ago

Closed 5 years ago

#1517 closed change (fixed)

Always call parseInt() with a radix as second argument

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.8.8-for-Chrome-Opera-Safari
Module: Platform Keywords: goodfirstbug
Cc: trev Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5171007186796544/

Description

Background

Most of the calls to parseInt() in the platform code only specify the first argument. However, different implementations behave differently in cases like parseInt('011'). So the radix should always be specified with the second argument, to eliminate reader confusion and to guarantee predictable behavior.

What to change

Change all calls of the form parseInt(string) to parseInt(string, 10).

Change History (3)

comment:1 Changed 5 years ago by sebastian

  • Owner set to sebastian

comment:2 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 5 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.