partial lint fixes

This commit is contained in:
Vitaly Puzrin 2014-02-03 17:30:44 +04:00
parent fa5b9ffac9
commit 98df9f4f3d
3 changed files with 38 additions and 23 deletions

View file

@ -1,4 +1,4 @@
.git/ .git/
node_modules/ node_modules/
lib/ benchmark/implementations
/benchmark/implementations lib/zlib

View file

@ -38,30 +38,35 @@ fs.readdirSync(SAMPLES_DIRECTORY).sort().forEach(function (sample) {
content = new Uint8Array(fs.readFileSync(filepath)), content = new Uint8Array(fs.readFileSync(filepath)),
title = util.format('%s (%d bytes)', sample, content.length); title = util.format('%s (%d bytes)', sample, content.length);
function onStart() {
console.log('\nSample: %s', this.name);
}
function onCycle(event) {
cursor.horizontalAbsolute();
cursor.eraseLine();
cursor.write(' > ' + event.target);
}
function onComplete() { function onComplete() {
cursor.write('\n'); cursor.write('\n');
} }
var suite = new Benchmark.Suite(title, { var suite = new Benchmark.Suite(title, {
onStart: onStart,
onStart: function onStart() {
console.log('\nSample: %s', sample);
},
onComplete: onComplete onComplete: onComplete
}); });
IMPLS.forEach(function (impl) { IMPLS.forEach(function (impl) {
suite.add(impl.name, { suite.add(impl.name, {
onCycle: onCycle,
onCycle: function onCycle(event) {
cursor.horizontalAbsolute();
cursor.eraseLine();
cursor.write(' > ' + event.target);
},
onComplete: onComplete, onComplete: onComplete,
defer: !!impl.code.async, defer: !!impl.code.async,
fn: function (deferred) { fn: function (deferred) {
if (!!impl.code.async) { if (!!impl.code.async) {
impl.code.run(content, function() { impl.code.run(content, function() {
@ -76,6 +81,7 @@ fs.readdirSync(SAMPLES_DIRECTORY).sort().forEach(function (sample) {
}); });
}); });
SAMPLES.push({ SAMPLES.push({
name: basename, name: basename,
title: title, title: title,
@ -117,7 +123,7 @@ function run(files) {
console.log(' > %s', sample.name); console.log(' > %s', sample.name);
}); });
} else { } else {
console.log("There isn't any sample matches any of these patterns: %s", util.inspect(files)); console.log('There isn\'t any sample matches any of these patterns: %s', util.inspect(files));
} }
selected.forEach(function (sample) { selected.forEach(function (sample) {

View file

@ -1,4 +1,9 @@
'use strict';
var zlib = require('zlib/deflate.js'); var zlib = require('zlib/deflate.js');
/** /**
* Deflate * Deflate
* *
@ -7,7 +12,8 @@ var zlib = require('zlib/deflate.js');
*/ */
var Deflate = function(options) { var Deflate = function(options) {
} };
/** /**
* Compresses the input data and fills output buffer with compressed data. * Compresses the input data and fills output buffer with compressed data.
@ -15,26 +21,28 @@ var Deflate = function(options) {
*/ */
Deflate.prototype.deflate = function(input) { Deflate.prototype.deflate = function(input) {
} };
Deflate.prototype.flush = function() { Deflate.prototype.flush = function() {
} };
Deflate.prototype.finish = function() { Deflate.prototype.finish = function() {
} };
Deflate.prototype.onData = function(output) { Deflate.prototype.onData = function(output) {
} };
Deflate.prototype.onEnd = function(error) { Deflate.prototype.onEnd = function(error) {
} };
exports.Deflate = Deflate; exports.Deflate = Deflate;
/** /**
* Compresses the input data * Compresses the input data
* @param input * @param input
@ -43,8 +51,9 @@ exports.Deflate = Deflate;
*/ */
exports.deflate = function(input, options) { exports.deflate = function(input, options) {
} };
exports.deflateRaw = function(input, options) { exports.deflateRaw = function(input, options) {
} };