mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
b8382513fc
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 |
||
---|---|---|
.. | ||
annotations | ||
metaitems | ||
models | ||
nodes | ||
.eslintrc.json | ||
ve.dm.MWWikitextSurface.js | ||
ve.dm.MWWikitextSurfaceFragment.js |