+ if ( $this->mayValidateScript ) {
+ // This enables the validation check that replaces invalid
+ // scripts with a warning message.
+ // Based on $wgResourceLoaderValidateJS
+ return $this->validateScriptFile( 'input', $this->script );
+ } else {
+ return $this->script;
+ }