Comment 1 for bug 1492265

Revision history for this message
Matt Borland (palecrow) wrote :

The current problem is that JSON.parse() doesn't recognize Infinity as a value:

(in nodejs, if I assign the JSON returned from the server, it replies with maxTotalInstances of Infinity which then causes a JSON parsing error)

> a = '{"maxImageMeta": 128, "maxPersonality": 5, "maxPersonalitySize": 10240, "maxSecurityGroupRules": 20, "maxSecurityGroups": 10, "maxServerGroupMembers": 10, "maxServerGroups": 10, "maxServerMeta": 128, "maxTotalCores": 20, "maxTotalFloatingIps": 10, "maxTotalInstances": Infinity, "maxTotalKeypairs": 100, "maxTotalRAMSize": 51200, "totalCoresUsed": 0, "totalFloatingIpsUsed": 0, "totalInstancesUsed": 0, "totalRAMUsed": 0, "totalSecurityGroupsUsed": 0, "totalServerGroupsUsed": 0}'

> JSON.parse(a)
SyntaxError: Unexpected token I
    at Object.parse (native)
    at repl:1:7
    at REPLServer.eval (repl.js:80:21)
    at Interface.<anonymous> (repl.js:182:12)
    at Interface.emit (events.js:67:17)
    at Interface._onLine (readline.js:162:10)
    at Interface._line (readline.js:426:8)
    at Interface._ttyWrite (readline.js:603:14)
    at ReadStream.<anonymous> (readline.js:82:12)
    at ReadStream.emit (events.js:88:20)