Permalink
Browse files

-- lint

  • Loading branch information...
1 parent cdbef26 commit bfaef4bd9aff3639373b8f1d3908f6aa6834c602 @medikoo committed Sep 14, 2012
View
104 .lint
@@ -1,8 +1,102 @@
@root
+
indent 2
maxlen 80
-bitwise
-nomen
-plusplus
-tabs
-predef clearTimeout, setTimeout
+es5
+
+jslint_medikoo.tabs
+jslint_medikoo.module
+jslint_medikoo.plusplus
+
+jshint.laxcomma
+jshint.camelcase
+jshint.curly
+jshint.eqeqeq
+jshint.forin
+jshint.immed
+jshint.latedef
+jshint.newcap
+jshint.noarg
+jshint.noempty
+jshint.nonew
+jshint.regexp
+jshint.undef
+jshint.unused
+jshint.strict
+jshint.trailing
+jshint.globalstrict
+jshint.global module, require, exports
+jshint.smarttabs
+jshint.eqnull
+jshint.expr
+
+./lib/deferred.js
+jslint_medikoo.predef+ clearTimeout
+jshint.global+ clearTimeout
+jslint_medikoo.nomen
+jshint.proto
+!jshint.camelcase
+
+./lib/ext/array/map.js
+jslint_medikoo.bitwise
+
+./lib/ext/array/reduce.js
+jslint_medikoo.bitwise
+
+./lib/ext/array/some.js
+jslint_medikoo.bitwise
+
+./lib/ext/function/delay.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./lib/ext/function/promisify-sync.js
+jslint_medikoo.bitwise
+
+./lib/ext/function/promisify.js
+jslint_medikoo.bitwise
+
+./lib/monitor.js
+jslint_medikoo.predef+ console, setTimeout
+jshint.global+ console, setTimeout
+
+./lib/profiler.js
+jslint_medikoo.predef+ console
+jslint_medikoo.nomen
+jshint.global+ console
+
+./lib/promise.js
+jslint_medikoo.nomen
+jslint_medikoo.predef+ setTimeout
+jshint.proto
+!jshint.camelcase
+jshint.global+ setTimeout
+
+./test/deferred.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./test/ext/function/delay.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./test/ext/function/promisify.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./test/ext/promise/invoke-async.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./test/ext/promise/invoke.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
+
+./test/index.js
+jslint_medikoo.nomen
+jslint_medikoo.predef+ setTimeout, __dirname
+jshint.global+ setTimeout
+
+./test/monitor.js
+jslint_medikoo.predef+ setTimeout
+jshint.global+ setTimeout
View
@@ -13,7 +13,6 @@
var every = Array.prototype.every
, push = Array.prototype.push
- , getOwnPropertyNames = Object.getOwnPropertyNames
, isError = require('es5-ext/lib/Error/is-error')
, isPromise = require('./is-promise')
@@ -27,7 +26,7 @@ Deferred = function () {
Deferred.prototype = {
resolved: false,
resolve: function (value) {
- var i, name, args, data;
+ var i, name, data;
if (this.resolved) {
return this.promise;
}
@@ -92,8 +91,8 @@ Deferred.prototype = {
delete this.promise.dependencies;
}
if ((data = this.promise.pending)) {
- for (i = 0; name = data[i], args = data[++i]; ++i) {
- promise.onresolve[name].apply(this.promise, args);
+ for (i = 0; (name = data[i]); ++i) {
+ promise.onresolve[name].apply(this.promise, data[++i]);
}
delete this.promise.pending;
}
@@ -102,12 +101,12 @@ Deferred.prototype = {
};
module.exports = createDeferred = function (value) {
- var o, l, args, d, waiting, initialized, result
+ var l, d, waiting, initialized, result;
if ((l = arguments.length)) {
if (l > 1) {
d = new Deferred();
waiting = 0;
- result = new Array(arguments.length);
+ result = new Array(l);
every.call(arguments, function (value, index) {
if (isPromise(value)) {
++waiting;
@@ -1,19 +1,17 @@
'use strict';
-var isArray = Array.isArray
- , push = Array.prototype.push
- , slice = Array.prototype.slice
- , some = Array.prototype.some
- , arrayOf = require('es5-ext/lib/Array/of')
+var arrayOf = require('es5-ext/lib/Array/of')
, deferred = require('../deferred')
- , isPromise = require('../is-promise');
+ , isPromise = require('../is-promise')
+
+ , push = Array.prototype.push, slice = Array.prototype.slice;
module.exports = function (args, length) {
- var i, l, promised;
+ var i, l;
if ((length != null) && (args.length !== length)) {
args = slice.call(args, 0, length);
if (args.length < length) {
- push.apply(args, Array(length - args.length));
+ push.apply(args, new Array(length - args.length));
}
}
for (i = 0, l = args.length; i < l; ++i) {
View
@@ -12,11 +12,11 @@ var isError = require('es5-ext/lib/Error/is-error')
, every = Array.prototype.every
, call = Function.prototype.call;
-var Map = function (list, cb, context) {
+var DMap = function (list, cb, context) {
this.list = list;
this.cb = cb;
this.context = context;
- this.result = new Array(list.length >>> 0)
+ this.result = new Array(list.length >>> 0);
extend(this, deferred());
every.call(list, this.process, this);
@@ -28,7 +28,7 @@ var Map = function (list, cb, context) {
return this.promise;
};
-Map.prototype = {
+DMap.prototype = {
waiting: 0,
initialized: false,
process: function (value, index) {
@@ -90,5 +90,5 @@ module.exports = function (cb/*, thisArg*/) {
value(this);
(cb == null) || callable(cb);
- return new Map(this, cb, arguments[1]);
+ return new DMap(this, cb, arguments[1]);
};
View
@@ -3,6 +3,8 @@
// controlled with qLimit value, any calls that would reach over that limit
// would be discarded (its promise would resolve with "Too many calls" error)
+'use strict';
+
var apply = Function.prototype.apply
, max = Math.max
, toUint = require('es5-ext/lib/Number/to-uint')
@@ -29,10 +31,10 @@ module.exports = function (cLimit, qLimit) {
count = 0;
queue = [];
- run = function (thisArg, arguments, resolve) {
+ run = function (thisArg, args, resolve) {
var r;
try {
- r = apply.call(fn, thisArg, arguments);
+ r = apply.call(fn, thisArg, args);
} catch (e) {
r = e;
}
@@ -68,12 +70,12 @@ module.exports = function (cLimit, qLimit) {
};
result = function () {
- var r, d;
+ var def;
if (count >= cLimit) {
if (queue.length < qLimit) {
- d = deferred();
- queue.push([this, arguments, d.resolve]);
- return d.promise;
+ def = deferred();
+ queue.push([this, arguments, def.resolve]);
+ return def.promise;
} else {
return reject();
}
@@ -1,14 +1,14 @@
// Promisify synchronous function
-var isArray = Array.isArray
- , slice = Array.prototype.slice
- , apply = Function.prototype.apply
- , toArray = require('es5-ext/lib/Array/from')
- , callable = require('es5-ext/lib/Object/valid-callable')
+'use strict';
+
+var callable = require('es5-ext/lib/Object/valid-callable')
, deferred = require('../../deferred')
, isPromise = require('../../is-promise')
, processArguments = require('../_process-arguments')
+ , apply = Function.prototype.apply
+
, applyFn;
applyFn = function (fn, args, resolve) {
@@ -4,7 +4,7 @@
var callable = require('es5-ext/lib/Object/valid-callable')
, deferred = require('../../deferred')
- , promise = require('../../promise')
+ , promise = require('../../promise');
module.exports = function (name, ext) {
deferred.extend(name, function (cb) {
@@ -29,7 +29,6 @@ module.exports = function (name, ext) {
resolve(result);
}
}, function (cb) {
- var result;
(cb == null) || callable(cb);
if (this.failed) {
return this;
View
@@ -9,7 +9,7 @@
'use strict';
var callable = require('es5-ext/lib/Object/valid-callable')
- , deferred = require('../../deferred')
+ , deferred = require('../../deferred');
deferred.extend('aside', function (win, fail) {
(win == null) || callable(win);
View
@@ -21,9 +21,8 @@
'use strict';
var callable = require('es5-ext/lib/Object/valid-callable')
- , isCallable = require('es5-ext/lib/Object/is-callable')
, nextTick = require('next-tick')
- , deferred = require('../../deferred')
+ , deferred = require('../../deferred');
deferred.extend('cb', function (cb) {
if (cb == null) {
View
@@ -9,9 +9,9 @@
var reduce = Array.prototype.reduce
, value = require('es5-ext/lib/Object/valid-value')
, deferred = require('../../deferred')
- , promise = require('../../promise')
+ , promise = require('../../promise');
-deferred.extend('get', function (name) {
+deferred.extend('get', function (/*name*/) {
var def;
if (!this.pending) {
this.pending = [];
@@ -33,7 +33,7 @@ deferred.extend('get', function (name) {
result = e;
}
return resolve(result);
-}, function (name) {
+}, function (/*name*/) {
var result;
if (this.failed) {
return this;
Oops, something went wrong.

0 comments on commit bfaef4b

Please sign in to comment.