Page MenuHomePhabricator

Visual diffing a change to a syntaxHighlight node causes JS error
Closed, ResolvedPublic1 Estimated Story Points


  1. Go to
  2. Edit the code block that begins with var question
  3. Try to view visual diff, get JS error

This happens because ve.ui.DiffElement#compareNodeAttributes calls .static.describeChanges( attributeChanges, attributeChange.newAttributes ); on the node class of the relevant node. Note that 2 parameters are passed. However, takes three parameters. The third parameter (element) ends up being undefined, and so calling element ) results in an error.

For extra confusion, note that is defined to take only one parameter, despite being called with two and all subclasses' implementations taking either two, zero or three parameters.

Event Timeline

I've also found that this happens for hieroglyph nodes too, but not for math and score nodes, even though they're also subclasses of For some reason, any changes to math and score nodes are rendered in the diff as deleting the old node and inserting the new node, whereas changed to syntaxHighlight and hiero nodes are correctly detected as attribute changes.

Change 343321 had a related patch set uploaded (by Catrope; owner: Jforrester):
[mediawiki/extensions/VisualEditor] Update VE core submodule to master (a63435906)

Change 343321 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor] Update VE core submodule to master (a63435906)

Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF set the point value for this task to 1.