Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
JSON reviver doesn't deserialize nodes correctly #1077
The JSON reviver math.json.reviver is not deserializing nodes correctly.
var x = math.parse("x/2"); var x2 = JSON.parse(JSON.stringify(x), math.json.reviver); console.log(x.toString()); // outputs 'x / 2' console.log(x2.toString()); // outputs [object Object]
var x3 = JSON.parse(JSON.stringify(x)); console.log(_.isEqual(x2,x3)); // outputs true console.log(_.isEqual(x,x2)); // outputs false
Thanks for reporting, nodes are indeed not supported in serialization/deserialization. We should definitely add this. Same holds for the
EDIT: I see ResultSet already supports serialization, so it's just the nodes that we need to extend (I'm working on it).