else
blocks JS-005613 return val.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4");
14 } else if (val.length === CNPJ_LENGTH) {
15 return val.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, "$1.$2.$3/$4-$5");
16 } else {17 return val;18 }19}
20
21/* Adding an event listener to the input field with the id of cpf_cnpj. When the value of the input
42 // Check the hashCode method really has returned a string
43 hashCode = obj.hashCode();
44 return (typeof hashCode == STRING) ? hashCode : hashObject(hashCode);
45 } else { 46 return toStr(obj); 47 } 48 }
49
50 function merge(o1, o2) {
138 return "%m/%d %H";
139 } else if (granularity >= MINUTE_MS) {
140 return "%d %H:%M";
141 } else {142 return "%H:%M:%S";143 }144}
145
146/*
167 if (str.length > 0 && str[0] === quoteChar && str[str.length - 1] === quoteChar)
168 return str.slice(1, str.length - 1);
169 else
170 return str;171};
172
173/*
When a if
block contains a return
statement, the else
block becomes unnecessary.
Its contents can be placed outside of the block.
function foo() {
if (x) {
return y;
} else {
return z;
}
}
function foo() {
if (x) {
return y;
} else if (z) {
return w;
} else {
return t;
}
}
function foo() {
if (x) {
return y;
} else {
var t = "foo";
}
return t;
}
function foo() {
if (error) {
return 'It failed';
} else {
if (loading) {
return "It's still loading";
}
}
}
// Two warnings for nested occurrences
function foo() {
if (x) {
if (y) {
return y;
} else {
return x;
}
} else {
return z;
}
}
function foo() {
if (x) {
return y;
}
return z;
}
function foo() {
if (x) {
return y;
} else if (z) {
var t = "foo";
} else {
return w;
}
}
function foo() {
if (x) {
if (z) {
return y;
}
} else {
return z;
}
}
function foo() {
if (error) {
return 'It failed';
} else if (loading) {
return "It's still loading";
}
}