// Version hash for a blank file module.
// Result of ResourceLoader::makeHash(), ResourceLoaderTestModule
// and ResourceLoaderFileModule::getDefinitionSummary().
- const BLANK_VERSION = '09p30q0';
+ const BLANK_VERSION = '9p30q';
+ // Result of ResoureLoader::makeVersionQuery() for a blank file module.
+ // In other words, result of ResourceLoader::makeHash( BLANK_VERSION );
+ const BLANK_COMBI = 'rbml8';
/**
* @param array|string $options Language code or options array
protected $type = ResourceLoaderModule::LOAD_GENERAL;
protected $targets = [ 'phpunit' ];
protected $shouldEmbed = null;
+ protected $mayValidateScript = false;
public function __construct( $options = [] ) {
foreach ( $options as $key => $value ) {
}
public function getScript( ResourceLoaderContext $context ) {
- return $this->validateScriptFile( 'input', $this->script );
+ 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;
+ }
}
public function getStyles( ResourceLoaderContext $context ) {