mediawiki-extensions-Visual.../modules/ve-mw/dm
Thiemo Kreuz b8382513fc Use separate data structure to store aliases in spec
Wait, what's going on here? This patch looks like it changes the
behavior of this code. But it doesn't. Here is what happened
before:
* Let's say a template contains 2 parameters, A and B.
* We don't know yet if these names are aliases.
* getParameterNames() returns [ "A", "B" ].
* extend() is called. The TemplateData documentation contains
  the parameters "B" and "C". "C" does have an alias "A".
* extend() can't find "C" and adds it to the end, as if it's a
  new parameter.
* extend() also iterates the aliases. For each alias it creates
  a reference to the specification object. In this case a
  reference from "A" to "C" is created.
* But "A" already exists. The position of "A" doesn't change,
  but the specification now says it's an alias.
* getParameterNames() skips aliases. It skips "A" and instead
  returns the new "C" from the end of the list.

This was the behavior before. It's unchanged, proven by the tests.

Change-Id: I04b8a14fbec7be5a1c4defabf92e94f694c1e638
2021-06-25 08:29:48 +02:00
..
annotations MWExternalLinkAnnotation: Call core method to evaluate diff 2021-01-22 17:33:24 +00:00
metaitems MWCategoryMetaItem: Allow trailing whitespace (e.g. \n) in category names 2020-10-06 12:17:30 -07:00
models Use separate data structure to store aliases in spec 2021-06-25 08:29:48 +02:00
nodes Inline many var declarations in the code below 2021-06-23 09:02:24 +00:00
.eslintrc.json
ve.dm.MWWikitextSurface.js
ve.dm.MWWikitextSurfaceFragment.js Remove/fix a few small pieces of unused code 2021-05-21 11:43:45 +00:00