handled EvaluateNodes panic (#1140)

This commit is contained in:
Mikhail Katychev 2022-03-14 21:28:52 -05:00 committed by GitHub
parent 3924ed8a35
commit 406bbb8ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 4 deletions

View File

@ -22,6 +22,7 @@ type allAtOnceEvaluator struct {
}
func NewAllAtOnceEvaluator() Evaluator {
InitExpressionParser()
return &allAtOnceEvaluator{treeNavigator: NewDataTreeNavigator()}
}

View File

@ -31,7 +31,6 @@ var evaluateNodesScenario = []expressionScenario{
}
func TestAllAtOnceEvaluateNodes(t *testing.T) {
InitExpressionParser()
var evaluator = NewAllAtOnceEvaluator()
for _, tt := range evaluateNodesScenario {
node := test.ParseData(tt.document)

View File

@ -7,9 +7,7 @@ import (
)
func getExpressionParser() ExpressionParserInterface {
if ExpressionParser == nil {
ExpressionParser = newExpressionParser()
}
InitExpressionParser()
return ExpressionParser
}