Fix no-cond-assign in ES5

[MAILPOET-1033]
This commit is contained in:
Pavel Dohnal
2017-08-16 10:39:43 +02:00
parent 7725391eff
commit 89b51b6215
3 changed files with 6 additions and 4 deletions

View File

@@ -35,7 +35,6 @@
"new-cap": 0, "new-cap": 0,
"no-continue": 0, "no-continue": 0,
"no-new": 0, "no-new": 0,
"no-cond-assign": 0,
"space-unary-ops": 0, "space-unary-ops": 0,
"no-redeclare": 0, "no-redeclare": 0,
"no-console": 0, "no-console": 0,

View File

@@ -143,7 +143,8 @@ define('date',
var convertedFormat = []; var convertedFormat = [];
var escapeToken = false; var escapeToken = false;
for(var index = 0, token = ''; token = format.charAt(index); index++){ for(var index = 0, token = ''; format.charAt(index); index += 1){
token = format.charAt(index);
if (escapeToken === true) { if (escapeToken === true) {
convertedFormat.push('['+token+']'); convertedFormat.push('['+token+']');
escapeToken = false; escapeToken = false;

View File

@@ -315,11 +315,13 @@ define(
// remove urlencoded characters // remove urlencoded characters
.replace(/\s+|%\d+|,+/g, ''); .replace(/\s+|%\d+|,+/g, '');
// detect e-mails that will be otherwise rejected by email regex // detect e-mails that will be otherwise rejected by email regex
if (test = /<(.*?)>/.exec(email)) { test = /<(.*?)>/.exec(email);
if (test) {
// is the email inside angle brackets (e.g., 'some@email.com <some@email.com>')? // is the email inside angle brackets (e.g., 'some@email.com <some@email.com>')?
email = test[1].trim(); email = test[1].trim();
} }
if (test = /mailto:(?:\s+)?(.*)/.exec(email)) { test = /mailto:(?:\s+)?(.*)/.exec(email);
if (test) {
// is the email in 'mailto:email' format? // is the email in 'mailto:email' format?
email = test[1].trim(); email = test[1].trim();
} }