Same name and namespace in other branches
  1. 5.0.x advagg_js_minify/jsminplus.inc \JSNode 1 comment
  2. 6.0.x advagg_js_minify/jsminplus.inc \JSNode 1 comment
  3. 7.x-2.x advagg_js_compress/jsminplus.inc \JSNode 1 comment
  4. 8.x-2.x advagg_js_minify/jsminplus.inc \JSNode 1 comment
  5. 8.x-3.x advagg_js_minify/jsminplus.inc \JSNode 1 comment
  6. 8.x-4.x advagg_js_minify/jsminplus.inc \JSNode 1 comment

Hierarchy

Expanded class hierarchy of JSNode

File

advagg_js_compress/jsminplus.inc, line 1781

View source
class JSNode {
    private $type;
    private $value;
    private $lineno;
    private $start;
    private $end;
    public $treeNodes = array();
    public $funDecls = array();
    public $varDecls = array();
    public function __construct($t, $type = 0) {
        if ($token = $t->currentToken()) {
            $this->type = $type ? $type : $token->type;
            $this->value = $token->value;
            $this->lineno = $token->lineno;
            $this->start = $token->start;
            $this->end = $token->end;
        }
        else {
            $this->type = $type;
            $this->lineno = $t->lineno;
        }
        if (($numargs = func_num_args()) > 2) {
            $args = func_get_args();
            for ($i = 2; $i < $numargs; $i++) {
                $this->addNode($args[$i]);
            }
        }
    }
    // we don't want to bloat our object with all kind of specific properties, so we use overloading
    public function __set($name, $value) {
        $this->{$name} = $value;
    }
    public function __get($name) {
        if (isset($this->{$name})) {
            return $this->{$name};
        }
        return null;
    }
    public function addNode($node) {
        if ($node !== null) {
            if ($node->start < $this->start) {
                $this->start = $node->start;
            }
            if ($this->end < $node->end) {
                $this->end = $node->end;
            }
        }
        $this->treeNodes[] = $node;
    }

}

Members

Title Sort descending Modifiers Object type Summary
JSNode::$end private property
JSNode::$funDecls public property
JSNode::$lineno private property
JSNode::$start private property
JSNode::$treeNodes public property
JSNode::$type private property
JSNode::$value private property
JSNode::$varDecls public property
JSNode::addNode public function
JSNode::__construct public function
JSNode::__get public function
JSNode::__set public function