buildHTML's buildExpression is destructive, changing the tree object, this clones the object first before manipulating it.

This commit is contained in:
John Resig 2015-04-30 12:51:43 -04:00
parent 1f90b36518
commit 3875af8763

View File

@ -1157,6 +1157,10 @@ var buildGroup = function(group, options, prev) {
* nodes.
*/
var buildHTML = function(tree, settings) {
// buildExpression is destructive, so we need to make a clone
// of the incoming tree so that it isn't accidentally changed
tree = JSON.parse(JSON.stringify(tree));
var startStyle = Style.TEXT;
if (settings.displayMode) {
startStyle = Style.DISPLAY;