Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6.x backport] Eslint 4.1.0 #14830

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3edd272
test: add common.noop, default for common.mustCall()
jasnell Mar 24, 2017
2d96b01
tools: add rule prefering common.mustNotCall()
jasnell Mar 24, 2017
ce86b8e
test: add mustCallAtLeast
refack May 9, 2017
189dc42
test: harden test-dgram-bind-shared-ports
refack May 18, 2017
a28f7a2
dns: fix `resolve` failed starts without network
XadillaX Aug 10, 2017
cb3b866
src: supply missing comments for CLI options
sam-github Apr 5, 2017
1576c09
src: use option parser for expose_internals
sam-github Apr 5, 2017
ee98df8
test: mark test-fs-read-buffer-to-string-fail as flaky
Jeyanthinath Jul 26, 2017
3f2b8a9
test: increase coverage for path.parse
tniessen Jul 24, 2017
ba411f1
path: fix win32 volume-relative paths
TimothyGu Jul 24, 2017
d75363b
path: remove unnecessary string copies
tniessen Jul 23, 2017
cbd2c77
tools: add missing #include "unicode/putil.h"
srl295 Mar 27, 2017
0f36025
timers: do not use user object call/apply
Trott May 11, 2017
c7622e1
deps: cherry-pick f5fad6d from upstream v8
danbev May 2, 2017
2914926
src: only call FatalException if not verbose
danbev May 3, 2017
9dde328
build: reduce one level of spawning in node_gyp
refack Apr 25, 2017
4072073
test: check number of message events
Trott May 20, 2017
548aba4
test: confirm callback is invoked in fs test
Trott May 20, 2017
4442a1f
test: check noop function invocations
Trott May 21, 2017
85a8d6e
test: simplify assert usage in test-stream2-basic
Trott May 21, 2017
10ad128
test: move stream2 test from pummel to parallel
Trott May 21, 2017
8fd7fcc
build: support dtrace on ARM
bradleythughes Mar 27, 2017
6ca963a
test: replace `indexOf` with `includes`
thelostone-mc May 25, 2017
b997b8f
test: use mustNotCall() in test-stream2-objects
Trott May 26, 2017
7919eee
test: use mustCall() in test-readline-interface
Trott May 27, 2017
089bd3b
test: refactor test-net-server-bind
Trott May 29, 2017
30201e5
test: add documentation for common.mustNotCall()
Trott Jun 1, 2017
7c2befc
test: refactor test-dgram-oob-buffer
Trott Jun 3, 2017
c15393c
test: check callback not invoked on lookup error
Trott Jun 4, 2017
1a95a51
test: refactor domain tests
Trott Jun 5, 2017
8033cf3
test: refactor test-fs-read-*
Trott Jun 6, 2017
bfea6b2
src: merge `fn_name` in NODE_SET_PROTOTYPE_METHOD
XadillaX Jun 8, 2017
245f6b0
test: use mustNotCall in test-http-eof-on-connect
Trott Jun 9, 2017
6f44563
test: add mustCall() to child-process test
Trott Jun 11, 2017
2f8aa88
test: use mustNotCall() in test-fs-watch
Trott Jun 10, 2017
ac99a79
v8: fix RegExp nits in v8_prof_polyfill.js
vsemozhetbyt Jun 15, 2017
10e9f45
test: make test-http(s)-set-timeout-server alike
jklepatch Jun 12, 2017
7aee51f
test: refactor test-http-set-timeout-server
Trott Jun 19, 2017
2ef11d5
test: remove needless RegExp flags
vsemozhetbyt Jun 15, 2017
29141c0
test: use string instead of RegExp in split()
vsemozhetbyt Jun 16, 2017
366d1a8
doc: add missing zlib link to stream API docs
Rob--W Jun 21, 2017
b5d763f
test: remove unnecessary Buffer import
swinston1000 Jun 21, 2017
dda959d
test: remove require('buffer') on 6 fs test files
sallen450 Jun 21, 2017
611ae1e
test: remove require('buffer') from 4 buffer tests
OriLev Jun 21, 2017
bfd296b
test: remove `require('buffer')` from 4 test files
leizongmin Jun 21, 2017
036a97c
test: remove unnecessary require('buffer').Buffer
lenakaplan Jun 21, 2017
47dd8f0
test: remove `require('buffer')` from 4 test files
XadillaX Jun 21, 2017
b801c75
build: clean up config_fips.gypi
danbev Jun 21, 2017
cb8d837
test: make http(s)-set-timeout-server more similar
jklepatch Jun 20, 2017
b9837ff
test: refactor test-tls-env-extra-ca
Trott Jun 23, 2017
e5f8141
test: refactor test-tls-invoked-queued
Trott Jun 23, 2017
3a45bde
test: skip fips tests using OpenSSL config file
danbev Jun 18, 2017
da8851c
doc: fixed formatting issue in cli docs
Jun 20, 2017
8fcae92
test: remove unneeded HandleScope usage
ezequielgarcia Jun 19, 2017
9575c97
doc: fix mistake in path.relative
tniessen Jun 25, 2017
1ae897d
doc: add gireeshpunathil to collaborators
gireeshpunathil Jun 28, 2017
92c46ff
doc: add @nodejs/documentation to CC table
vsemozhetbyt Jun 27, 2017
7f77286
tools: update to ESLint 4.1.0
Trott Jun 24, 2017
b7a0867
tools: add script to update ESLint
Trott Jun 24, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ more information about the governance of the Node.js project, see
**Wyatt Preul** <wpreul@gmail.com>
* [gibfahn](https://github.com/gibfahn) -
**Gibson Fahnestock** <gibfahn@gmail.com> (he/him)
* [gireeshpunathil](https://github.com/gireeshpunathil) -
**Gireesh Punathil** <gpunathi@in.ibm.com> (he/him)
* [iarna](https://github.com/iarna) -
**Rebecca Turner** <me@re-becca.org>
* [imran-iq](https://github.com/imran-iq) -
Expand Down
10 changes: 7 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import nodedownload
# imports in tools/
sys.path.insert(0, os.path.join(root_dir, 'tools'))
import getmoduleversion
from gyp_node import run_gyp

# parse our options
parser = optparse.OptionParser()
Expand Down Expand Up @@ -972,7 +973,10 @@ def configure_openssl(o):
]
else:
o['variables']['openssl_fips'] = ''

try:
os.remove('config_fips.gypi')
except OSError:
pass

if options.without_ssl:
def without_ssl_error(option):
Expand Down Expand Up @@ -1370,7 +1374,7 @@ config = '\n'.join(map('='.join, config.iteritems())) + '\n'

write('config.mk', do_not_edit + config)

gyp_args = [sys.executable, 'tools/gyp_node.py', '--no-parallel']
gyp_args = ['--no-parallel']

if options.use_xcode:
gyp_args += ['-f', 'xcode']
Expand All @@ -1389,4 +1393,4 @@ gyp_args += args
if warn.warned:
warn('warnings were emitted in the configure phase')

sys.exit(subprocess.call(gyp_args))
run_gyp(gyp_args)
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 281
#define V8_PATCH_LEVEL 104
#define V8_PATCH_LEVEL 105

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
5 changes: 5 additions & 0 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6869,6 +6869,11 @@ class V8_EXPORT TryCatch {
*/
void SetVerbose(bool value);

/**
* Returns true if verbosity is enabled.
*/
bool IsVerbose() const;

/**
* Set whether or not this TryCatch should capture a Message object
* which holds source information about where the exception
Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,10 @@ void v8::TryCatch::SetVerbose(bool value) {
is_verbose_ = value;
}

bool v8::TryCatch::IsVerbose() const {
return is_verbose_;
}


void v8::TryCatch::SetCaptureMessage(bool value) {
capture_message_ = value;
Expand Down
2 changes: 1 addition & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ added: v6.11.0

Load an OpenSSL configuration file on startup. Among other uses, this can be
used to enable FIPS-compliant crypto if Node.js is built with `./configure
\-\-openssl\-fips`.
--openssl-fips`.

If the [`--openssl-config`][] command line option is used, the environment
variable is ignored.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb');
// Returns: '..\\..\\impl\\bbb'
```

A [`TypeError`][] is thrown if neither `from` nor `to` is a string.
A [`TypeError`][] is thrown if either `from` or `to` is not a string.

## path.resolve([...paths])
<!-- YAML
Expand Down
1 change: 1 addition & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -2060,6 +2060,7 @@ readable buffer so there is nothing for a user to consume.
[HTTP responses, on the server]: http.html#http_class_http_serverresponse
[http-incoming-message]: http.html#http_class_http_incomingmessage
[Readable]: #stream_class_stream_readable
[zlib]: zlib.html
[stream-_flush]: #stream_transform_flush_callback
[stream-_read]: #stream_readable_read_size_1
[stream-_transform]: #stream_transform_transform_chunk_encoding_callback
Expand Down
1 change: 1 addition & 0 deletions doc/onboarding-extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| --- | --- |
| `benchmark/*` | @nodejs/benchmarking, @mscdex |
| `bootstrap_node.js` | @fishrock123 |
| `doc/*`, `*.md` | @nodejs/documentation |
| `lib/assert` | @nodejs/testing |
| `lib/buffer` | @nodejs/buffer |
| `lib/child_process` | @bnoordhuis, @cjihrig |
Expand Down
6 changes: 2 additions & 4 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,9 @@
return NativeModule._source.hasOwnProperty(id);
};

const EXPOSE_INTERNALS = process.execArgv.some(function(arg) {
return arg.match(/^--expose[-_]internals$/);
});
const config = process.binding('config');

if (EXPOSE_INTERNALS) {
if (config.exposeInternals) {
NativeModule.nonInternalExists = NativeModule.exists;

NativeModule.isInternal = function(id) {
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/v8_prof_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ function versionCheck() {
function macCppfiltNm(out) {
// Re-grouped copy-paste from `tickprocessor.js`
const FUNC_RE = /^([0-9a-fA-F]{8,16} [iItT] )(.*)$/gm;
const CLEAN_RE = /^[0-9a-fA-F]{8,16} [iItT] /;
let entries = out.match(FUNC_RE);
if (entries === null)
return out;

entries = entries.map((entry) => {
return entry.replace(/^[0-9a-fA-F]{8,16} [iItT] /, '')
return entry.replace(CLEAN_RE, '')
});

let filtered;
Expand All @@ -123,7 +124,7 @@ function macCppfiltNm(out) {
}

let i = 0;
filtered = filtered.split(/\n/g);
filtered = filtered.split('\n');
return out.replace(FUNC_RE, (all, prefix, postfix) => {
return prefix + (filtered[i++] || postfix);
});
Expand Down
55 changes: 31 additions & 24 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ const win32 = {
}
}
} else if (code === 47/*/*/ || code === 92/*\*/) {
return path[0];
// `path` contains just a path separator, exit early to avoid
// unnecessary work
return path;
}

for (var i = len - 1; i >= offset; --i) {
Expand Down Expand Up @@ -885,14 +887,28 @@ const win32 = {

extname: function extname(path) {
assertPath(path);
var start = 0;
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
for (var i = path.length - 1; i >= 0; --i) {

// Check for a drive letter prefix so as not to mistake the following
// path separator as an extra separator at the end of the path that can be
// disregarded
if (path.length >= 2) {
const code = path.charCodeAt(0);
if (path.charCodeAt(1) === 58/*:*/ &&
((code >= 65/*A*/ && code <= 90/*Z*/) ||
(code >= 97/*a*/ && code <= 122/*z*/))) {
start = startPart = 2;
}
}

for (var i = path.length - 1; i >= start; --i) {
const code = path.charCodeAt(i);
if (code === 47/*/*/ || code === 92/*\*/) {
// If we reached a path separator that was not part of a set of path
Expand Down Expand Up @@ -956,15 +972,12 @@ const win32 = {
var len = path.length;
var rootEnd = 0;
var code = path.charCodeAt(0);
var isAbsolute = false;

// Try to match a root
if (len > 1) {
if (code === 47/*/*/ || code === 92/*\*/) {
// Possible UNC root

isAbsolute = true;

code = path.charCodeAt(1);
rootEnd = 1;
if (code === 47/*/*/ || code === 92/*\*/) {
Expand Down Expand Up @@ -1020,32 +1033,31 @@ const win32 = {
if (len === 3) {
// `path` contains just a drive root, exit early to avoid
// unnecessary work
ret.root = ret.dir = path.slice(0, 3);
ret.root = ret.dir = path;
return ret;
}
isAbsolute = true;
rootEnd = 3;
}
} else {
// `path` contains just a drive root, exit early to avoid
// unnecessary work
ret.root = ret.dir = path.slice(0, 2);
ret.root = ret.dir = path;
return ret;
}
}
}
} else if (code === 47/*/*/ || code === 92/*\*/) {
// `path` contains just a path separator, exit early to avoid
// unnecessary work
ret.root = ret.dir = path[0];
ret.root = ret.dir = path;
return ret;
}

if (rootEnd > 0)
ret.root = path.slice(0, rootEnd);

var startDot = -1;
var startPart = 0;
var startPart = rootEnd;
var end = -1;
var matchedSlash = true;
var i = path.length - 1;
Expand Down Expand Up @@ -1094,26 +1106,21 @@ const win32 = {
startDot === end - 1 &&
startDot === startPart + 1)) {
if (end !== -1) {
if (startPart === 0 && isAbsolute)
ret.base = ret.name = path.slice(rootEnd, end);
else
ret.base = ret.name = path.slice(startPart, end);
ret.base = ret.name = path.slice(startPart, end);
}
} else {
if (startPart === 0 && isAbsolute) {
ret.name = path.slice(rootEnd, startDot);
ret.base = path.slice(rootEnd, end);
} else {
ret.name = path.slice(startPart, startDot);
ret.base = path.slice(startPart, end);
}
ret.name = path.slice(startPart, startDot);
ret.base = path.slice(startPart, end);
ret.ext = path.slice(startDot, end);
}

if (startPart > 0)
// If the directory is the root, use the entire root as the `dir` including
// the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
// trailing slash (`C:\abc\def` -> `C:\abc`).
if (startPart > 0 && startPart !== rootEnd)
ret.dir = path.slice(0, startPart - 1);
else if (isAbsolute)
ret.dir = path.slice(0, rootEnd);
else
ret.dir = ret.root;

return ret;
},
Expand Down
12 changes: 6 additions & 6 deletions lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,20 @@ function ontimeout(timer) {
var args = timer._timerArgs;
var callback = timer._onTimeout;
if (!args)
callback.call(timer);
timer._onTimeout();
else {
switch (args.length) {
case 1:
callback.call(timer, args[0]);
timer._onTimeout(args[0]);
break;
case 2:
callback.call(timer, args[0], args[1]);
timer._onTimeout(args[0], args[1]);
break;
case 3:
callback.call(timer, args[0], args[1], args[2]);
timer._onTimeout(args[0], args[1], args[2]);
break;
default:
callback.apply(timer, args);
Function.prototype.apply.call(callback, timer, args);
}
}
if (timer._repeat)
Expand Down Expand Up @@ -678,7 +678,7 @@ function runCallback(timer) {
return timer._callback(argv[0], argv[1], argv[2]);
// more than 3 arguments run slower with .apply
default:
return timer._callback.apply(timer, argv);
return Function.prototype.apply.call(timer._callback, timer, argv);
}
}

Expand Down
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
'<(OBJ_DIR)/node/src/node_dtrace_ustack.o'
],
'conditions': [
[ 'target_arch=="ia32"', {
[ 'target_arch=="ia32" or target_arch=="arm"', {
'action': [
'dtrace', '-32', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
'-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
Expand Down
Loading