Browse files

Improved builtin float parser

  • Loading branch information...
1 parent 8420182 commit 834f657dd31a3a5aca7219ec4becb9df488b4e5f @tarruda committed Aug 30, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/router.coffee
View
3 src/router.coffee
@@ -105,9 +105,8 @@ class Compiler
float: (str, opts) ->
str = str.trim()
+ if str == '' || isNaN(str) then return null
rv = parseFloat(str)
- if ! isFinite(rv) || rv.toString() != str
- return null
if opts
if (isFinite(opts.min) && rv < opts.min) ||
(isFinite(opts.max) && rv > opts.max)

0 comments on commit 834f657

Please sign in to comment.