Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404738 )

Change subject: Deep clone expression result before modifying
......................................................................

Deep clone expression result before modifying

Necessary for the follow up which tickled the bug.

Change-Id: I380bb7a9bb16026954eb39a24c5915f5992153a9
---
M lib/wt2html/pegTokenizer.pegjs
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/38/404738/1

diff --git a/lib/wt2html/pegTokenizer.pegjs b/lib/wt2html/pegTokenizer.pegjs
index 1a0f97c..b8afe0b 100644
--- a/lib/wt2html/pegTokenizer.pegjs
+++ b/lib/wt2html/pegTokenizer.pegjs
@@ -1057,6 +1057,11 @@
       }
       var lvsrc = input.substring(lv0, lv1);
       var attribs = [];
+
+      // Do a deep clone since we may be destructively modifying
+      // (the `t[fld] = name;` below) the result of a cached expression.
+      ts = Util.clone(ts, true);
+
       ts.forEach(function(t) {
         // move token strings into KV attributes so that they are
         // properly expanded by early stages of the token pipeline

-- 
To view, visit https://gerrit.wikimedia.org/r/404738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I380bb7a9bb16026954eb39a24c5915f5992153a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to