- if ( $context->shouldIncludeScripts() ) {
- // If we are in debug mode, we'll want to return an array of URLs if possible
- // However, we can't do this if the module doesn't support it
- // We also can't do this if there is an only= parameter, because we have to give
- // the module a way to return a load.php URL without causing an infinite loop
- if ( $context->getDebug() && !$context->getOnly() && $this->supportsURLLoading() ) {
- $scripts = $this->getScriptURLsForDebug( $context );
- } else {
- $scripts = $this->getScript( $context );
- // Make the script safe to concatenate by making sure there is at least one
- // trailing new line at the end of the content. Previously, this looked for
- // a semi-colon instead, but that breaks concatenation if the semicolon
- // is inside a comment like "// foo();". Instead, simply use a
- // line break as separator which matches JavaScript native logic for implicitly
- // ending statements even if a semi-colon is missing.
- // Bugs: T29054, T162719.
- if ( is_string( $scripts )
- && strlen( $scripts )
- && substr( $scripts, -1 ) !== "\n"
- ) {
- $scripts .= "\n";
- }
+ // If we are in debug mode, we'll want to return an array of URLs if possible
+ // However, we can't do this if the module doesn't support it.
+ // We also can't do this if there is an only= parameter, because we have to give
+ // the module a way to return a load.php URL without causing an infinite loop
+ if ( $context->getDebug() && !$context->getOnly() && $this->supportsURLLoading() ) {
+ $scripts = $this->getScriptURLsForDebug( $context );
+ } else {
+ $scripts = $this->getScript( $context );
+ // Make the script safe to concatenate by making sure there is at least one
+ // trailing new line at the end of the content. Previously, this looked for
+ // a semi-colon instead, but that breaks concatenation if the semicolon
+ // is inside a comment like "// foo();". Instead, simply use a
+ // line break as separator which matches JavaScript native logic for implicitly
+ // ending statements even if a semi-colon is missing.
+ // Bugs: T29054, T162719.
+ if ( is_string( $scripts )
+ && strlen( $scripts )
+ && substr( $scripts, -1 ) !== "\n"
+ ) {
+ $scripts .= "\n";