expr may be null

This commit is contained in:
tophf 2018-01-07 18:59:31 +03:00
parent b659dde35d
commit acbb69e5ad

View File

@ -4866,7 +4866,7 @@ self.parserlib = (() => {
const token = stream._token; const token = stream._token;
token.expr = this._expr(inFunction); token.expr = this._expr(inFunction);
stream.mustMatch(Tokens.type(token.endChar)); stream.mustMatch(Tokens.type(token.endChar));
return finalize(token, token.value + token.expr.text + token.endChar); return finalize(token, token.value + (token.expr || '') + token.endChar);
} }
return finalize( return finalize(
@ -4897,10 +4897,10 @@ self.parserlib = (() => {
const start = stream._token; const start = stream._token;
const name = start.value.slice(0, -1); const name = start.value.slice(0, -1);
const expr = this._expr(lower(name)) || ''; const expr = this._expr(lower(name));
const ieFilter = this.options.ieFilters && stream.peek() === Tokens.EQUALS ? const ieFilter = this.options.ieFilters && stream.peek() === Tokens.EQUALS ?
this._functionIeFilter() : ''; this._functionIeFilter() : '';
const text = name + '(' + expr + ieFilter + ')'; const text = name + '(' + (expr || '') + ieFilter + ')';
stream.mustMatch(Tokens.RPAREN); stream.mustMatch(Tokens.RPAREN);
this._ws(); this._ws();