This makes it easier to run, but more importantly, makes it obvious
that the file in /data/jsmin is still conceptually in use.
Change-Id: Iaf10c9bd2f6643bcb0bae95eaf22ec92de15950d
Most of the time this is due to garbage user input, and MediaWiki's
normal handling of user input strings is to normalize them, not to
throw.
There are some hypothetical cases where a developer might want to see an
exception, rather than passing garbage to the client and letting the
client fail, but normalization is a defensible policy and works within
the existing interfaces.
Bug: T289597
Change-Id: Ida5ee72c10d1c3499b5b17594c5675db7cd38335
Methods are promoted upwards from SkinMustache to SkinTemplate
in preparation for them being shared between SkinMustache and
BaseTemplate.
This is mostly a move of existing functions in SkinMustache but
also introduces SkinTemplate::getTemplateData and updates SkinMustache
to call the parent function.
Bug: T263213
Change-Id: I028364eb91e907c2f51529aac495df1eaca7b466
Use ContentTransformer::preSaveTransform instead.
Extensions defining a content model should override ContentHandler::preSaveTransform.
Bug: T287156
Change-Id: I2a8c60470366fd95d056e0dfa8144f209bb7117e
For 99% of JS classes, there is no constructor description and instead
the class/constructor are defined together followed by both `@class`
and `@constructor` in the same block. These are interpreted as the
description belonging to the class and prominently displayed in the
documentation.
For the very rare cases where a constructor has its own description,
this must follow the tag rather than preceed it. This makes sense
when thinking about it in terms of how classes are usually defined
(above the constructor, and thus the space above `@constructor`
already belongs to `@class`).
This has the unfortunate side-effect, however, that when a constructor
is documented on its own, that any text above `@constructor` is
ignored, as happened with mw.Api.
But, as so often with strict documentation warnings, it helped uncover
a mistake. The text here is quite useful and not really specific to
the constructor and more broadly useful for the module as a whole,
as such I moved it to the class block.
Also:
* Clean up the code by bringing the class and constructor definition
back together.
* Fix warning about invalid internal reference:
> Warning: /resources/src/mediawiki.api/index.js:3: {@link https://…}
The `@see` tag is only valid when referring to another index entity.
There were three other uses of `@see` with a URL in core, but only in
`@ignore`-ed code, which this commit fixes at the same time.
Follows-up a28b76abe9.
* Use local `var` declarion for `promises`, since "one-var" style
is no longer current.
Change-Id: I2d4f8b99c2896d4e1af50956c9faa8b36344884e
* Move data files to /data
* Add benchmarkCommentFormatter, named for the new class hierarchy.
Bug: T285917
Change-Id: Idf2529894fe63d34087d6d5ce4dd1676c89b1373
Follows-up acd3a53799.
* Factor out duplicated code between upsert() and replace() into
normalizeUpsertParams()
* Passing more than one key to normalizeUpsertKeys() was unconditionally
an error, so simplify it by removing the loop and inspecting the count
and first element.
* Rename $keyColumnCountNull to $numNulls
* Note that the complex code in assertValidUpsertSetArray() exists for
the benefit of PostgreSQL.
* Rename makeConditionCollidesUponKey() to makeKeyCollisionCondition().
* Delete makeConditionCollidesUponKeys() since it was only ever called
with a single key, so the callers can instead call
makeKeyCollisionCondition().
* Rename $disjunctions to $orConds for clarity.
Change-Id: Ib40057ea1d9c69d5b7f061b6061c595dd3668454
Prior art in I8ce1fa31f, Id37619cead, I9db7b3f36f, If219463d80a.
Start to nudge future development in a better direction by starting
to discourage getVal() since it is an odd hybrid after all, that
for the most part could probably be replaced by getRawVal, except
that there is a handful of really critical getVal() calls for
"title" in many places that are difficult to track down, so for now
we're probably stuck with this.
Change-Id: I18767cd809f67bde6784bda5e3c85974ea2e7205
Some variables don't need to be declared at the top of the
relevant scope if they are only used after they are defined,
since we no longer enable the eslint rule vars-on-top. Move
the declarations to where they are defined.
Also, in mw.jqueryMsg.HtmlEmitter.emit replace a temporary
return variable with direct early returns.
Should be a no-op in terms of functionality.
Change-Id: I8c036c5305a99b93140a8d02faafa7bed928c0b6