inherit tput objects properties.

This commit is contained in:
Christopher Jeffrey 2013-02-27 12:22:31 -06:00
parent f7e8cde45e
commit 983dfa943e
1 changed files with 8 additions and 4 deletions

View File

@ -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];