Skip to content

Commit bb6add3

Browse files
committed
[js] Support nqp::setinputlinesep and nqp::readallfh on pipes
1 parent ddd7bf8 commit bb6add3

File tree

1 file changed

+9
-0
lines changed
  • src/vm/js/nqp-runtime

1 file changed

+9
-0
lines changed

src/vm/js/nqp-runtime/io.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ nqpIo.SyncPipe.prototype.$$can = function(method) {
2828
nqpIo.SyncPipe.prototype.$$setencoding = function(encoding) {
2929
this.encoding = core.renameEncoding(encoding);
3030
};
31+
32+
nqpIo.SyncPipe.prototype.$$setinputlinesep = function(sep) {
33+
this.seps = [sep];
34+
};
35+
36+
nqpIo.SyncPipe.prototype.$$readallfh = function() {
37+
return this.slurp().toString(this.encoding || 'utf8');
38+
};
39+
3140
function boolish(bool) {
3241
return bool ? 1 : 0;
3342
}

0 commit comments

Comments
 (0)