From 512c48831ef4c7718061e6691b0d5b2d0f057f46 Mon Sep 17 00:00:00 2001 From: Robert Krimen Date: Fri, 19 Oct 2012 12:21:45 -0700 Subject: [PATCH] Have newNumberNode use stringToFloat --- node_expression.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/node_expression.go b/node_expression.go index 45ee471..6528176 100644 --- a/node_expression.go +++ b/node_expression.go @@ -2,7 +2,6 @@ package otto import ( "fmt" - "strconv" ) type _arrayNode struct { @@ -384,10 +383,12 @@ func newBooleanNode(text string) *_valueNode { } func newNumberNode(text string) *_valueNode { - value, error := strconv.ParseFloat(text, 64) - if error != nil { - throwHereBeDragons(error) - } + // TODO Can there be an error here? Is NaN a good catch-all? + value := stringToFloat(text) + //value, err := strconv.ParseFloat(text, 64) + //if err != nil { + // throwHereBeDragons(error) + //} return &_valueNode{ _nodeType: nodeValue, Text: text,