Skip to content

Commit cce8554

Browse files
author
Nir Maoz
authored
Replace js/jquery.cloudinary.js arrow functions with regular functions (#260)
1 parent 11c7336 commit cce8554

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

js/jquery.cloudinary.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,12 +1490,16 @@ var slice = [].slice,
14901490
// operators
14911491
operatorsPattern = "((" + operators + ")(?=[ _]))";
14921492
operatorsReplaceRE = new RegExp(operatorsPattern, "g");
1493-
expression = expression.replace(operatorsReplaceRE, match => Expression.OPERATORS[match]);
1493+
expression = expression.replace(operatorsReplaceRE, function (match) {
1494+
return Expression.OPERATORS[match];
1495+
});
14941496

14951497
// predefined variables
14961498
predefinedVarsPattern = "(" + Object.keys(Expression.PREDEFINED_VARS).join("|") + ")";
14971499
predefinedVarsReplaceRE = new RegExp(predefinedVarsPattern, "g");
1498-
expression = expression.replace(predefinedVarsReplaceRE, (match, p1, offset) => (expression[offset - 1] === '$' ? match : Expression.PREDEFINED_VARS[match]));
1500+
expression = expression.replace(predefinedVarsReplaceRE, function(match, p1, offset){
1501+
return (expression[offset - 1] === '$' ? match : Expression.PREDEFINED_VARS[match]);
1502+
});
14991503

15001504
return expression.replace(/[ _]+/g, '_');
15011505
};

test/spec/env/js-folder-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jasmine.getEnv().addReporter(new SpecReporter({
1616
// List of files to test
1717
const files = [
1818
{name: 'canvas-to-blob.min.js', checkSum: "33ecbe6885ad339c3a5af0cfa063810d"},
19-
{name: 'jquery.cloudinary.js', checkSum: "6510379e5fa1fb3e8b17db441b922b9b"},
19+
{name: 'jquery.cloudinary.js', checkSum: "27886431ad43cf97ca3edd2ed3f4e379"},
2020
{name: 'jquery.fileupload.js', checkSum: "4bfd85460689a29e314ddfad50c184e0"},
2121
{name: 'jquery.fileupload-image.js', checkSum: "7c40367b00f74b0c7c43bff009dde942"},
2222
{name: 'jquery.fileupload-process.js', checkSum: "840f65232eaf1619ea0aff1ab4f5e444"},

0 commit comments

Comments
 (0)