You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is because they are properties of window, not primitive types. window.Infinity - anybody could redefine that.
JSON.parse('{"num": Infinity}')
VM1027:1Uncaught SyntaxError: UnexpectedtokenIinJSONatposition8atJSON.parse(<anonymous>)
at <anonymous>:1:6
(anonymous) @ VM1026:1
// maybe just use a string for now
JSON.parse('{"num": "Infinity"}')
Object {num: "Infinity"}
I could convert the JSON.parse result to real Infinity objects
My workaround for now is to preprocess the object by replacing infinities with the strings "Infinity" and "-Infinity", and in JS I can postprocess numeric values using the unary + operator.
The text was updated successfully, but these errors were encountered: