1
0
mirror of https://github.com/robertkrimen/otto synced 2025-09-28 18:45:22 +08:00

Have newNumberNode use stringToFloat

This commit is contained in:
Robert Krimen 2012-10-19 12:21:45 -07:00
parent 1728c036d4
commit 512c48831e

View File

@ -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,