remove fallback prop name. comments.

This commit is contained in:
Christopher Jeffrey 2013-02-25 00:40:46 -06:00
parent 7f99d7a8e1
commit edf2dfa5dc
1 changed files with 6 additions and 16 deletions

View File

@ -113,7 +113,7 @@ Tput.prototype.parseTerminfo = function(data) {
l = i + h.boolCount;
o = 0;
for (; i < l; i++) {
v = Tput.bools[o++] || 'OFFSET: ' + (o - 1);
v = Tput.bools[o++];
info.bools[v] = !!data[i];
}
@ -128,7 +128,7 @@ Tput.prototype.parseTerminfo = function(data) {
l = i + h.numCount * 2;
o = 0;
for (; i < l; i += 2) {
v = Tput.numbers[o++] || 'OFFSET: ' + (o - 1);
v = Tput.numbers[o++];
if (data[i + 1] === 0377 && data[i] === 0377) {
info.numbers[v] = -1;
} else {
@ -141,7 +141,7 @@ Tput.prototype.parseTerminfo = function(data) {
l = i + h.strCount * 2;
o = 0;
for (; i < l; i += 2) {
v = Tput.strings[o++] || 'OFFSET: ' + (o - 1);
v = Tput.strings[o++];
if (data[i + 1] === 0377 && data[i] === 0377) {
info.strings[v] = -1;
} else {
@ -416,10 +416,6 @@ Tput.prototype.compile = function(key) {
}
});
// Tput.bools.concat(Tput.numbers).concat(Tput.strings).forEach(function(key) {
// if (!self.methods[key]) self.methods[key] = noop;
// });
Object.keys(self.methods).forEach(function(key) {
if (typeof self.methods[key] !== 'function') {
self[key] = self.methods[key];
@ -438,23 +434,17 @@ Tput.prototype._compile = function(val) {
switch (typeof val) {
case 'boolean':
return val;
// return function() {
// return val ? 'true' : 'false';
// };
case 'number':
return val;
// return function() {
// return val === -1 ? null : val;
// };
case 'string':
break;
default:
return function() {};
}
//if (!val) {
// return noop;
//}
if (!val) {
return noop;
}
var code = 'var v, dyn = {}, stat = {}, stack = [], out = [];'
, buff = ''