Use undefined instead of void
We originally wrote `undefined` in CoffeeScript. CoffeeScript compiled it to `void 0` when generating the JavaScript files. However, the reason to do so was the `undefined` variable was mutable before ECMAScript 5. Using `undefined` is more intuitive, and nowadays there's no reason to use `void 0`.
This commit is contained in:
@@ -36,6 +36,7 @@ rules:
|
||||
no-spaced-func: error
|
||||
no-tabs: error
|
||||
no-trailing-spaces: error
|
||||
no-void: error
|
||||
no-whitespace-before-property: error
|
||||
object-curly-spacing:
|
||||
- error
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// Generated by CoffeeScript 1.12.6
|
||||
(function() {
|
||||
"use strict";
|
||||
App.Cookies = {
|
||||
saveCookie: function(name, value, days) {
|
||||
var date, expires;
|
||||
expires = void 0;
|
||||
expires = undefined;
|
||||
if (days) {
|
||||
date = new Date;
|
||||
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
$(".js-toggle-link").unbind("click").on("click", function() {
|
||||
var toggle_txt;
|
||||
$($(this).data("toggle-selector")).toggle("down");
|
||||
if ($(this).data("toggle-text") !== void 0) {
|
||||
if ($(this).data("toggle-text") !== undefined) {
|
||||
toggle_txt = $(this).text();
|
||||
$(this).text($(this).data("toggle-text"));
|
||||
$(this).data("toggle-text", toggle_txt);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
},
|
||||
initialize: function() {
|
||||
if (App.WatchFormChanges.forms().length === 0 || App.WatchFormChanges.msg() === void 0) {
|
||||
if (App.WatchFormChanges.forms().length === 0 || App.WatchFormChanges.msg() === undefined) {
|
||||
return;
|
||||
}
|
||||
$(document).off("page:before-change").on("page:before-change", App.WatchFormChanges.checkChanges);
|
||||
|
||||
Reference in New Issue
Block a user