Same name in other branches
  1. 5.0.x advagg_js_minify/jsminplus.inc \JSParser::Variables()
  2. 6.0.x advagg_js_minify/jsminplus.inc \JSParser::Variables()
  3. 7.x-1.x advagg_js_compress/jsminplus.inc \JSParser::Variables()
  4. 7.x-2.x advagg_js_compress/jsminplus.inc \JSParser::Variables()
  5. 8.x-2.x advagg_js_minify/jsminplus.inc \JSParser::Variables()
  6. 8.x-3.x advagg_js_minify/jsminplus.inc \JSParser::Variables()
1 call to JSParser::Variables()
JSParser::Statement in advagg_js_minify/jsminplus.inc

File

advagg_js_minify/jsminplus.inc, line 1278

Class

JSParser

Code

private function Variables($x) {
    $n = new JSNode($this->t);
    do {
        $this->t
            ->mustMatch(TOKEN_IDENTIFIER);
        $n2 = new JSNode($this->t);
        $n2->name = $n2->value;
        if ($this->t
            ->match(OP_ASSIGN)) {
            if ($this->t
                ->currentToken()->assignOp) {
                throw $this->t
                    ->newSyntaxError('Invalid variable initialization');
            }
            $n2->initializer = $this->Expression($x, OP_COMMA);
        }
        $n2->readOnly = $n->type == KEYWORD_CONST;
        $n->addNode($n2);
        array_push($x->varDecls, $n2);
    } while ($this->t
        ->match(OP_COMMA));
    return $n;
}