diff --git a/lib/gpmclient.js b/lib/gpmclient.js index 348bb45e753047371a916190a88cf9553b8b638e..cab2ba454bed24af336014a0304e4374cf161794 100644 --- a/lib/gpmclient.js +++ b/lib/gpmclient.js @@ -190,7 +190,7 @@ function GpmClient(options) { } } -GpmClient.prototype.__proto__ = EventEmitter.prototype; +Object.setPrototypeOf(GpmClient.prototype, EventEmitter.prototype); GpmClient.prototype.stop = function() { if (this.gpm) { diff --git a/lib/program.js b/lib/program.js index 0b1e56fadcf60719ca2e5231447ad2f8ace44bda..1494b715fb8f2143505bb2b5cea053d8e2453b3e 100644 --- a/lib/program.js +++ b/lib/program.js @@ -35,7 +35,7 @@ function Program(options) { EventEmitter.call(this); - if (!options || options.__proto__ !== Object.prototype) { + if (!options || Object.getPrototypeOf(options) !== Object.prototype) { options = { input: arguments[0], output: arguments[1] @@ -151,7 +151,7 @@ Program.bind = function(program) { }); }; -Program.prototype.__proto__ = EventEmitter.prototype; +Object.setPrototypeOf(Program.prototype, EventEmitter.prototype); Program.prototype.type = 'program'; @@ -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 = diff --git a/lib/tput.js b/lib/tput.js index 2a57f58b08e797e9751983eef917c127481770d5..ddfb9b88f64829ac0db9da4a200d874a7a88b0bc 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -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] === 0o377 && data[i] === 0o377) { 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] === 0o377 && data[i] === 0o377) { 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] === 0o377 && data[i] === 0o377) { _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] === 0o377 && data[i] === 0o377) { _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'; @@ -926,7 +926,7 @@ Tput.prototype._compile = function(info, key, str) { echo('sprintf("'+ cap[0].replace(':-', '-') + '", stack.pop())'); } else if (cap[3] === 'c') { echo('(v = stack.pop(), isFinite(v) ' - + '? String.fromCharCode(v || 0200) : "")'); + + '? String.fromCharCode(v || 0o200) : "")'); } else { echo('stack.pop()'); } @@ -2094,10 +2094,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; } } @@ -2276,7 +2276,7 @@ function sprintf(src) { break; case 'c': // char param = isFinite(param) - ? String.fromCharCode(param || 0200) + ? String.fromCharCode(param || 0o200) : ''; break; }