11736 endSize: u,
11737 property: o,
11738 speed: i,
11739 callback: function () {11740 if (
11741 (n[0].AUtoggleInteration++,
11742 n[0].AUtoggleInteration === n[0].AUinterations)
11684 ? (r.AUtoggleState = "closing")
11685 : u.stepSize > 0 && (r.AUtoggleState = "opening"),
11686 (function (t, i, a, r, l) {
11687 t.AUanimation = setInterval(function () {11688 if (i === l || 0 === r.steps) {
11689 if (
11690 (e.animate.Stop(t),
11291 );
11292 case "select":
11293 return (
11294 t.find("option").each(function (e) {11295 if (
11296 ((this.selected = this.defaultSelected),
11297 this.defaultSelected && !t[0].multiple)
10456 case "state":
10457 case "custom":
10458 $.get($element.find(".js-webform-message__link").attr("href"));
10459 return true;10460 }
10461 }
10462})(jQuery, Drupal);
9383 .concat(this.options.url, ": ")
9384 .concat(e.message),
9385 );
9386 return $.Deferred().reject(); 9387 }
9388 };
9389
Any code paths that do not have explicit returns will return undefined
.
It is recommended to replace any implicit dead-ends that return undefined
with a return null
statement.
As a convention, undefined
signals that an unexpected value has been produced as the
result of a logical error in the program.
A null
return, on the other hand, signals that the input to a function was incorrect,
or a value was 'not found'.
Having this distinction in code helps you figure out if something was caused because of a logical error, or malformed input to a function call.
function getUser(name) {
if (userExists(name)) {
return userDb.get(name);
}
// whoops! Implicit undefined return
}
function readFile(fileName) {
if (fs.existsSync(fileName)) {
return fs.readFileSync(fileName, 'utf-8');
}
return; // Implicit undefined return.
}
function getUser(name) {
if (userExists(name)) {
return userDb.get(name);
}
// `null` indicates there is no such user.
return null;
}
function readFile(fileName) {
if (fs.existsSync(fileName)) {
return fs.readFileSync(fileName, 'utf-8');
}
// `null` indicates there is no such file.
return null;
}