We will set the script into assets array.

@param $src
@param $attributes
160654
private function setScript($src, $attributes)
    {
        $this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
            static::$script.'
                    src="'.Url::getBase().$src.'"'.$this->addAttributes($attributes).'></script>'.PHP_EOL;
    }
73237
private function loadAssetsFromDir($href, $attr, $title, $type = 'style')
    {
        $path = str_replace('\\', '/', $href);
        $assets = glob($path.'*');

        foreach ($assets as $src) {
            ($type == 'style') ? $this->setStyle($attr, $src, $title) : $this->setScript($src, $attr);
        }
    }
74884
protected function setUnfillableAttributes(array $attributes = [])
    {
        if ( ! empty( $attributes )) {
            $keysToFill = array_diff(array_keys($attributes), $this->fillable);
            foreach ($keysToFill as $key) {
                $this->setAttribute($key, $attributes[$key]);
            }
        }
    }
185975
public function setAttributes($attributes) {
        $this->setVariable(self::ATTRIBUTES, "");
        foreach($attributes as $name => $value) {
            $this->addAttribute($name, $value);
        }
    }
74039
public function addAttributes($attributes, $html = [])
    {
        if (!empty($attributes)) {
            foreach ($attributes as $key => $value) {
                if (!is_null($value)) {
                    $html[] = $key.'="'.Html::entities($value).'"';
                }
            }
        }

        return (count($html) > 0) ? ' '.implode(' ', $html) : '';
    }
1129147
public function tfoot(array $attributes = []): void
    {
        $this->tableArray[] = Tags::tfoot($this->trArray, $attributes);
        $this->trArray = [];
    }
592351
protected function AssignFrom( $src )
	{
		$this->context = $src->context;
		$this->typeTest = $src->typeTest;
		$this->nameTest = $src->nameTest;
		$this->matchSelf = $src->matchSelf;
		$this->iter = $src->iter->CloneInstance();
	}
1279330
public static function img($src, $alt = '', array $attributes = [])
    {
        $attributes = array_merge([
            'src' => $src,
            'alt' => $alt
        ], $attributes);

        return self::tag('img', $attributes);
    }
438962
public static function script(
        string $content, 
        array $attributes = ["type" => "text/javascript"],
        bool $addCdataTag = true
    ) : string
    {
        if ($addCdataTag) {
            $content = "\n//<![CDATA[\n" . $content ."\n//]]>\n";
        }
        return self::tag("script", $content, $attributes);
    }
424218
public function setAttributeArray(array $attributes = null)
    {
        if (!is_array($attributes) || empty($attributes)) {
            return;
        }

        foreach ($attributes as $name => $value) {
            $this->setAttribute($name, $value);
        }
    }
522361
public function addCss($name, $attributes = [])
    {
        if (is_array($name)) {
            $name = $this->combineAssets($name, $this->getLocalPath($this->assetPath));
        }

        $cssPath = $this->getAssetPath($name);

        if (isset($this->controller)) {
            $this->controller->addCss($cssPath, $attributes);
        }

        if (is_string($attributes)) {
            $attributes = ['build' => $attributes];
        }

        $cssPath = $this->getAssetScheme($cssPath);

        if (!in_array($cssPath, $this->assets['css'])) {
            $this->assets['css'][] = ['path' => $cssPath, 'attributes' => $attributes];
        }
    }
993820
public function script($url, $attributes = [], $secure = null)
    {
        $attributes['src'] = $this->url->asset($url, $secure);
        return '<script' . $this->attributes($attributes) . '></script>' . PHP_EOL;
    }
682999
public function fill($attributes)
    {
        // Some context types have varying types
        if ($this->hasGetMutator('type')) {
            $this->type = $this->mutateAttribute('type', $this->getArrValue($attributes, 'type', $this->type));
        }

        // Set properties
        $properties = array_merge([
            '@context' => 'http://schema.org',
            '@type' => $this->type,
            'sameAs' => null
        ], $this->structure, $this->extendStructure);

        // Set properties from attributes
        foreach ($properties as $key => $property) {
            $this->setProperty($key, $property, $this->getArrValue($attributes, $key, ''));
        }

        // After fill event
        $this->afterFill($attributes);
    }
339819
public function setTableAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->tableAttributes[$attribute] = $value;
        }

        return $this;
    }
347212
public function set_assets() {

		$this->assets['script'][ $this->type ] = $this->url . 'assets/js/' . $this->type . UIX_ASSET_DEBUG . '.js';
		$this->assets['style'][ $this->type ]  = $this->url . 'assets/css/' . $this->type . UIX_ASSET_DEBUG . '.css';

		parent::set_assets();

	}
