Small changes to appease JSHint
This commit is contained in:
parent
26008f3ee1
commit
c0c4ce6958
|
@ -28,6 +28,9 @@
|
|||
"sinon",
|
||||
"subclass",
|
||||
"proxyTestStubs",
|
||||
"proxyFunctionsToObject"
|
||||
"proxyFunctionsToObject",
|
||||
"every",
|
||||
"hasProp",
|
||||
"bind"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace("Cylon", function() {
|
|||
//
|
||||
// Returns this.connector
|
||||
Basestar.prototype.defineAdaptorEvent = function(opts) {
|
||||
if (typeof opts === 'string') { opts = { eventName: opts } }
|
||||
if (typeof opts === 'string') { opts = { eventName: opts }; }
|
||||
|
||||
opts['source'] = this.connector;
|
||||
opts['target'] = this.connection;
|
||||
|
@ -93,7 +93,7 @@ namespace("Cylon", function() {
|
|||
//
|
||||
// Returns this.connection
|
||||
Basestar.prototype.defineDriverEvent = function(opts) {
|
||||
if (typeof opts === 'string') { opts = { eventName: opts } }
|
||||
if (typeof opts === 'string') { opts = { eventName: opts }; }
|
||||
|
||||
opts['source'] = this.connection;
|
||||
opts['target'] = this.device;
|
||||
|
|
|
@ -4,7 +4,7 @@ var os = require('os'),
|
|||
namespace("Cylon.CLI", function() {
|
||||
this.Bluetooth = (function() {
|
||||
function Bluetooth() {
|
||||
this.process = new Cylon.Process;
|
||||
this.process = new Cylon.Process();
|
||||
this.platform = os.platform();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ var os = require('os'),
|
|||
namespace('Cylon.CLI', function() {
|
||||
this.Scan = (function() {
|
||||
function Scan() {
|
||||
this.process = new Cylon.Process;
|
||||
this.process = new Cylon.Process();
|
||||
this.platform = os.platform();
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ var Cylon = (function() {
|
|||
|
||||
if (process.platform === "win32") {
|
||||
var readline = require("readline"),
|
||||
io = { input: process.stdin, output: process.stdout }
|
||||
io = { input: process.stdin, output: process.stdout };
|
||||
|
||||
readline.createInterface(io).on("SIGINT", function() {
|
||||
process.emit("SIGINT");
|
||||
|
@ -91,7 +91,7 @@ var Cylon = (function() {
|
|||
//
|
||||
// Returns the API configuration
|
||||
Master.prototype.api = function(opts) {
|
||||
if (opts == null) { opts = {} };
|
||||
if (opts == null) { opts = {}; }
|
||||
|
||||
var host = opts.host || this.api_config.host,
|
||||
port = opts.port || this.api_config.port;
|
||||
|
|
|
@ -53,7 +53,7 @@ var generateTemplateData = function() {
|
|||
basename: String(adaptorName).toLowerCase(),
|
||||
cylonVersion: pkg.version
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
var generator = function(name) {
|
||||
adaptorName = name;
|
||||
|
|
|
@ -9,7 +9,7 @@ var mocha = new Mocha({ reporter: 'spec', ui: 'bdd'});
|
|||
|
||||
function run(cb) {
|
||||
var files = grunt.file.expand(__dirname + '/../specs/**/*.spec.js');
|
||||
console.log(files)
|
||||
console.log(files);
|
||||
files.forEach(function (file) {
|
||||
mocha.addFile(file);
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
var getArgs = function(args) {
|
||||
return args.length >= 1 ? [].slice.call(args, 0) : [];
|
||||
}
|
||||
};
|
||||
|
||||
// The Logger is a global object to facilitate logging stuff to the console (or
|
||||
// other output) easily and consistently. It's available anywhere in Cylon, as
|
||||
|
@ -24,7 +24,7 @@ global.Logger = {
|
|||
//
|
||||
// Returns the new logger instance
|
||||
setup: function(logger) {
|
||||
if (logger == null) { logger = new BasicLogger; }
|
||||
if (logger == null) { logger = new BasicLogger(); }
|
||||
|
||||
if (logger === false) {
|
||||
this.logger = new NullLogger();
|
||||
|
@ -32,7 +32,7 @@ global.Logger = {
|
|||
this.logger = logger;
|
||||
}
|
||||
|
||||
return this.logger
|
||||
return this.logger;
|
||||
},
|
||||
|
||||
toString: function() { return this.logger.toString(); },
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace("Cylon", function() {
|
|||
//
|
||||
// Returns nothing
|
||||
Robot.prototype.startConnections = function(callback) {
|
||||
var starters = {}
|
||||
var starters = {};
|
||||
|
||||
Logger.info("Starting connections...");
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace("Cylon", function() {
|
|||
//
|
||||
// Returns nothing
|
||||
Robot.prototype.startDevices = function(callback) {
|
||||
var starters = {}
|
||||
var starters = {};
|
||||
|
||||
Logger.info("Starting devices...");
|
||||
|
||||
|
|
10
lib/utils.js
10
lib/utils.js
|
@ -132,12 +132,10 @@ global.proxyFunctionsToObject = function(methods, target, base, force) {
|
|||
global.proxyTestStubs = function(methods, base) {
|
||||
if (base == null) { base = this; }
|
||||
|
||||
for (var i = 0; i < methods.length; i++) {
|
||||
var method = methods[i];
|
||||
|
||||
methods.forEach(function(method) {
|
||||
base[method] = function() { return true; };
|
||||
base.commandList.push(method);
|
||||
}
|
||||
});
|
||||
|
||||
return base;
|
||||
};
|
||||
|
@ -157,8 +155,8 @@ global.proxyTestStubs = function(methods, base) {
|
|||
//
|
||||
// Returns a function wrapper
|
||||
global.bind = function(fn, me) {
|
||||
return function() { return fn.apply(me, arguments); }
|
||||
}
|
||||
return function() { return fn.apply(me, arguments); };
|
||||
};
|
||||
|
||||
// Public: Monkey-patches Number to have Rails-like //seconds() function. Warning,
|
||||
// due to the way the Javascript parser works, applying functions on numbers is
|
||||
|
|
Loading…
Reference in New Issue