Browse Source

tools: use no-use-before-define ESLint rule

Also fix repl and url libs for the rule.

PR-URL: https://github.com/nodejs/node/pull/14032
Refs: http://eslint.org/docs/rules/no-use-before-define
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
v6.x
Vse Mozhet Byt 8 years ago
committed by Myles Borins
parent
commit
01d82d843b
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 3
      .eslintrc.yaml
  2. 4
      lib/_debugger.js
  3. 3
      lib/repl.js
  4. 5
      test/parallel/test-tls-npn-server-client.js
  5. 5
      test/parallel/test-tls-sni-option.js
  6. 4
      test/parallel/test-tls-sni-server-client.js

3
.eslintrc.yaml

@ -62,6 +62,9 @@ rules:
no-delete-var: 2
no-undef: 2
no-unused-vars: [2, {args: none}]
no-use-before-define: [2, {classes: true,
functions: false,
variables: false}]
# Node.js and CommonJS
# http://eslint.org/docs/rules/#nodejs-and-commonjs

4
lib/_debugger.js

@ -992,8 +992,8 @@ Interface.prototype.debugEval = function(code, context, filename, callback) {
client.reqScopes(callback);
return;
}
var frame = client.currentFrame === NO_FRAME ? frame : undefined;
var frame;
frame = client.currentFrame === NO_FRAME ? frame : undefined;
self.pause();

3
lib/repl.js

@ -846,6 +846,7 @@ function complete(line, callback) {
var completeOn, i, group, c;
// REPL commands (e.g. ".break").
var filter;
var match = null;
match = line.match(/^\s*\.(\w*)$/);
if (match) {
@ -865,7 +866,7 @@ function complete(line, callback) {
completeOn = match[1];
var subdir = match[2] || '';
var filter = match[1];
filter = match[1];
var dir, files, f, name, base, ext, abs, subfiles, s;
group = [];
var paths = module.paths.concat(require('module').globalPaths);

5
test/parallel/test-tls-npn-server-client.js

@ -1,11 +1,12 @@
'use strict';
const common = require('../common');
if (!process.features.tls_npn) {
common.skip('Skipping because node compiled without NPN feature of OpenSSL.');
return;
}
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;

5
test/parallel/test-tls-sni-option.js

@ -1,11 +1,12 @@
'use strict';
const common = require('../common');
if (!process.features.tls_sni) {
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
return;
}
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;

4
test/parallel/test-tls-sni-server-client.js

@ -1,11 +1,11 @@
'use strict';
const common = require('../common');
if (!process.features.tls_sni) {
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
return;
}
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;

Loading…
Cancel
Save