Skip to content

Commit

Permalink
Fix eslint errors and run the linter in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vqvu committed Mar 29, 2015
1 parent f64cff2 commit 0c196ca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
36 changes: 18 additions & 18 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3662,14 +3662,18 @@ _.values = function (obj) {
* _.keys({foo: 1, bar: 2, baz: 3}) // => 'foo', 'bar', 'baz'
*/

_.keys = function (obj) {
var keys = [];
function keys (obj) {
var keysArray = [];
for (var k in obj) {
if (hasOwn.call(obj, k)) {
keys.push(k);
keysArray.push(k);
}
}
return _(keys);
return keysArray;
}

_.keys = function (obj) {
return _(keys(obj));
};

/**
Expand Down Expand Up @@ -3817,15 +3821,15 @@ _.log = function () {
* readFile('example.txt').apply(function (data) {
* // data is now the contents of example.txt
* });
*
*
* function Reader(file) {
* this.file = file;
* }
*
*
* Reader.prototype.read = function(cb) {
* fs.readFile(this.file, cb);
* };
*
*
* Reader.prototype.readStream = _.wrapCallback(Reader.prototype.read);
*/

Expand Down Expand Up @@ -3875,16 +3879,6 @@ var isES5 = (function () {
return Function.prototype.bind && !this;
}());

function keys (obj) {
var keys = [];
for (var k in obj) {
if (hasOwn.call(obj, k)) {
keys.push(k);
}
}
return keys;
}

function isClass (fn) {
if (!(typeof fn === 'function' && fn.prototype)) { return false; }
var getKeys = isES5 ? Object.getOwnPropertyNames : keys;
Expand Down Expand Up @@ -3915,8 +3909,14 @@ function streamifyAll (inp, suffix) {
for (var i = 0, len = allKeys.length; i < len; i++) {
var key = allKeys[i];
var val;

// will skip context aware getters
try { val = inp[key]; } catch (e) {}
try {
val = inp[key];
}
catch (e) {
}

if (val && typeof val === 'function' && !isClass(val) &&
!val.__HighlandStreamifiedFunction__) {

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
"sinon": "~1.8.2",
"stream-array": "~1.0.1",
"through": "~2.3.4",
"transducers-js": "~0.4.135"
"transducers-js": "~0.4.135",
"eslint": "~0.10.0"
},
"scripts": {
"test": "nodeunit test/test.js"
"test": "eslint Gruntfile.js lib && nodeunit test/test.js"
},
"testling": {
"files": "test/testling.js",
Expand Down

0 comments on commit 0c196ca

Please sign in to comment.