From dad8d4a0ea464966d05d7db62848ca083d81bf3c Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 3 Oct 2012 13:54:35 +0000 Subject: [PATCH] gfse: fix a bug caused by sharing when copying a linearization function in the row view Functional programming is easier than imperative programming! --- src/www/gfse/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/www/gfse/editor.js b/src/www/gfse/editor.js index 703886ab5..c33f0bfa4 100644 --- a/src/www/gfse/editor.js +++ b/src/www/gfse/editor.js @@ -1486,7 +1486,9 @@ function draw_row(g) { for(var i in missing) { var ci=missing[i] var conc=g.concretes[ci] - conc.lins.push(lin) + // This is not functional programming, so copy the lin first... + var lin2=JSON.parse(JSON.stringify(lin)) + conc.lins.push(lin2) timestamp(conc); } reload_grammar(g)