The JSON reviver math.json.reviver is not deserializing nodes correctly.
Example:
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]
It seems like x2 is composed of vanilla Javascript objects rather than nodes. Omitting the reviver completely achieves the same result, as demonstrated with underscore.
var x3 = JSON.parse(JSON.stringify(x));
console.log(_.isEqual(x2,x3)); // outputs true
console.log(_.isEqual(x,x2)); // outputs false
The JSON reviver math.json.reviver is not deserializing nodes correctly.
Example:
It seems like x2 is composed of vanilla Javascript objects rather than nodes. Omitting the reviver completely achieves the same result, as demonstrated with underscore.