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