Skip to content

Commit

Permalink
tools: use no-use-before-define ESLint rule
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
vsemozhetbyt authored and MylesBorins committed Aug 15, 2017
1 parent ce28385 commit 13d0450
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@ Interface.prototype.debugEval = function(code, context, filename, callback) {
return;
}

var frame = client.currentFrame === NO_FRAME ? frame : undefined;
var frame = client.currentFrame;
if (frame !== NO_FRAME) frame = undefined;

self.pause();

Expand Down
3 changes: 2 additions & 1 deletion lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-tls-npn-server-client.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-tls-sni-option.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-tls-sni-server-client.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 13d0450

Please sign in to comment.