strict mode fixes

This commit is contained in:
Dan Kaplun 2016-01-03 18:32:58 -05:00
parent 1c20b8b2ee
commit 62b439ef8e
2 changed files with 12 additions and 12 deletions

View File

@ -195,7 +195,7 @@ Program.prototype.setupDump = function() {
return data.replace(/[\0\x80\x1b-\x1f\x7f\x01-\x1a]/g, function(ch) { return data.replace(/[\0\x80\x1b-\x1f\x7f\x01-\x1a]/g, function(ch) {
switch (ch) { switch (ch) {
case '\0': case '\0':
case '\200': case '\x80':
ch = '@'; ch = '@';
break; break;
case '\x1b': case '\x1b':
@ -1911,7 +1911,7 @@ Program.prototype.getCursorColor = function(callback) {
//Program.prototype.pad = //Program.prototype.pad =
Program.prototype.nul = function() { Program.prototype.nul = function() {
//if (this.has('pad')) return this.put.pad(); //if (this.has('pad')) return this.put.pad();
return this._write('\200'); return this._write('\x80');
}; };
Program.prototype.bel = Program.prototype.bel =

View File

@ -366,7 +366,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
o = 0; o = 0;
for (; i < l; i += 2) { for (; i < l; i += 2) {
v = Tput.numbers[o++]; v = Tput.numbers[o++];
if (data[i + 1] === 0377 && data[i] === 0377) { if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) {
info.numbers[v] = -1; info.numbers[v] = -1;
} else { } else {
info.numbers[v] = (data[i + 1] << 8) | data[i]; info.numbers[v] = (data[i + 1] << 8) | data[i];
@ -379,7 +379,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
o = 0; o = 0;
for (; i < l; i += 2) { for (; i < l; i += 2) {
v = Tput.strings[o++]; v = Tput.strings[o++];
if (data[i + 1] === 0377 && data[i] === 0377) { if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) {
info.strings[v] = -1; info.strings[v] = -1;
} else { } else {
info.strings[v] = (data[i + 1] << 8) | data[i]; info.strings[v] = (data[i + 1] << 8) | data[i];
@ -533,7 +533,7 @@ Tput.prototype.parseExtended = function(data) {
var _numbers = []; var _numbers = [];
l = i + h.numCount * 2; l = i + h.numCount * 2;
for (; i < l; i += 2) { for (; i < l; i += 2) {
if (data[i + 1] === 0377 && data[i] === 0377) { if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) {
_numbers.push(-1); _numbers.push(-1);
} else { } else {
_numbers.push((data[i + 1] << 8) | data[i]); _numbers.push((data[i + 1] << 8) | data[i]);
@ -544,7 +544,7 @@ Tput.prototype.parseExtended = function(data) {
var _strings = []; var _strings = [];
l = i + h.strCount * 2; l = i + h.strCount * 2;
for (; i < l; i += 2) { for (; i < l; i += 2) {
if (data[i + 1] === 0377 && data[i] === 0377) { if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) {
_strings.push(-1); _strings.push(-1);
} else { } else {
_strings.push((data[i + 1] << 8) | data[i]); _strings.push((data[i + 1] << 8) | data[i]);
@ -884,7 +884,7 @@ Tput.prototype._compile = function(info, key, str) {
ch = ':'; ch = ':';
break; break;
case '0': case '0':
ch = '\200'; ch = '\x80';
break; break;
case 'a': case 'a':
ch = '\x07'; ch = '\x07';
@ -2098,10 +2098,10 @@ Tput.prototype.detectBrokenACS = function(info) {
&& process.env.TERMCAP && process.env.TERMCAP
&& ~process.env.TERMCAP.indexOf('screen') && ~process.env.TERMCAP.indexOf('screen')
&& ~process.env.TERMCAP.indexOf('hhII00')) { && ~process.env.TERMCAP.indexOf('hhII00')) {
if (~info.strings.enter_alt_charset_mode.indexOf('\016') if (~info.strings.enter_alt_charset_mode.indexOf('\x0e')
|| ~info.strings.enter_alt_charset_mode.indexOf('\017') || ~info.strings.enter_alt_charset_mode.indexOf('\x0f')
|| ~info.strings.set_attributes.indexOf('\016') || ~info.strings.set_attributes.indexOf('\x0e')
|| ~info.strings.set_attributes.indexOf('\017')) { || ~info.strings.set_attributes.indexOf('\x0f')) {
return true; return true;
} }
} }
@ -2280,7 +2280,7 @@ function sprintf(src) {
break; break;
case 'c': // char case 'c': // char
param = isFinite(param) param = isFinite(param)
? String.fromCharCode(param || 0200) ? String.fromCharCode(param || parseInt('0200', 8))
: ''; : '';
break; break;
} }