addDescription( 'Measure JavaScript syntax validation.' ); $this->addOption( 'file', 'Path to JS file. Default: jquery', false, true ); } public function execute() { $file = $this->getOption( 'file', __DIR__ . '/data/jsmin/jquery-3.2.1.js.gz' ); $content = $this->loadFile( $file ); if ( $content === false ) { $this->fatalError( 'Unable to open input file' ); } $filename = basename( $file ); $this->bench( [ "Peast::parse ($filename)" => [ 'function' => static function ( $content ) { Peast\Peast::ES2016( $content )->parse(); }, 'args' => [ $content ] ] ] ); } } // @codeCoverageIgnoreStart $maintClass = BenchmarkJsValidate::class; require_once RUN_MAINTENANCE_IF_MAIN; // @codeCoverageIgnoreEnd