Compare commits

..

No commits in common. "master" and "v1.5.1" have entirely different histories.

1 changed files with 7 additions and 13 deletions

View File

@ -31,12 +31,12 @@ class JSM
$this->args_parser = new JSM_ArgsParser();
}
function getRootFile() : string
function getRootFile()
{
return $this->file;
}
static function getModule($file) : JSM_Module
function getModule($file)
{
if(isset(self::$modules[$file]))
return self::$modules[$file];
@ -523,12 +523,7 @@ class JSM
private function _extractScriptDefs(string $file, string $txt) : string
{
$strpos = strpos($txt, 'def');
if($strpos === false)
return $txt;
//let's extra check if newline symbols preceed 'def'
if($strpos > 0 && !($txt[$strpos-1] === "\n" || $txt[$strpos-1] === "\r"))
if(strpos($txt, 'def') === false)
return $txt;
//NOTE: make it more robust
@ -683,23 +678,22 @@ class JSM
class JSM_Module
{
var string $file = '';
var $file = '';
var $defs = array();
//NOTE: all includes (even those included from other modules)
var $includes = array();
var $node = null;
function __construct(string $file)
function __construct($file)
{
$this->file = $file;
}
function getIncludes() : array
function getIncludes()
{
return $this->includes;
}
function getFile() : string
function getFile()
{
return $this->file;
}