Closed cosmos-lab closed 1 year ago
Please check the sequence:
let exp = "\"c:\\foo\\bar\""; let ast = jexl.compile(exp)._getAst(); console.log(ast) //{"type": "Literal", "value": "c:\\foo\\bar"} exp = jexlExpressionStringFromAst(jexl._grammar, ast) console.log(exp) //"c:\\foo\\bar" ast = jexl.compile(exp)._getAst(); console.log(ast) //{"type": "Literal", "value": "c:\\foo\\\\bar"} exp = jexlExpressionStringFromAst(jexl._grammar, ast) console.log(exp) //"c:\\foo\\\\bar"
If we check only first backslash is getting unescaped.
Fix: Make var escEscRegex = /\\/; to var escEscRegex = /\\/g; In Lexer.js
Please check the sequence:
If we check only first backslash is getting unescaped.
Fix: Make var escEscRegex = /\\/; to var escEscRegex = /\\/g; In Lexer.js