inherit tput objects properties.
This commit is contained in:
parent
f7e8cde45e
commit
983dfa943e
|
@ -54,11 +54,10 @@ function Program(options) {
|
|||
|
||||
Program.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
Program.prototype.setupTput = function(is) {
|
||||
Program.prototype.setupTput = function() {
|
||||
var self = this
|
||||
, options = this.options;
|
||||
|
||||
var write = this.write.bind(this);
|
||||
, options = this.options
|
||||
, write = this.write.bind(this);
|
||||
|
||||
var tput = this.tput = new Tput({
|
||||
term: this.terminal,
|
||||
|
@ -76,6 +75,11 @@ Program.prototype.setupTput = function(is) {
|
|||
}
|
||||
};
|
||||
|
||||
Object.keys(tput).forEach(function(key) {
|
||||
if (self[key] != null) return;
|
||||
self[key] = tput[key];
|
||||
});
|
||||
|
||||
Object.keys(tput).forEach(function(key) {
|
||||
if (typeof tput[key] !== 'function') {
|
||||
self.put[key] = tput[key];
|
||||
|
|
Loading…
Reference in New Issue