Permalink
Browse files

Merge pull request #214 from dbkaplun/strict-mode-fixes

strict mode fixes
  • Loading branch information...
2 parents 1c20b8b + ba1982d commit eab243fc7ad27f1d2932db6134f7382825ee3488 @chjj committed Jan 4, 2016
Showing with 12 additions and 12 deletions.
  1. +2 −2 lib/program.js
  2. +10 −10 lib/tput.js
View
@@ -195,7 +195,7 @@ Program.prototype.setupDump = function() {
return data.replace(/[\0\x80\x1b-\x1f\x7f\x01-\x1a]/g, function(ch) {
switch (ch) {
case '\0':
- case '\200':
+ case '\x80':
ch = '@';
break;
case '\x1b':
@@ -1911,7 +1911,7 @@ Program.prototype.getCursorColor = function(callback) {
//Program.prototype.pad =
Program.prototype.nul = function() {
//if (this.has('pad')) return this.put.pad();
- return this._write('\200');
+ return this._write('\x80');
};
Program.prototype.bel =
View
@@ -366,7 +366,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
o = 0;
for (; i < l; i += 2) {
v = Tput.numbers[o++];
- if (data[i + 1] === 0377 && data[i] === 0377) {
+ if (data[i + 1] === 0xff && data[i] === 0xff) {
info.numbers[v] = -1;
} else {
info.numbers[v] = (data[i + 1] << 8) | data[i];
@@ -379,7 +379,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
o = 0;
for (; i < l; i += 2) {
v = Tput.strings[o++];
- if (data[i + 1] === 0377 && data[i] === 0377) {
+ if (data[i + 1] === 0xff && data[i] === 0xff) {
info.strings[v] = -1;
} else {
info.strings[v] = (data[i + 1] << 8) | data[i];
@@ -533,7 +533,7 @@ Tput.prototype.parseExtended = function(data) {
var _numbers = [];
l = i + h.numCount * 2;
for (; i < l; i += 2) {
- if (data[i + 1] === 0377 && data[i] === 0377) {
+ if (data[i + 1] === 0xff && data[i] === 0xff) {
_numbers.push(-1);
} else {
_numbers.push((data[i + 1] << 8) | data[i]);
@@ -544,7 +544,7 @@ Tput.prototype.parseExtended = function(data) {
var _strings = [];
l = i + h.strCount * 2;
for (; i < l; i += 2) {
- if (data[i + 1] === 0377 && data[i] === 0377) {
+ if (data[i + 1] === 0xff && data[i] === 0xff) {
_strings.push(-1);
} else {
_strings.push((data[i + 1] << 8) | data[i]);
@@ -884,7 +884,7 @@ Tput.prototype._compile = function(info, key, str) {
ch = ':';
break;
case '0':
- ch = '\200';
+ ch = '\x80';
break;
case 'a':
ch = '\x07';
@@ -2098,10 +2098,10 @@ Tput.prototype.detectBrokenACS = function(info) {
&& process.env.TERMCAP
&& ~process.env.TERMCAP.indexOf('screen')
&& ~process.env.TERMCAP.indexOf('hhII00')) {
- if (~info.strings.enter_alt_charset_mode.indexOf('\016')
- || ~info.strings.enter_alt_charset_mode.indexOf('\017')
- || ~info.strings.set_attributes.indexOf('\016')
- || ~info.strings.set_attributes.indexOf('\017')) {
+ if (~info.strings.enter_alt_charset_mode.indexOf('\x0e')
+ || ~info.strings.enter_alt_charset_mode.indexOf('\x0f')
+ || ~info.strings.set_attributes.indexOf('\x0e')
+ || ~info.strings.set_attributes.indexOf('\x0f')) {
return true;
}
}
@@ -2280,7 +2280,7 @@ function sprintf(src) {
break;
case 'c': // char
param = isFinite(param)
- ? String.fromCharCode(param || 0200)
+ ? String.fromCharCode(param || 0x80)
: '';
break;
}

0 comments on commit eab243f

Please sign in to comment.