It was deprecated to encourage callers to use makeInlineScript()
instead, because before makeInlineScript() was introduced, callers
would often manually wrap it in a <script> tag, which we don't want
because 1) We want de-duplication through WrappedString and 2)
callers sometimes forget to use Html.php methods that ensure
proper escaping as-needed.
However, there is still use in getting thet wrapped script without
also the wrapped HTML script tag. Namely, for use in http responses
that produce JavaScript, rather than HTML, where there cannot be
an HTML script tag.
There is at least one such caller (in SpecialJavaScriptTest) and
it's fine for there to be others.
Change-Id: Icfc285e12293c76dc68a220deb6816e32b058209
}
/**
- * Returns JS code which runs given JS code if the client-side framework is
- * present.
+ * Wraps JavaScript code to run after startup and base modules.
*
- * @deprecated since 1.25; use makeInlineScript instead
* @param string $script JavaScript code
* @return string JavaScript code
*/
}
/**
- * Construct an inline script tag with given JS code.
+ * Returns an HTML script tag that runs given JS code after startup and base modules.
*
- * The code will be wrapped in a closure, and it will be executed by ResourceLoader
- * only if the client has adequate support for MediaWiki JavaScript code.
+ * The code will be wrapped in a closure, and it will be executed by ResourceLoader's
+ * startup module if the client has adequate support for MediaWiki JavaScript code.
*
* @param string $script JavaScript code
* @return WrappedString HTML