1200038
public function renderJs($assets, $group, $attributes = [])
    {
        // temporary list of assets to pipeline
        $inline_group = false;

        if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
            $inline_group = true;
            unset($attributes['loading']);
        }

        // Store Attributes
        $this->attributes = $attributes;

        // Compute uid based on assets and timestamp
        $json_assets = json_encode($assets);
        $uid = md5($json_assets . $this->js_minify . $group);
        $file = $uid . '.js';
        $relative_path = "{$this->base_url}{$this->assets_url}/{$file}";

        $buffer = null;

        if (file_exists($this->assets_dir . $file)) {
            $buffer = file_get_contents($this->assets_dir . $file) . "\n";
        } else {
            //if nothing found get out of here!
            if (empty($assets)) {
                return false;
            }

            // Concatenate files
            $buffer = $this->gatherLinks($assets, self::JS_ASSET);

            // Minify if required
            if ($this->shouldMinify('js')) {
                $minifier = new \MatthiasMullie\Minify\JS();
                $minifier->add($buffer);
                $buffer = $minifier->minify();
            }

            // Write file
            if (trim($buffer) !== '') {
                file_put_contents($this->assets_dir . $file, $buffer);
            }
        }

        if ($inline_group) {
            $output = '<script' . $this->renderAttributes(). ">\n" . $buffer . "\n</script>\n";
        } else {
            $this->asset = $relative_path;
            $output = '<script src="' . $relative_path . $this->renderQueryString() . '"' . $this->renderAttributes() . "></script>\n";
        }

        return $output;
    }
857334
public function generateScripts(array $attributes = null)
    {
        $init = <<<EOD
           $(document).ready(function(){
                container=$('div.%s');                                     
                form=$('#%s');
                cancelButton=form.find('button.cancel-request');
                submitButton=form.find('button:submit');
                var xhrPool = [];
                $(document).ajaxSend(function (e, jqXHR, options) {
                    xhrPool.push(jqXHR);
                });
                $(document).ajaxComplete(function (e, jqXHR, options) {
                    xhrPool = $.grep(xhrPool, function (x) {
                        return x != jqXHR
                    });
                });
                var abort = function () {
                    $.each(xhrPool, function (idx, jqXHR) {
                        jqXHR.abort();
                    });
                    cancelButton.attr('disabled','disabled').addClass('btn-disabled');
                    submitButton.removeAttr('disabled').removeClass('btn-disabled');
                };
                var processStop = function () {
                    abort();                    
                }
                $.fn.analyzeSpecAjax = function (key) {
                    $.when(
                        $.ajax({                            
                            url: "%s",
                            type: "POST",
                            data: indexes[key],
                            beforeSend: function (element) {
                                $('div.test-response').append('<hr/>'+indexes[key].message);               
                            }
                        })
                    ).then(function (data, textStatus, jqXHR) {                        
                        $('div.test-response').append(data);
                        if(indexes[key+1]!==undefined){
                            $.fn.analyzeSpecAjax(key+1);                            
                        }else{
                            processStop();                            
                        }
                    });
                };
                var indexes={};
                form.on('click', 'button:submit', function (e) {                                        
                    handler=$(this).parents('form:first');
                    
                    $.ajax({
                       url:handler.attr('action'),
                       data:handler.serialize(),
                       type:'POST',
                       dataType:'json',
                       success:function(response,element,status){
                           
                           $('div.test-response').html(''); 
                           indexes=response;       
                           cancelButton.removeAttr('disabled').removeClass('btn-disabled');
                           submitButton.attr('disabled','disabled').addClass('btn-disabled');
                           $.fn.analyzeSpecAjax(0);                           
                       },
                       error:function(eResponse){
                           obj = jQuery.parseJSON(eResponse.responseText);
                           $('div.test-response').html('');                                               
                           for(var i=0;i<obj.length;i++){                                                              
                               $('div.test-response').append(obj[i].error);               
                           }                                                      
                       }
                    });                    
                    return false;
                });
                form.on('click', '.cancel-request', function (e) {                                        
                    processStop();
                    return false;
                });
                form.find('.test-checkboxes').on('ifChecked',function(e){
                    form.find('input:checkbox').iCheck('check');
                    processStop();
                    return true;                    
                });
                
                 form.find('.test-checkboxes').on('ifUnchecked',function(e){
                    form.find('input:checkbox').iCheck('uncheck'); 
                    processStop();
                    return true;                    
                });
                
            });
EOD;
        return sprintf($init, $attributes['response-container'], $attributes['form-container'], handles('antares::tools/tester/run', ['csrf' => true]));
    }