Skip to content

Commit

Permalink
remove "retain lines"
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmetcalf committed Feb 26, 2016
1 parent c41fa76 commit c9364ba
Show file tree
Hide file tree
Showing 53 changed files with 1,827 additions and 2,210 deletions.
1 change: 0 additions & 1 deletion build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function processFile (inputLoc, out, replacements) {
})
if (inputLoc.slice(-3) === '.js') {
const transformed = babel.transform(data, {
retainLines: true,
plugins: ['transform-es2015-arrow-functions', 'transform-es2015-block-scoping']
})
data = transformed.code
Expand Down
47 changes: 21 additions & 26 deletions lib/_stream_duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
'use strict';

/*<replacement>*/

var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {keys.push(key);}
return keys;};

for (var key in obj) {
keys.push(key);
}return keys;
};
/*</replacement>*/


module.exports = Duplex;

/*<replacement>*/
var processNextTick = require('process-nextick-args');
/*</replacement>*/



/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
Expand All @@ -35,46 +34,42 @@ util.inherits(Duplex, Readable);
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
if (!Duplex.prototype[method])
Duplex.prototype[method] = Writable.prototype[method];}

if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}

function Duplex(options) {
if (!(this instanceof Duplex))
return new Duplex(options);
if (!(this instanceof Duplex)) return new Duplex(options);

Readable.call(this, options);
Writable.call(this, options);

if (options && options.readable === false)
this.readable = false;
if (options && options.readable === false) this.readable = false;

if (options && options.writable === false)
this.writable = false;
if (options && options.writable === false) this.writable = false;

this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false)
this.allowHalfOpen = false;

this.once('end', onend);}
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;

this.once('end', onend);
}

// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended)
return;
if (this.allowHalfOpen || this._writableState.ended) return;

// no more data can be written.
// But allow more writes to happen in this tick.
processNextTick(onEndNT, this);}

processNextTick(onEndNT, this);
}

function onEndNT(self) {
self.end();}

self.end();
}

function forEach(xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);}}
f(xs[i], i);
}
}
10 changes: 5 additions & 5 deletions lib/_stream_passthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ util.inherits = require('inherits');
util.inherits(PassThrough, Transform);

function PassThrough(options) {
if (!(this instanceof PassThrough))
return new PassThrough(options);

Transform.call(this, options);}
if (!(this instanceof PassThrough)) return new PassThrough(options);

Transform.call(this, options);
}

PassThrough.prototype._transform = function (chunk, encoding, cb) {
cb(null, chunk);};
cb(null, chunk);
};
Loading

0 comments on commit c9364ba

Please sign in to comment.