summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-01 21:51:22 +0300
committerMyles Borins <mylesborins@google.com>2017-09-05 12:49:42 -0400
commit01d82d843bd6426c3c693c8bfed988c151d51609 (patch)
treecf8481cc8825ec2989040455e43391c5e7b49efb
parent7f6f1c2ddcf67b94c44db98050fc7f7df9f78d51 (diff)
downloadnode-new-01d82d843bd6426c3c693c8bfed988c151d51609.tar.gz
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>
-rw-r--r--.eslintrc.yaml3
-rw-r--r--lib/_debugger.js4
-rw-r--r--lib/repl.js3
-rw-r--r--test/parallel/test-tls-npn-server-client.js5
-rw-r--r--test/parallel/test-tls-sni-option.js5
-rw-r--r--test/parallel/test-tls-sni-server-client.js4
6 files changed, 15 insertions, 9 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml
index 0139d63a78..2b0e487567 100644
--- a/.eslintrc.yaml
+++ b/.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
diff --git a/lib/_debugger.js b/lib/_debugger.js
index d3bf1f9ffa..1d5345cde4 100644
--- a/lib/_debugger.js
+++ b/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();
diff --git a/lib/repl.js b/lib/repl.js
index 04c9ae4684..eb539cca0e 100644
--- a/lib/repl.js
+++ b/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);
diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js
index 44e9b86ad7..7cb8723ff5 100644
--- a/test/parallel/test-tls-npn-server-client.js
+++ b/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;
diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js
index ba9acbf528..e1ecfb9620 100644
--- a/test/parallel/test-tls-sni-option.js
+++ b/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;
diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js
index e47781a972..4e1ab6484c 100644
--- a/test/parallel/test-tls-sni-server-client.js
+++ b/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;