All files / src/ast/literal null-literal.ts

100% Statements 14/14
100% Branches 3/3
100% Functions 3/3
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  1x 1x 1x   1x 1x 2968x 2968x   1x 2949x 2949x   1x 18x 18x 1x  
import type { ExpressionState } from '../../expression-state.js';
import { TypedValue } from '../../typed-value.js';
import { Literal } from '../spel-node.js';
import { NodeType } from '../../language/node-type.js';
 
export class NullLiteral extends Literal {
  constructor(startPos: number, endPos: number) {
    super(NodeType.NULL_LITERAL, startPos, endPos, 'null');
  }
 
  public getValueInternal(_state: ExpressionState): TypedValue {
    return TypedValue.NULL;
  }
 
  public toStringAST(): string {
    return 'null';
  }
}