25require_once __DIR__ .
'/../includes/Benchmarker.php';
40 parent::__construct();
42 $this->
addOption(
'file',
'Path to JS file. Default: jquery',
false,
true );
46 $file = $this->
getOption(
'file', __DIR__ .
'/data/jsmin/jquery-3.2.1.js.gz' );
48 if ( $content ===
false ) {
49 $this->
fatalError(
'Unable to open input file' );
52 $filename = basename( $file );
55 "Peast::parse ($filename)" => [
56 'function' =>
static function ( $content ) {
57 Peast\Peast::ES2016( $content )->parse();
59 'args' => [ $content ]
67require_once RUN_MAINTENANCE_IF_MAIN;
Measure ResourceLoader syntax validation for user-supplied JavaScript.
execute()
Do the actual work.
__construct()
Default constructor.
Base class for benchmark scripts.
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
getOption( $name, $default=null)
Get an option, or return the default.
addDescription( $text)
Set the description text.