mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
ESLint one-var, no-var rules (#3239)
* fixed issues for eslint one-var and no-var rules Co-authored-by: Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
@ -67,7 +67,7 @@ define(['EventEmitter'], function (EventEmitter) {
|
||||
* @private
|
||||
*/
|
||||
LocalClock.prototype.tick = function () {
|
||||
var now = Date.now();
|
||||
const now = Date.now();
|
||||
this.emit("tick", now);
|
||||
this.lastTick = now;
|
||||
this.timeoutHandle = setTimeout(this.tick.bind(this), this.period);
|
||||
@ -81,7 +81,7 @@ define(['EventEmitter'], function (EventEmitter) {
|
||||
* @returns {function} a function for deregistering the provided listener
|
||||
*/
|
||||
LocalClock.prototype.on = function (event) {
|
||||
var result = EventEmitter.prototype.on.apply(this, arguments);
|
||||
const result = EventEmitter.prototype.on.apply(this, arguments);
|
||||
|
||||
if (this.listeners(event).length === 1) {
|
||||
this.start();
|
||||
@ -98,7 +98,7 @@ define(['EventEmitter'], function (EventEmitter) {
|
||||
* @returns {function} a function for deregistering the provided listener
|
||||
*/
|
||||
LocalClock.prototype.off = function (event) {
|
||||
var result = EventEmitter.prototype.off.apply(this, arguments);
|
||||
const result = EventEmitter.prototype.off.apply(this, arguments);
|
||||
|
||||
if (this.listeners(event).length === 0) {
|
||||
this.stop();
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
define(["./LocalClock"], function (LocalClock) {
|
||||
describe("The LocalClock class", function () {
|
||||
var clock,
|
||||
mockTimeout,
|
||||
timeoutHandle = {};
|
||||
let clock;
|
||||
let mockTimeout;
|
||||
const timeoutHandle = {};
|
||||
|
||||
beforeEach(function () {
|
||||
mockTimeout = jasmine.createSpy("timeout");
|
||||
@ -35,7 +35,7 @@ define(["./LocalClock"], function (LocalClock) {
|
||||
});
|
||||
|
||||
it("calls listeners on tick with current time", function () {
|
||||
var mockListener = jasmine.createSpy("listener");
|
||||
const mockListener = jasmine.createSpy("listener");
|
||||
clock.on('tick', mockListener);
|
||||
clock.tick();
|
||||
expect(mockListener).toHaveBeenCalledWith(jasmine.any(Number));
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
define(['./UTCTimeSystem'], function (UTCTimeSystem) {
|
||||
describe("The UTCTimeSystem class", function () {
|
||||
var timeSystem,
|
||||
mockTimeout;
|
||||
let timeSystem;
|
||||
let mockTimeout;
|
||||
|
||||
beforeEach(function () {
|
||||
mockTimeout = jasmine.createSpy("timeout");
|
||||
|
@ -33,7 +33,7 @@ define([
|
||||
*/
|
||||
return function () {
|
||||
return function (openmct) {
|
||||
var timeSystem = new UTCTimeSystem();
|
||||
const timeSystem = new UTCTimeSystem();
|
||||
openmct.time.addTimeSystem(timeSystem);
|
||||
openmct.time.addClock(new LocalClock(100));
|
||||
};
|
||||
|
Reference in New Issue
Block a user