From 946b311e5652b1e29e10a0d26668c081b9c6b69a Mon Sep 17 00:00:00 2001 From: RTLcoil Date: Sat, 11 Apr 2020 15:55:52 +0300 Subject: [PATCH] Fix `normalize_expression` to ignore predefined variables --- js/jquery.cloudinary.js | 2 +- src/expression.js | 2 +- test/spec/transformation-spec.js | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/js/jquery.cloudinary.js b/js/jquery.cloudinary.js index 9def7cf7..5cb37be2 100644 --- a/js/jquery.cloudinary.js +++ b/js/jquery.cloudinary.js @@ -1487,7 +1487,7 @@ var slice = [].slice, } expression = String(expression); operators = "\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*"; - pattern = "((" + operators + ")(?=[ _])|" + Object.keys(Expression.PREDEFINED_VARS).join("|") + ")"; + pattern = "((" + operators + ")(?=[ _])|(?=|<=|&&|!=|>|=|<|/|-|\\+|\\*"; - pattern = "((" + operators + ")(?=[ _])|" + Object.keys(Expression.PREDEFINED_VARS).join("|") + ")"; + pattern = "((" + operators + ")(?=[ _])|(?