Skip to content

Commit 01d82d8

Browse files
vsemozhetbytMylesBorins
authored andcommitted
tools: use no-use-before-define ESLint rule
Also fix repl and url libs for the rule. PR-URL: #14032 Refs: http://eslint.org/docs/rules/no-use-before-define Reviewed-By: Daijiro Wachi <[email protected]>
1 parent 7f6f1c2 commit 01d82d8

6 files changed

+15
-9
lines changed

.eslintrc.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ rules:
6262
no-delete-var: 2
6363
no-undef: 2
6464
no-unused-vars: [2, {args: none}]
65+
no-use-before-define: [2, {classes: true,
66+
functions: false,
67+
variables: false}]
6568

6669
# Node.js and CommonJS
6770
# http://eslint.org/docs/rules/#nodejs-and-commonjs

lib/_debugger.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,8 @@ Interface.prototype.debugEval = function(code, context, filename, callback) {
992992
client.reqScopes(callback);
993993
return;
994994
}
995-
996-
var frame = client.currentFrame === NO_FRAME ? frame : undefined;
995+
var frame;
996+
frame = client.currentFrame === NO_FRAME ? frame : undefined;
997997

998998
self.pause();
999999

lib/repl.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ function complete(line, callback) {
846846
var completeOn, i, group, c;
847847

848848
// REPL commands (e.g. ".break").
849+
var filter;
849850
var match = null;
850851
match = line.match(/^\s*\.(\w*)$/);
851852
if (match) {
@@ -865,7 +866,7 @@ function complete(line, callback) {
865866

866867
completeOn = match[1];
867868
var subdir = match[2] || '';
868-
var filter = match[1];
869+
filter = match[1];
869870
var dir, files, f, name, base, ext, abs, subfiles, s;
870871
group = [];
871872
var paths = module.paths.concat(require('module').globalPaths);

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'use strict';
2+
3+
const common = require('../common');
4+
25
if (!process.features.tls_npn) {
36
common.skip('Skipping because node compiled without NPN feature of OpenSSL.');
47
return;
58
}
69

7-
const common = require('../common');
8-
910
if (!common.hasCrypto) {
1011
common.skip('missing crypto');
1112
return;

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'use strict';
2+
3+
const common = require('../common');
4+
25
if (!process.features.tls_sni) {
36
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
47
return;
58
}
69

7-
const common = require('../common');
8-
910
if (!common.hasCrypto) {
1011
common.skip('missing crypto');
1112
return;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
2+
const common = require('../common');
3+
24
if (!process.features.tls_sni) {
35
common.skip('node compiled without OpenSSL or with old OpenSSL version.');
46
return;
57
}
68

7-
const common = require('../common');
8-
99
if (!common.hasCrypto) {
1010
common.skip('missing crypto');
1111
return;

0 commit comments

Comments
 (0)