From 1d03df4c5e72c353ca36a44c0fb305ac62fee003 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 10 Oct 2019 00:33:15 +0200 Subject: [PATCH 01/65] crypto: add Hash.prototype.copy() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it possible to clone the internal state of a Hash object into a new Hash object, i.e., to fork the state of the object. Fixes: https://github.com/nodejs/node/issues/29903 PR-URL: https://github.com/nodejs/node/pull/29910 Reviewed-By: Colin Ihrig Reviewed-By: Sam Roberts Reviewed-By: Tobias Nießen Reviewed-By: David Carlier Reviewed-By: James M Snell --- doc/api/crypto.md | 37 +++++++++++++++++++++++++++++++ lib/internal/crypto/hash.js | 11 ++++++++- src/node_crypto.cc | 23 ++++++++++++++----- src/node_crypto.h | 2 +- test/parallel/test-crypto-hash.js | 29 ++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 8 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 345ce542962420..31fa812f915a6d 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1041,6 +1041,43 @@ console.log(hash.digest('hex')); // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 ``` +### hash.copy(\[options\]) + + +* `options` {Object} [`stream.transform` options][] +* Returns: {Hash} + +Creates a new `Hash` object that contains a deep copy of the internal state +of the current `Hash` object. + +The optional `options` argument controls stream behavior. For XOF hash +functions such as `'shake256'`, the `outputLength` option can be used to +specify the desired output length in bytes. + +An error is thrown when an attempt is made to copy the `Hash` object after +its [`hash.digest()`][] method has been called. + +```js +// Calculate a rolling hash. +const crypto = require('crypto'); +const hash = crypto.createHash('sha256'); + +hash.update('one'); +console.log(hash.copy().digest('hex')); + +hash.update('two'); +console.log(hash.copy().digest('hex')); + +hash.update('three'); +console.log(hash.copy().digest('hex')); + +// Etc. +``` + ### hash.digest(\[encoding\]) +* `sourceAddress` {string} +* `groupAddress` {string} +* `multicastInterface` {string} + +Tells the kernel to join a source-specific multicast channel at the given +`sourceAddress` and `groupAddress`, using the `multicastInterface` with the +`IP_ADD_SOURCE_MEMBERSHIP` socket option. If the `multicastInterface` argument +is not specified, the operating system will choose one interface and will add +membership to it. To add membership to every available interface, call +`socket.addSourceSpecificMembership()` multiple times, once per interface. + ### socket.address() + +* `sourceAddress` {string} +* `groupAddress` {string} +* `multicastInterface` {string} + +Instructs the kernel to leave a source-specific multicast channel at the given +`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` +socket option. This method is automatically called by the kernel when the +socket is closed or the process terminates, so most apps will never have +reason to call this. + +If `multicastInterface` is not specified, the operating system will attempt to +drop membership on all valid interfaces. + ### socket.getRecvBufferSize() * `options` {Object} [`stream.transform` options][] From 5ca58646c1490a79f2c990741a10a5040520c09a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 18 Oct 2019 17:05:35 +0200 Subject: [PATCH 04/65] cli: add --trace-uncaught flag Add a flag that makes Node.js print the stack trace at the time of *throwing* uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. PR-URL: https://github.com/nodejs/node/pull/30025 Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Ruben Bridgewater Reviewed-By: Gireesh Punathil --- doc/api/cli.md | 13 +++++++++++++ doc/node.1 | 12 ++++++++++++ src/node.cc | 2 ++ src/node_errors.cc | 13 +++++++++++++ src/node_options.cc | 4 ++++ src/node_options.h | 1 + test/message/eval_messages.out | 2 ++ test/message/stdin_messages.out | 2 ++ test/message/throw_error_with_getter_throw.out | 1 + .../message/throw_error_with_getter_throw_traced.js | 11 +++++++++++ .../throw_error_with_getter_throw_traced.out | 12 ++++++++++++ test/message/throw_null.out | 1 + test/message/throw_null_traced.js | 6 ++++++ test/message/throw_null_traced.out | 12 ++++++++++++ test/message/throw_undefined.out | 1 + test/message/throw_undefined_traced.js | 6 ++++++ test/message/throw_undefined_traced.out | 12 ++++++++++++ 17 files changed, 111 insertions(+) create mode 100644 test/message/throw_error_with_getter_throw_traced.js create mode 100644 test/message/throw_error_with_getter_throw_traced.out create mode 100644 test/message/throw_null_traced.js create mode 100644 test/message/throw_null_traced.out create mode 100644 test/message/throw_undefined_traced.js create mode 100644 test/message/throw_undefined_traced.out diff --git a/doc/api/cli.md b/doc/api/cli.md index e47d315019c87b..7769b0219417b4 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -748,6 +748,18 @@ added: v12.2.0 Prints TLS packet trace information to `stderr`. This can be used to debug TLS connection problems. +### `--trace-uncaught` + + +Print stack traces for uncaught exceptions; usually, the stack trace associated +with the creation of an `Error` is printed, whereas this makes Node.js also +print the stack trace associated with throwing the value (which does not need +to be an `Error` instance). + +Enabling this option may affect garbage collection behavior negatively. + ### `--trace-warnings` + +Enable experimental support for a package using `require` or `import` to load +itself. + ### `--experimental-vm-modules` -Alias for stdin, analogous to the use of - in other command line utilities, +Alias for stdin. Analogous to the use of `-` in other command line utilities, meaning that the script will be read from stdin, and the rest of the options are passed to that script. diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 1ab3dfeafe19ef..68c8ba0bb3e787 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1417,7 +1417,7 @@ If `privateKey` is not a [`KeyObject`][], this function behaves as if `privateKey` had been passed to [`crypto.createPrivateKey()`][]. If it is an object, the following additional properties can be passed: -* `padding`: {integer} - Optional padding value for RSA, one of the following: +* `padding` {integer} Optional padding value for RSA, one of the following: * `crypto.constants.RSA_PKCS1_PADDING` (default) * `crypto.constants.RSA_PKCS1_PSS_PADDING` @@ -1425,7 +1425,7 @@ object, the following additional properties can be passed: used to sign the message as specified in section 3.1 of [RFC 4055][], unless an MGF1 hash function has been specified as part of the key in compliance with section 3.3 of [RFC 4055][]. -* `saltLength`: {integer} - salt length for when padding is +* `saltLength` {integer} Salt length for when padding is `RSA_PKCS1_PSS_PADDING`. The special value `crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the @@ -1526,7 +1526,7 @@ If `object` is not a [`KeyObject`][], this function behaves as if `object` had been passed to [`crypto.createPublicKey()`][]. If it is an object, the following additional properties can be passed: -* `padding`: {integer} - Optional padding value for RSA, one of the following: +* `padding` {integer} Optional padding value for RSA, one of the following: * `crypto.constants.RSA_PKCS1_PADDING` (default) * `crypto.constants.RSA_PKCS1_PSS_PADDING` @@ -1534,7 +1534,7 @@ object, the following additional properties can be passed: used to verify the message as specified in section 3.1 of [RFC 4055][], unless an MGF1 hash function has been specified as part of the key in compliance with section 3.3 of [RFC 4055][]. -* `saltLength`: {integer} - salt length for when padding is +* `saltLength` {integer} Salt length for when padding is `RSA_PKCS1_PSS_PADDING`. The special value `crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest size, `crypto.constants.RSA_PSS_SALTLEN_AUTO` (default) causes it to be @@ -2891,13 +2891,13 @@ If `key` is not a [`KeyObject`][], this function behaves as if `key` had been passed to [`crypto.createPrivateKey()`][]. If it is an object, the following additional properties can be passed: -* `padding`: {integer} - Optional padding value for RSA, one of the following: +* `padding` {integer} Optional padding value for RSA, one of the following: * `crypto.constants.RSA_PKCS1_PADDING` (default) * `crypto.constants.RSA_PKCS1_PSS_PADDING` `RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function used to sign the message as specified in section 3.1 of [RFC 4055][]. -* `saltLength`: {integer} - salt length for when padding is +* `saltLength` {integer} Salt length for when padding is `RSA_PKCS1_PSS_PADDING`. The special value `crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the @@ -2944,13 +2944,13 @@ If `key` is not a [`KeyObject`][], this function behaves as if `key` had been passed to [`crypto.createPublicKey()`][]. If it is an object, the following additional properties can be passed: -* `padding`: {integer} - Optional padding value for RSA, one of the following: +* `padding` {integer} Optional padding value for RSA, one of the following: * `crypto.constants.RSA_PKCS1_PADDING` (default) * `crypto.constants.RSA_PKCS1_PSS_PADDING` `RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function used to sign the message as specified in section 3.1 of [RFC 4055][]. -* `saltLength`: {integer} - salt length for when padding is +* `saltLength` {integer} Salt length for when padding is `RSA_PKCS1_PSS_PADDING`. The special value `crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the diff --git a/doc/api/debugger.md b/doc/api/debugger.md index 318b44de61df79..823574f1bc1b69 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -104,21 +104,21 @@ To begin watching an expression, type `watch('my_expression')`. The command ### Stepping -* `cont`, `c` - Continue execution -* `next`, `n` - Step next -* `step`, `s` - Step in -* `out`, `o` - Step out -* `pause` - Pause running code (like pause button in Developer Tools) +* `cont`, `c`: Continue execution +* `next`, `n`: Step next +* `step`, `s`: Step in +* `out`, `o`: Step out +* `pause`: Pause running code (like pause button in Developer Tools) ### Breakpoints -* `setBreakpoint()`, `sb()` - Set breakpoint on current line -* `setBreakpoint(line)`, `sb(line)` - Set breakpoint on specific line -* `setBreakpoint('fn()')`, `sb(...)` - Set breakpoint on a first statement in +* `setBreakpoint()`, `sb()`: Set breakpoint on current line +* `setBreakpoint(line)`, `sb(line)`: Set breakpoint on specific line +* `setBreakpoint('fn()')`, `sb(...)`: Set breakpoint on a first statement in functions body -* `setBreakpoint('script.js', 1)`, `sb(...)` - Set breakpoint on first line of +* `setBreakpoint('script.js', 1)`, `sb(...)`: Set breakpoint on first line of `script.js` -* `clearBreakpoint('script.js', 1)`, `cb(...)` - Clear breakpoint in `script.js` +* `clearBreakpoint('script.js', 1)`, `cb(...)`: Clear breakpoint in `script.js` on line 1 It is also possible to set a breakpoint in a file (module) that @@ -147,26 +147,26 @@ debug> ### Information -* `backtrace`, `bt` - Print backtrace of current execution frame -* `list(5)` - List scripts source code with 5 line context (5 lines before and +* `backtrace`, `bt`: Print backtrace of current execution frame +* `list(5)`: List scripts source code with 5 line context (5 lines before and after) -* `watch(expr)` - Add expression to watch list -* `unwatch(expr)` - Remove expression from watch list -* `watchers` - List all watchers and their values (automatically listed on each +* `watch(expr)`: Add expression to watch list +* `unwatch(expr)`: Remove expression from watch list +* `watchers`: List all watchers and their values (automatically listed on each breakpoint) -* `repl` - Open debugger's repl for evaluation in debugging script's context -* `exec expr` - Execute an expression in debugging script's context +* `repl`: Open debugger's repl for evaluation in debugging script's context +* `exec expr`: Execute an expression in debugging script's context ### Execution control -* `run` - Run script (automatically runs on debugger's start) -* `restart` - Restart script -* `kill` - Kill script +* `run`: Run script (automatically runs on debugger's start) +* `restart`: Restart script +* `kill`: Kill script ### Various -* `scripts` - List all loaded scripts -* `version` - Display V8's version +* `scripts`: List all loaded scripts +* `version`: Display V8's version ## Advanced Usage diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ca832060e19de8..50303baa78207f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -141,17 +141,17 @@ API usability issues that can lead to accidental security issues. As an alternative, use one of the following methods of constructing `Buffer` objects: -* [`Buffer.alloc(size[, fill[, encoding]])`][alloc] - Create a `Buffer` with +* [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with *initialized* memory. -* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size] - Create a `Buffer` with +* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size]: Create a `Buffer` with *uninitialized* memory. -* [`Buffer.allocUnsafeSlow(size)`][] - Create a `Buffer` with *uninitialized* +* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with *uninitialized* memory. -* [`Buffer.from(array)`][] - Create a `Buffer` with a copy of `array` +* [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array` * [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - Create a `Buffer` that wraps the given `arrayBuffer`. -* [`Buffer.from(buffer)`][] - Create a `Buffer` that copies `buffer`. -* [`Buffer.from(string[, encoding])`][from_string_encoding] - Create a `Buffer` +* [`Buffer.from(buffer)`][]: Create a `Buffer` that copies `buffer`. +* [`Buffer.from(string[, encoding])`][from_string_encoding]: Create a `Buffer` that copies `string`. Without `--pending-deprecation`, runtime warnings occur only for code not in diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 894f64f36e135f..aea51ad711c1b0 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -706,8 +706,8 @@ changes: * `ipv6Only` {boolean} Setting `ipv6Only` to `true` will disable dual-stack support, i.e., binding to address `::` won't make `0.0.0.0` be bound. **Default:** `false`. - * `recvBufferSize` {number} - Sets the `SO_RCVBUF` socket value. - * `sendBufferSize` {number} - Sets the `SO_SNDBUF` socket value. + * `recvBufferSize` {number} Sets the `SO_RCVBUF` socket value. + * `sendBufferSize` {number} Sets the `SO_SNDBUF` socket value. * `lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][]. * `callback` {Function} Attached as a listener for `'message'` events. Optional. * Returns: {dgram.Socket} @@ -725,8 +725,8 @@ and port can be retrieved using [`socket.address().address`][] and added: v0.1.99 --> -* `type` {string} - Either `'udp4'` or `'udp6'`. -* `callback` {Function} - Attached as a listener to `'message'` events. +* `type` {string} Either `'udp4'` or `'udp6'`. +* `callback` {Function} Attached as a listener to `'message'` events. * Returns: {dgram.Socket} Creates a `dgram.Socket` object of the specified `type`. diff --git a/doc/api/esm.md b/doc/api/esm.md index 298420465b6788..5cb44868e8d47c 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -286,7 +286,7 @@ throw when an attempt is made to import them: ```js import submodule from 'es-module-package/private-module.js'; -// Throws - Module not found +// Throws ERR_MODULE_NOT_FOUND ``` > Note: this is not a strong encapsulation as any private modules can still be diff --git a/doc/api/fs.md b/doc/api/fs.md index 66cc7d7a7ccbd7..78b7b3af2f8d36 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -982,15 +982,15 @@ representation. The times in the stat object have the following semantics: -* `atime` "Access Time" - Time when file data last accessed. Changed +* `atime` "Access Time": Time when file data last accessed. Changed by the mknod(2), utimes(2), and read(2) system calls. -* `mtime` "Modified Time" - Time when file data last modified. +* `mtime` "Modified Time": Time when file data last modified. Changed by the mknod(2), utimes(2), and write(2) system calls. -* `ctime` "Change Time" - Time when file status was last changed +* `ctime` "Change Time": Time when file status was last changed (inode data modification). Changed by the chmod(2), chown(2), link(2), mknod(2), rename(2), unlink(2), utimes(2), read(2), and write(2) system calls. -* `birthtime` "Birth Time" - Time of file creation. Set once when the +* `birthtime` "Birth Time": Time of file creation. Set once when the file is created. On filesystems where birthtime is not available, this field may instead hold either the `ctime` or `1970-01-01T00:00Z` (ie, Unix epoch timestamp `0`). This value may be greater @@ -1571,12 +1571,12 @@ of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). -* `fs.constants.COPYFILE_EXCL` - The copy operation will fail if `dest` already +* `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already exists. -* `fs.constants.COPYFILE_FICLONE` - The copy operation will attempt to create a +* `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used. -* `fs.constants.COPYFILE_FICLONE_FORCE` - The copy operation will attempt to +* `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail. @@ -1619,12 +1619,12 @@ of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). -* `fs.constants.COPYFILE_EXCL` - The copy operation will fail if `dest` already +* `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already exists. -* `fs.constants.COPYFILE_FICLONE` - The copy operation will attempt to create a +* `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used. -* `fs.constants.COPYFILE_FICLONE_FORCE` - The copy operation will attempt to +* `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail. @@ -3834,7 +3834,7 @@ event (its disappearance). This happens when: * the file is deleted, followed by a restore -* the file is renamed twice - the second time back to its original name +* the file is renamed and then renamed a second time back to its original name ## fs.write(fd, buffer\[, offset\[, length\[, position\]\]\], callback) * `dir` {number} - * `-1` - to the left from cursor - * `1` - to the right from cursor - * `0` - the entire line + * `-1`: to the left from cursor + * `1`: to the right from cursor + * `0`: the entire line * `callback` {Function} Invoked once the operation completes. * Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional diff --git a/doc/api/util.md b/doc/api/util.md index 5cb5786a5274de..c87957b107e825 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -225,27 +225,27 @@ as a `printf`-like format string which can contain zero or more format specifiers. Each specifier is replaced with the converted value from the corresponding argument. Supported specifiers are: -* `%s` - `String` will be used to convert all values except `BigInt`, `Object` +* `%s`: `String` will be used to convert all values except `BigInt`, `Object` and `-0`. `BigInt` values will be represented with an `n` and Objects that have no user defined `toString` function are inspected using `util.inspect()` with options `{ depth: 0, colors: false, compact: 3 }`. -* `%d` - `Number` will be used to convert all values except `BigInt` and +* `%d`: `Number` will be used to convert all values except `BigInt` and `Symbol`. -* `%i` - `parseInt(value, 10)` is used for all values except `BigInt` and +* `%i`: `parseInt(value, 10)` is used for all values except `BigInt` and `Symbol`. -* `%f` - `parseFloat(value)` is used for all values expect `Symbol`. -* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument contains +* `%f`: `parseFloat(value)` is used for all values expect `Symbol`. +* `%j`: JSON. Replaced with the string `'[Circular]'` if the argument contains circular references. -* `%o` - `Object`. A string representation of an object with generic JavaScript +* `%o`: `Object`. A string representation of an object with generic JavaScript object formatting. Similar to `util.inspect()` with options `{ showHidden: true, showProxy: true }`. This will show the full object including non-enumerable properties and proxies. -* `%O` - `Object`. A string representation of an object with generic JavaScript +* `%O`: `Object`. A string representation of an object with generic JavaScript object formatting. Similar to `util.inspect()` without options. This will show the full object not including non-enumerable properties and proxies. -* `%c` - `CSS`. This specifier is currently ignored, and will skip any CSS +* `%c`: `CSS`. This specifier is currently ignored, and will skip any CSS passed in. -* `%%` - single percent sign (`'%'`). This does not consume an argument. +* `%%`: single percent sign (`'%'`). This does not consume an argument. * Returns: {string} The formatted string If a specifier does not have a corresponding argument, it is not replaced: @@ -665,18 +665,18 @@ via the `util.inspect.styles` and `util.inspect.colors` properties. The default styles and associated colors are: -* `bigint` - `yellow` -* `boolean` - `yellow` -* `date` - `magenta` -* `module` - `underline` -* `name` - (no styling) -* `null` - `bold` -* `number` - `yellow` -* `regexp` - `red` -* `special` - `cyan` (e.g., `Proxies`) -* `string` - `green` -* `symbol` - `green` -* `undefined` - `grey` +* `bigint`: `yellow` +* `boolean`: `yellow` +* `date`: `magenta` +* `module`: `underline` +* `name`: (no styling) +* `null`: `bold` +* `number`: `yellow` +* `regexp`: `red` +* `special`: `cyan` (e.g., `Proxies`) +* `string`: `green` +* `symbol`: `green` +* `undefined`: `grey` The predefined color codes are: `white`, `grey`, `black`, `blue`, `cyan`, `green`, `magenta`, `red` and `yellow`. There are also `bold`, `italic`, From 381c6cd0d2282643e8d6bdd51145f122ad4f83c0 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Oct 2019 15:35:13 -0700 Subject: [PATCH 20/65] doc: delete "a number of" things in the docs Delete "a number of" phrases in the docs. See what I did there? Ha ha. Ha ha. Ha. ...heh.. PR-URL: https://github.com/nodejs/node/pull/30103 Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/addons.md | 28 +++++++++++++--------------- doc/api/dgram.md | 7 +++---- doc/api/globals.md | 6 +++--- doc/api/modules.md | 6 +++--- doc/api/os.md | 4 ++-- doc/api/util.md | 9 ++++----- 6 files changed, 28 insertions(+), 32 deletions(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index 6b440bf6746b96..774be1a7aaab83 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -34,16 +34,14 @@ involving knowledge of several components and APIs: off-loading work via libuv to non-blocking system operations, worker threads or a custom use of libuv's threads. -* Internal Node.js libraries. Node.js itself exports a number of C++ APIs - that Addons can use — the most important of which is the - `node::ObjectWrap` class. +* Internal Node.js libraries. Node.js itself exports C++ APIs that Addons can + use, the most important of which is the `node::ObjectWrap` class. -* Node.js includes a number of other statically linked libraries including - OpenSSL. These other libraries are located in the `deps/` directory in the - Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are - purposefully re-exported by Node.js and may be used to various extents by - Addons. - See [Linking to Node.js' own dependencies][] for additional information. +* Node.js includes other statically linked libraries including OpenSSL. These + other libraries are located in the `deps/` directory in the Node.js source + tree. Only the libuv, OpenSSL, V8 and zlib symbols are purposefully + re-exported by Node.js and may be used to various extents by Addons. See + [Linking to Node.js' own dependencies][] for additional information. All of the following examples are available for [download][] and may be used as the starting-point for an Addon. @@ -331,12 +329,12 @@ try { ### Linking to Node.js' own dependencies -Node.js uses a number of statically linked libraries such as V8, libuv and -OpenSSL. All Addons are required to link to V8 and may link to any of the -other dependencies as well. Typically, this is as simple as including -the appropriate `#include <...>` statements (e.g. `#include `) and -`node-gyp` will locate the appropriate headers automatically. However, there -are a few caveats to be aware of: +Node.js uses statically linked libraries such as V8, libuv and OpenSSL. All +Addons are required to link to V8 and may link to any of the other dependencies +as well. Typically, this is as simple as including the appropriate +`#include <...>` statements (e.g. `#include `) and `node-gyp` will locate +the appropriate headers automatically. However, there are a few caveats to be +aware of: * When `node-gyp` runs, it will detect the specific release version of Node.js and download either the full source tarball or just the headers. If the full diff --git a/doc/api/dgram.md b/doc/api/dgram.md index aea51ad711c1b0..f24bd5225b7484 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -622,8 +622,7 @@ packet is allowed to travel through, specifically for multicast traffic. Each router or gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. -The argument passed to `socket.setMulticastTTL()` is a number of hops -between 0 and 255. The default on most systems is `1` but can vary. +The `ttl` argument may be between 0 and 255. The default on most systems is `1`. ### socket.setRecvBufferSize(size) The semantics of Node.js's `require()` function were designed to be general -enough to support a number of reasonable directory structures. Package manager -programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to -build native packages from Node.js modules without modification. +enough to support reasonable directory structures. Package manager programs +such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to build +native packages from Node.js modules without modification. Below we give a suggested directory structure that could work: diff --git a/doc/api/os.md b/doc/api/os.md index 6f22098f985332..75a08dcfbfe087 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -4,8 +4,8 @@ > Stability: 2 - Stable -The `os` module provides a number of operating system-related utility methods. -It can be accessed using: +The `os` module provides operating system-related utility methods. It can be +accessed using: ```js const os = require('os'); diff --git a/doc/api/util.md b/doc/api/util.md index c87957b107e825..a38288d4585867 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1108,11 +1108,10 @@ The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. added: v10.0.0 --> -`util.types` provides a number of type checks for different kinds of built-in -objects. Unlike `instanceof` or `Object.prototype.toString.call(value)`, -these checks do not inspect properties of the object that are accessible from -JavaScript (like their prototype), and usually have the overhead of -calling into C++. +`util.types` provides type checks for different kinds of built-in objects. +Unlike `instanceof` or `Object.prototype.toString.call(value)`, these checks do +not inspect properties of the object that are accessible from JavaScript (like +their prototype), and usually have the overhead of calling into C++. The result generally does not make any guarantees about what kinds of properties or behavior a value exposes in JavaScript. They are primarily From 32a538901fe8c5a8a79a0b593467d0d4a3a0811e Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Fri, 25 Oct 2019 14:15:49 -0700 Subject: [PATCH 21/65] doc,n-api: sort bottom-of-the-page references Use `tail -n 102 doc/api/n-api.md | LC_ALL=C sort -u` to establish a systematic order for the references. PR-URL: https://github.com/nodejs/node/pull/30124 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: legendecas Reviewed-By: Trivikram Kamat --- doc/api/n-api.md | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index a17cb0c33e3b43..b95d98109e2ec3 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -5217,40 +5217,51 @@ idempotent. This API may only be called from the main thread. [ABI Stability]: https://nodejs.org/en/docs/guides/abi-stability/ +[AppVeyor]: https://www.appveyor.com +[C++ Addons]: addons.html +[CMake.js]: https://github.com/cmake-js/cmake-js +[CMake]: https://cmake.org [ECMAScript Language Specification]: https://tc39.github.io/ecma262/ [Error Handling]: #n_api_error_handling +[GCC]: https://gcc.gnu.org +[GYP]: https://gyp.gsrc.io +[GitHub releases]: https://help.github.com/en/github/administering-a-repository/about-releases +[LLVM]: https://llvm.org [Native Abstractions for Node.js]: https://github.com/nodejs/nan [Object Lifetime Management]: #n_api_object_lifetime_management [Object Wrap]: #n_api_object_wrap -[Section 6]: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values -[Section 6.1]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types -[Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type -[Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type -[Section 6.1.7]: https://tc39.github.io/ecma262/#sec-object-type -[Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2 -[Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations -[Section 7.1.2]: https://tc39.github.io/ecma262/#sec-toboolean -[Section 7.1.3]: https://tc39.github.io/ecma262/#sec-tonumber -[Section 7.1.13]: https://tc39.github.io/ecma262/#sec-toobject -[Section 7.2.2]: https://tc39.github.io/ecma262/#sec-isarray -[Section 7.2.14]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison -[Section 8.7]: https://tc39.es/ecma262/#sec-agents -[Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc -[Section 12.5.5]: https://tc39.github.io/ecma262/#sec-typeof-operator [Section 12.10.4]: https://tc39.github.io/ecma262/#sec-instanceofoperator +[Section 12.5.5]: https://tc39.github.io/ecma262/#sec-typeof-operator [Section 19.2]: https://tc39.github.io/ecma262/#sec-function-objects [Section 19.4]: https://tc39.github.io/ecma262/#sec-symbol-objects [Section 20.3]: https://tc39.github.io/ecma262/#sec-date-objects -[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects [Section 22.1.4.1]: https://tc39.github.io/ecma262/#sec-properties-of-array-instances-length +[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects [Section 22.2]: https://tc39.github.io/ecma262/#sec-typedarray-objects -[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects [Section 24.1.1.3]: https://tc39.es/ecma262/#sec-detacharraybuffer +[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects [Section 24.3]: https://tc39.github.io/ecma262/#sec-dataview-objects [Section 25.4]: https://tc39.github.io/ecma262/#sec-promise-objects -[`Number.MIN_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.min_safe_integer -[`Number.MAX_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.max_safe_integer +[Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type +[Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type +[Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2 +[Section 6.1.7]: https://tc39.github.io/ecma262/#sec-object-type +[Section 6.1]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types +[Section 6]: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values +[Section 7.1.13]: https://tc39.github.io/ecma262/#sec-toobject +[Section 7.1.2]: https://tc39.github.io/ecma262/#sec-toboolean +[Section 7.1.3]: https://tc39.github.io/ecma262/#sec-tonumber +[Section 7.2.14]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison +[Section 7.2.2]: https://tc39.github.io/ecma262/#sec-isarray +[Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations +[Section 8.7]: https://tc39.es/ecma262/#sec-agents +[Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc +[Travis CI]: https://travis-ci.org +[Visual Studio]: https://visualstudio.microsoft.com [Working with JavaScript Properties]: #n_api_working_with_javascript_properties +[Xcode]: https://developer.apple.com/xcode/ +[`Number.MAX_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.max_safe_integer +[`Number.MIN_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.min_safe_integer [`init` hooks]: async_hooks.html#async_hooks_init_asyncid_type_triggerasyncid_resource [`napi_add_finalizer`]: #n_api_napi_add_finalizer [`napi_async_init`]: #n_api_napi_async_init @@ -5294,27 +5305,16 @@ This API may only be called from the main thread. [`napi_throw`]: #n_api_napi_throw [`napi_unwrap`]: #n_api_napi_unwrap [`napi_wrap`]: #n_api_napi_wrap +[`node_api.h`]: https://github.com/nodejs/node/blob/master/src/node_api.h [`process.release`]: process.html#process_process_release [`uv_ref`]: http://docs.libuv.org/en/v1.x/handle.html#c.uv_ref [`uv_unref`]: http://docs.libuv.org/en/v1.x/handle.html#c.uv_unref [async_hooks `type`]: async_hooks.html#async_hooks_type [context-aware addons]: addons.html#addons_context_aware_addons -[node-addon-api]: https://github.com/nodejs/node-addon-api -[worker threads]: https://nodejs.org/api/worker_threads.html -[C++ Addons]: addons.html [docs]: https://github.com/nodejs/node-addon-api#api-documentation -[GCC]: https://gcc.gnu.org -[LLVM]: https://llvm.org -[Xcode]: https://developer.apple.com/xcode/ -[Visual Studio]: https://visualstudio.microsoft.com +[node-addon-api]: https://github.com/nodejs/node-addon-api [node-gyp]: https://github.com/nodejs/node-gyp -[GYP]: https://gyp.gsrc.io -[CMake.js]: https://github.com/cmake-js/cmake-js -[CMake]: https://cmake.org -[Travis CI]: https://travis-ci.org -[AppVeyor]: https://www.appveyor.com [node-pre-gyp]: https://github.com/mapbox/node-pre-gyp [prebuild]: https://github.com/prebuild/prebuild -[GitHub releases]: https://help.github.com/en/github/administering-a-repository/about-releases [prebuildify]: https://github.com/prebuild/prebuildify -[`node_api.h`]: https://github.com/nodejs/node/blob/master/src/node_api.h +[worker threads]: https://nodejs.org/api/worker_threads.html From 9a71091098fa4296a8387098abfc6f7ecfa6ef13 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Oct 2019 15:17:49 -0700 Subject: [PATCH 22/65] doc: revise os.md Revise os.md, mostly making it more concise. In one case, process.md was revised as well to be consistent with a revision in os.md. PR-URL: https://github.com/nodejs/node/pull/30102 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- doc/api/os.md | 202 +++++++++++++++------------------------------ doc/api/process.md | 8 +- 2 files changed, 68 insertions(+), 142 deletions(-) diff --git a/doc/api/os.md b/doc/api/os.md index 75a08dcfbfe087..b7eccda6786897 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -4,8 +4,8 @@ > Stability: 2 - Stable -The `os` module provides operating system-related utility methods. It can be -accessed using: +The `os` module provides operating system-related utility methods and +properties. It can be accessed using: ```js const os = require('os'); @@ -18,7 +18,7 @@ added: v0.7.8 * {string} -A string constant defining the operating system-specific end-of-line marker: +The operating system-specific end-of-line marker. * `\n` on POSIX * `\r\n` on Windows @@ -30,13 +30,11 @@ added: v0.5.0 * Returns: {string} -The `os.arch()` method returns a string identifying the operating system CPU -architecture for which the Node.js binary was compiled. - -The current possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`, +Returns the operating system CPU architecture for which the Node.js binary was +compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. -Equivalent to [`process.arch`][]. +The return value is equivalent to [`process.arch`][]. ## os.constants -The following signal constants are exported by `os.constants.signals`: +The following signal constants are exported by `os.constants.signals`. @@ -640,7 +568,7 @@ The following signal constants are exported by `os.constants.signals`: ### Error Constants -The following error constants are exported by `os.constants.errno`: +The following error constants are exported by `os.constants.errno`. #### POSIX Error Constants @@ -672,7 +600,7 @@ The following error constants are exported by `os.constants.errno`: - @@ -903,8 +831,8 @@ The following error constants are exported by `os.constants.errno`: - @@ -976,7 +904,7 @@ The following error constants are exported by `os.constants.errno`: #### Windows Specific Error Constants -The following error codes are specific to the Windows operating system: +The following error codes are specific to the Windows operating system.
EAGAINIndicates that there is currently no data available and to try the + Indicates that there is no data available and to try the operation again later.
EOPNOTSUPPIndicates that an operation is not supported on the socket. Note that - while ENOTSUP and EOPNOTSUPP have the same value + Indicates that an operation is not supported on the socket. Although + ENOTSUP and EOPNOTSUPP have the same value on Linux, according to POSIX.1 these error values should be distinct.)
@@ -1262,7 +1190,7 @@ added: v10.10.0 --> The following process scheduling constants are exported by -`os.constants.priority`: +`os.constants.priority`.
diff --git a/doc/api/process.md b/doc/api/process.md index a3fe44ba3c5ec1..718ab002d3ed90 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -551,11 +551,9 @@ added: v0.5.0 * {string} -The `process.arch` property returns a string identifying the operating system -CPU architecture for which the Node.js binary was compiled. - -The current possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`, -`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. +The operating system CPU architecture for which the Node.js binary was compiled. +Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, +`'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. ```js console.log(`This processor architecture is ${process.arch}`); From f3d00c594d9d6e1d8188aca9e7a33b247d48c69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 22 Oct 2019 15:07:21 +0200 Subject: [PATCH 23/65] deps: V8: backport 777fa98 Original commit message: Make SetSyntheticModuleExport throw instead of crash for nonexistent export name Per spec, Module::SetSyntheticModuleExport should throw a ReferenceError when called with an export name that was not supplied when constructing that SyntheticModule. Instead, the current implementation crashes with a failed CHECK(). Add a new Module::SyntheticModuleSetExport that throws (without an ensuing crash) for this case, and deprecate the old Module::SetSyntheticModuleExport. Bug: v8:9828 Change-Id: I3b3d353064c3851882781818099bd8f6ee74c809 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1860996 Reviewed-by: Adam Klein Reviewed-by: Georg Neis Commit-Queue: Dan Clark Cr-Commit-Position: refs/heads/master@{#64438} Refs: https://github.com/v8/v8/commit/777fa98cc47ac32f0fde3d9aafd830949deb5d23 PR-URL: https://github.com/nodejs/node/pull/30062 Reviewed-By: Anna Henningsen Reviewed-By: Gireesh Punathil Reviewed-By: Gus Caplan Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- common.gypi | 2 +- deps/v8/include/v8.h | 18 +++++++++---- deps/v8/src/api/api.cc | 28 ++++++++++++++++--- deps/v8/src/logging/counters.h | 1 + deps/v8/src/objects/synthetic-module.cc | 30 +++++++++++++++++---- deps/v8/src/objects/synthetic-module.h | 18 ++++++++++--- deps/v8/test/cctest/test-api.cc | 36 +++++++++++++++++++++++-- 7 files changed, 114 insertions(+), 19 deletions(-) diff --git a/common.gypi b/common.gypi index 44e41a9753babf..e6b189f957debb 100644 --- a/common.gypi +++ b/common.gypi @@ -39,7 +39,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.16', + 'v8_embedder_string': '-node.17', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index fa26d2dd36d9a1..9d0b6a6c65479e 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1440,11 +1440,19 @@ class V8_EXPORT Module { /** * Set this module's exported value for the name export_name to the specified * export_value. This method must be called only on Modules created via - * CreateSyntheticModule. export_name must be one of the export_names that - * were passed in that CreateSyntheticModule call. - */ - void SetSyntheticModuleExport(Local export_name, - Local export_value); + * CreateSyntheticModule. An error will be thrown if export_name is not one + * of the export_names that were passed in that CreateSyntheticModule call. + * Returns Just(true) on success, Nothing() if an error was thrown. + */ + V8_WARN_UNUSED_RESULT Maybe SetSyntheticModuleExport( + Isolate* isolate, Local export_name, Local export_value); + V8_DEPRECATE_SOON( + "Use the preceding SetSyntheticModuleExport with an Isolate parameter, " + "instead of the one that follows. The former will throw a runtime " + "error if called for an export that doesn't exist (as per spec); " + "the latter will crash with a failed CHECK().", + void SetSyntheticModuleExport(Local export_name, + Local export_value)); }; /** diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 30eceb6223377f..aa61346d63e33b 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -2362,6 +2362,28 @@ Local Module::CreateSyntheticModule( i_module_name, i_export_names, evaluation_steps))); } +Maybe Module::SetSyntheticModuleExport(Isolate* isolate, + Local export_name, + Local export_value) { + auto i_isolate = reinterpret_cast(isolate); + i::Handle i_export_name = Utils::OpenHandle(*export_name); + i::Handle i_export_value = Utils::OpenHandle(*export_value); + i::Handle self = Utils::OpenHandle(this); + Utils::ApiCheck(self->IsSyntheticModule(), + "v8::Module::SyntheticModuleSetExport", + "v8::Module::SyntheticModuleSetExport must only be called on " + "a SyntheticModule"); + ENTER_V8_NO_SCRIPT(i_isolate, isolate->GetCurrentContext(), Module, + SetSyntheticModuleExport, Nothing(), i::HandleScope); + has_pending_exception = + i::SyntheticModule::SetExport(i_isolate, + i::Handle::cast(self), + i_export_name, i_export_value) + .IsNothing(); + RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); + return Just(true); +} + void Module::SetSyntheticModuleExport(Local export_name, Local export_value) { i::Handle i_export_name = Utils::OpenHandle(*export_name); @@ -2371,9 +2393,9 @@ void Module::SetSyntheticModuleExport(Local export_name, "v8::Module::SetSyntheticModuleExport", "v8::Module::SetSyntheticModuleExport must only be called on " "a SyntheticModule"); - i::SyntheticModule::SetExport(self->GetIsolate(), - i::Handle::cast(self), - i_export_name, i_export_value); + i::SyntheticModule::SetExportStrict(self->GetIsolate(), + i::Handle::cast(self), + i_export_name, i_export_value); } namespace { diff --git a/deps/v8/src/logging/counters.h b/deps/v8/src/logging/counters.h index 4466e0a53bc6ca..35df5ec0384565 100644 --- a/deps/v8/src/logging/counters.h +++ b/deps/v8/src/logging/counters.h @@ -780,6 +780,7 @@ class RuntimeCallTimer final { V(Message_GetStartColumn) \ V(Module_Evaluate) \ V(Module_InstantiateModule) \ + V(Module_SetSyntheticModuleExport) \ V(NumberObject_New) \ V(NumberObject_NumberValue) \ V(Object_CallAsConstructor) \ diff --git a/deps/v8/src/objects/synthetic-module.cc b/deps/v8/src/objects/synthetic-module.cc index 0cca30a37b9e7f..850721ac99d303 100644 --- a/deps/v8/src/objects/synthetic-module.cc +++ b/deps/v8/src/objects/synthetic-module.cc @@ -17,16 +17,36 @@ namespace internal { // Implements SetSyntheticModuleBinding: // https://heycam.github.io/webidl/#setsyntheticmoduleexport -void SyntheticModule::SetExport(Isolate* isolate, - Handle module, - Handle export_name, - Handle export_value) { +Maybe SyntheticModule::SetExport(Isolate* isolate, + Handle module, + Handle export_name, + Handle export_value) { Handle exports(module->exports(), isolate); Handle export_object(exports->Lookup(export_name), isolate); - CHECK(export_object->IsCell()); + + if (!export_object->IsCell()) { + isolate->Throw(*isolate->factory()->NewReferenceError( + MessageTemplate::kModuleExportUndefined, export_name)); + return Nothing(); + } + Handle export_cell(Handle::cast(export_object)); // Spec step 2: Set the mutable binding of export_name to export_value export_cell->set_value(*export_value); + + return Just(true); +} + +void SyntheticModule::SetExportStrict(Isolate* isolate, + Handle module, + Handle export_name, + Handle export_value) { + Handle exports(module->exports(), isolate); + Handle export_object(exports->Lookup(export_name), isolate); + CHECK(export_object->IsCell()); + Maybe set_export_result = + SetExport(isolate, module, export_name, export_value); + CHECK(set_export_result.FromJust()); } // Implements Synthetic Module Record's ResolveExport concrete method: diff --git a/deps/v8/src/objects/synthetic-module.h b/deps/v8/src/objects/synthetic-module.h index 6f3bb0438e9597..77a6eed2761da6 100644 --- a/deps/v8/src/objects/synthetic-module.h +++ b/deps/v8/src/objects/synthetic-module.h @@ -24,9 +24,21 @@ class SyntheticModule DECL_VERIFIER(SyntheticModule) DECL_PRINTER(SyntheticModule) - static void SetExport(Isolate* isolate, Handle module, - Handle export_name, - Handle export_value); + // Set module's exported value for the specified export_name to the specified + // export_value. An error will be thrown if export_name is not one + // of the export_names that were supplied during module construction. + // Returns Just(true) on success, Nothing() if an error was thrown. + static Maybe SetExport(Isolate* isolate, Handle module, + Handle export_name, + Handle export_value); + // The following redundant method should be deleted when the deprecated + // version of v8::SetSyntheticModuleExport is removed. It differs from + // SetExport in that it crashes rather than throwing an error if the caller + // attempts to set an export_name that was not present during construction of + // the module. + static void SetExportStrict(Isolate* isolate, Handle module, + Handle export_name, + Handle export_value); using BodyDescriptor = SubclassBodyDescriptor< Module::BodyDescriptor, diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index 1a670a9b10f1f9..ae3cf3e8750383 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -23654,7 +23654,9 @@ v8::MaybeLocal SyntheticModuleEvaluationStepsCallbackFail( v8::MaybeLocal SyntheticModuleEvaluationStepsCallbackSetExport( Local context, Local module) { - module->SetSyntheticModuleExport(v8_str("test_export"), v8_num(42)); + Maybe set_export_result = module->SetSyntheticModuleExport( + context->GetIsolate(), v8_str("test_export"), v8_num(42)); + CHECK(set_export_result.FromJust()); return v8::Undefined(reinterpret_cast(context->GetIsolate())); } @@ -23861,7 +23863,9 @@ TEST(SyntheticModuleSetExports) { // undefined. CHECK(foo_cell->value().IsUndefined()); - module->SetSyntheticModuleExport(foo_string, bar_string); + Maybe set_export_result = + module->SetSyntheticModuleExport(isolate, foo_string, bar_string); + CHECK(set_export_result.FromJust()); // After setting the export the Cell should still have the same idenitity. CHECK_EQ(exports->Lookup(v8::Utils::OpenHandle(*foo_string)), *foo_cell); @@ -23872,6 +23876,34 @@ TEST(SyntheticModuleSetExports) { ->Equals(*v8::Utils::OpenHandle(*bar_string))); } +TEST(SyntheticModuleSetMissingExport) { + LocalContext env; + v8::Isolate* isolate = env->GetIsolate(); + auto i_isolate = reinterpret_cast(isolate); + v8::Isolate::Scope iscope(isolate); + v8::HandleScope scope(isolate); + v8::Local context = v8::Context::New(isolate); + v8::Context::Scope cscope(context); + + Local foo_string = v8_str("foo"); + Local bar_string = v8_str("bar"); + + Local module = CreateAndInstantiateSyntheticModule( + isolate, v8_str("SyntheticModuleSetExports-TestSyntheticModule"), context, + std::vector>(), + UnexpectedSyntheticModuleEvaluationStepsCallback); + + i::Handle i_module = + i::Handle::cast(v8::Utils::OpenHandle(*module)); + i::Handle exports(i_module->exports(), i_isolate); + + TryCatch try_catch(isolate); + Maybe set_export_result = + module->SetSyntheticModuleExport(isolate, foo_string, bar_string); + CHECK(set_export_result.IsNothing()); + CHECK(try_catch.HasCaught()); +} + TEST(SyntheticModuleEvaluationStepsNoThrow) { synthetic_module_callback_count = 0; LocalContext env; From d78e3176dd6226d577ba9734d27ba2090ea8880e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 22 Oct 2019 15:28:34 +0200 Subject: [PATCH 24/65] src: fix crash with SyntheticModule#setExport Use the new non-deprecated V8 API for that. PR-URL: https://github.com/nodejs/node/pull/30062 Reviewed-By: Anna Henningsen Reviewed-By: Gireesh Punathil Reviewed-By: Gus Caplan Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/module_wrap.cc | 2 +- test/parallel/test-vm-module-synthetic.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 46210520fcb990..4c4a1ce863849e 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -1500,7 +1500,7 @@ void ModuleWrap::SetSyntheticExport( Local export_value = args[1]; Local module = obj->module_.Get(isolate); - module->SetSyntheticModuleExport(export_name, export_value); + USE(module->SetSyntheticModuleExport(isolate, export_name, export_value)); } void ModuleWrap::Initialize(Local target, diff --git a/test/parallel/test-vm-module-synthetic.js b/test/parallel/test-vm-module-synthetic.js index 71df9bd2633daf..83a78f2f3f5ba2 100644 --- a/test/parallel/test-vm-module-synthetic.js +++ b/test/parallel/test-vm-module-synthetic.js @@ -36,8 +36,6 @@ const assert = require('assert'); }); } - // https://bugs.chromium.org/p/v8/issues/detail?id=9828 - /* { const s = new SyntheticModule([], () => {}); await s.link(() => {}); @@ -47,7 +45,6 @@ const assert = require('assert'); name: 'ReferenceError', }); } - */ { const s = new SyntheticModule([], () => {}); From 621eaf9ed510035266c0f1a1c3b087bb1426cdd4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 24 Oct 2019 15:19:07 -0700 Subject: [PATCH 25/65] doc: remove "it is important to" phrasing Instead of telling someone "It is important to do X", just tell them to "Do X." PR-URL: https://github.com/nodejs/node/pull/30108 Reviewed-By: Michael Dawson Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/addons.md | 13 ++++----- doc/api/child_process.md | 4 +-- doc/api/crypto.md | 8 ++--- doc/api/dgram.md | 2 +- doc/api/events.md | 6 ++-- doc/api/n-api.md | 29 +++++++++---------- doc/api/stream.md | 14 ++++----- doc/releases.md | 2 +- lib/_tls_common.js | 5 ++-- .../8_passing_wrapped/myobject.cc | 7 ++--- test/parallel/test-url-parse-format.js | 5 ++-- 11 files changed, 45 insertions(+), 50 deletions(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index 774be1a7aaab83..cf2798c3a43637 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -364,13 +364,12 @@ and load it instead. ## Native Abstractions for Node.js Each of the examples illustrated in this document make direct use of the -Node.js and V8 APIs for implementing Addons. It is important to understand -that the V8 API can, and has, changed dramatically from one V8 release to the -next (and one major Node.js release to the next). With each change, Addons may -need to be updated and recompiled in order to continue functioning. The Node.js -release schedule is designed to minimize the frequency and impact of such -changes but there is little that Node.js can do currently to ensure stability -of the V8 APIs. +Node.js and V8 APIs for implementing Addons. The V8 API can, and has, changed +dramatically from one V8 release to the next (and one major Node.js release to +the next). With each change, Addons may need to be updated and recompiled in +order to continue functioning. The Node.js release schedule is designed to +minimize the frequency and impact of such changes but there is little that +Node.js can do currently to ensure stability of the V8 APIs. The [Native Abstractions for Node.js][] (or `nan`) provide a set of tools that Addon developers are recommended to use to keep compatibility between past and diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 0f725f4fe1fe31..24dd6269f16674 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -361,7 +361,7 @@ returned [`ChildProcess`][] will have an additional communication channel built-in that allows messages to be passed back and forth between the parent and child. See [`subprocess.send()`][] for details. -It is important to keep in mind that spawned Node.js child processes are +Keep in mind that spawned Node.js child processes are independent of the parent with exception of the IPC communication channel that is established between the two. Each process has its own memory, with their own V8 instances. Because of the additional resource allocations @@ -955,7 +955,7 @@ The `'error'` event is emitted whenever: 3. Sending a message to the child process failed. The `'exit'` event may or may not fire after an error has occurred. When -listening to both the `'exit'` and `'error'` events, it is important to guard +listening to both the `'exit'` and `'error'` events, guard against accidentally invoking handler functions multiple times. See also [`subprocess.kill()`][] and [`subprocess.send()`][]. diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 68c8ba0bb3e787..83f91620a7bfcd 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1707,8 +1707,8 @@ Initialization vectors should be unpredictable and unique; ideally, they will be cryptographically random. They do not have to be secret: IVs are typically just added to ciphertext messages unencrypted. It may sound contradictory that something has to be unpredictable and unique, but does not have to be secret; -it is important to remember that an attacker must not be able to predict ahead -of time what a given IV will be. +remember that an attacker must not be able to predict ahead of time what a +given IV will be. ### crypto.createDecipher(algorithm, password\[, options\]) * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **Default:** `'utf8'` + * `bufferSize` {number} Number of directory entries that are buffered + internally when reading from the directory. Higher values lead to better + performance but higher memory usage. **Default:** `32` * `callback` {Function} * `err` {Error} * `dir` {fs.Dir} @@ -2645,11 +2652,18 @@ directory and subsequent read operations. ## fs.opendirSync(path\[, options\]) * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **Default:** `'utf8'` + * `bufferSize` {number} Number of directory entries that are buffered + internally when reading from the directory. Higher values lead to better + performance but higher memory usage. **Default:** `32` * Returns: {fs.Dir} Synchronously open a directory. See opendir(3). @@ -4829,11 +4843,18 @@ a colon, Node.js will open a file system stream, as described by ### fsPromises.opendir(path\[, options\]) * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **Default:** `'utf8'` + * `bufferSize` {number} Number of directory entries that are buffered + internally when reading from the directory. Higher values lead to better + performance but higher memory usage. **Default:** `32` * Returns: {Promise} containing {fs.Dir} Asynchronously open a directory. See opendir(3). diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js index fedd7ff8eddb2b..90ab31fe5abc73 100644 --- a/lib/internal/fs/dir.js +++ b/lib/internal/fs/dir.js @@ -21,6 +21,9 @@ const { getValidatedPath, handleErrorFromBinding } = require('internal/fs/utils'); +const { + validateUint32 +} = require('internal/validators'); const kDirHandle = Symbol('kDirHandle'); const kDirPath = Symbol('kDirPath'); @@ -39,9 +42,14 @@ class Dir { this[kDirPath] = path; this[kDirClosed] = false; - this[kDirOptions] = getOptions(options, { - encoding: 'utf8' - }); + this[kDirOptions] = { + bufferSize: 32, + ...getOptions(options, { + encoding: 'utf8' + }) + }; + + validateUint32(this[kDirOptions].bufferSize, 'options.bufferSize', true); this[kDirReadPromisified] = internalUtil.promisify(this[kDirReadImpl]).bind(this, false); @@ -88,6 +96,7 @@ class Dir { this[kDirHandle].read( this[kDirOptions].encoding, + this[kDirOptions].bufferSize, req ); } @@ -105,6 +114,7 @@ class Dir { const ctx = { path: this[kDirPath] }; const result = this[kDirHandle].read( this[kDirOptions].encoding, + this[kDirOptions].bufferSize, undefined, ctx ); diff --git a/src/node_dir.cc b/src/node_dir.cc index 382f00f56e627c..ffef27f4521403 100644 --- a/src/node_dir.cc +++ b/src/node_dir.cc @@ -36,6 +36,7 @@ using v8::Isolate; using v8::Local; using v8::MaybeLocal; using v8::Null; +using v8::Number; using v8::Object; using v8::ObjectTemplate; using v8::String; @@ -59,8 +60,8 @@ DirHandle::DirHandle(Environment* env, Local obj, uv_dir_t* dir) dir_(dir) { MakeWeak(); - dir_->nentries = arraysize(dirents_); - dir_->dirents = dirents_; + dir_->nentries = 0; + dir_->dirents = nullptr; } DirHandle* DirHandle::New(Environment* env, uv_dir_t* dir) { @@ -230,22 +231,31 @@ void DirHandle::Read(const FunctionCallbackInfo& args) { Isolate* isolate = env->isolate(); const int argc = args.Length(); - CHECK_GE(argc, 2); + CHECK_GE(argc, 3); const enum encoding encoding = ParseEncoding(isolate, args[0], UTF8); DirHandle* dir; ASSIGN_OR_RETURN_UNWRAP(&dir, args.Holder()); - FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); - if (req_wrap_async != nullptr) { // dir.read(encoding, req) + CHECK(args[1]->IsNumber()); + uint64_t buffer_size = args[1].As()->Value(); + + if (buffer_size != dir->dirents_.size()) { + dir->dirents_.resize(buffer_size); + dir->dir_->nentries = buffer_size; + dir->dir_->dirents = dir->dirents_.data(); + } + + FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); + if (req_wrap_async != nullptr) { // dir.read(encoding, bufferSize, req) AsyncCall(env, req_wrap_async, args, "readdir", encoding, AfterDirRead, uv_fs_readdir, dir->dir()); - } else { // dir.read(encoding, undefined, ctx) - CHECK_EQ(argc, 3); + } else { // dir.read(encoding, bufferSize, undefined, ctx) + CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_DIR_SYNC_TRACE_BEGIN(readdir); - int err = SyncCall(env, args[2], &req_wrap_sync, "readdir", uv_fs_readdir, + int err = SyncCall(env, args[3], &req_wrap_sync, "readdir", uv_fs_readdir, dir->dir()); FS_DIR_SYNC_TRACE_END(readdir); if (err < 0) { diff --git a/src/node_dir.h b/src/node_dir.h index 03e4a06efcecbe..ae6d0eb170d679 100644 --- a/src/node_dir.h +++ b/src/node_dir.h @@ -45,8 +45,8 @@ class DirHandle : public AsyncWrap { void GCClose(); uv_dir_t* dir_; - // Up to 32 directory entries are read through a single libuv call. - uv_dirent_t dirents_[32]; + // Multiple entries are read through a single libuv call. + std::vector dirents_; bool closing_ = false; bool closed_ = false; }; diff --git a/test/benchmark/test-benchmark-fs.js b/test/benchmark/test-benchmark-fs.js index 3168e6f0a0ce1f..cf382407235304 100644 --- a/test/benchmark/test-benchmark-fs.js +++ b/test/benchmark/test-benchmark-fs.js @@ -7,6 +7,7 @@ const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); runBenchmark('fs', [ + 'bufferSize=32', 'concurrent=1', 'dir=.github', 'dur=0.1', diff --git a/test/parallel/test-fs-opendir.js b/test/parallel/test-fs-opendir.js index f2c5d033451261..05fded527fe7f1 100644 --- a/test/parallel/test-fs-opendir.js +++ b/test/parallel/test-fs-opendir.js @@ -182,3 +182,26 @@ async function doAsyncIterThrowTest() { await assert.rejects(async () => dir.read(), dirclosedError); } doAsyncIterThrowTest().then(common.mustCall()); + +// Check error thrown on invalid values of bufferSize +for (const bufferSize of [-1, 0, 0.5, 1.5, Infinity, NaN]) { + assert.throws( + () => fs.opendirSync(testDir, { bufferSize }), + { + code: 'ERR_OUT_OF_RANGE' + }); +} +for (const bufferSize of ['', '1', null]) { + assert.throws( + () => fs.opendirSync(testDir, { bufferSize }), + { + code: 'ERR_INVALID_ARG_TYPE' + }); +} + +// Check that passing a positive integer as bufferSize works +{ + const dir = fs.opendirSync(testDir, { bufferSize: 1024 }); + assertDirent(dir.readSync()); + dir.close(); +} From d549a34597d8d9f8489de748e42eefdd148d0bef Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 25 Oct 2019 12:48:14 -0700 Subject: [PATCH 31/65] tools: update ESLint to 6.6.0 Update ESLint to 6.6.0 PR-URL: https://github.com/nodejs/node/pull/30123 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat --- tools/node_modules/eslint/README.md | 7 +- .../cascading-config-array-factory.js | 3 +- .../eslint/lib/cli-engine/cli-engine.js | 16 +- .../lib/cli-engine/config-array-factory.js | 8 +- .../cli-engine/config-array/config-array.js | 4 - .../config-array/config-dependency.js | 2 + .../config-array/override-tester.js | 2 + .../eslint/lib/cli-engine/file-enumerator.js | 8 +- .../eslint/lib/cli-engine/formatters/html.js | 1 + .../eslint/lib/cli-engine/ignored-paths.js | 1 + .../eslint/lib/init/autoconfig.js | 12 +- .../eslint/lib/init/config-file.js | 1 - .../eslint/lib/init/config-initializer.js | 1 - .../eslint/lib/init/config-rule.js | 6 +- .../node_modules/eslint/lib/init/npm-utils.js | 5 - .../code-path-analysis/code-path-analyzer.js | 62 ++- .../code-path-analysis/code-path-segment.js | 42 +- .../code-path-analysis/code-path-state.js | 121 ++---- .../linter/code-path-analysis/code-path.js | 21 +- .../code-path-analysis/debug-helpers.js | 20 +- .../linter/code-path-analysis/fork-context.js | 57 ++- .../linter/code-path-analysis/id-generator.js | 4 +- .../node_modules/eslint/lib/linter/linter.js | 216 +++++----- .../eslint/lib/linter/node-event-generator.js | 5 +- .../eslint/lib/rule-tester/rule-tester.js | 14 +- .../eslint/lib/rules/accessor-pairs.js | 16 +- .../eslint/lib/rules/array-bracket-newline.js | 27 +- .../eslint/lib/rules/array-bracket-spacing.js | 24 +- .../eslint/lib/rules/array-callback-return.js | 17 +- .../eslint/lib/rules/array-element-newline.js | 13 +- .../eslint/lib/rules/arrow-parens.js | 1 - .../eslint/lib/rules/block-scoped-var.js | 6 +- .../eslint/lib/rules/block-spacing.js | 8 +- .../eslint/lib/rules/capitalized-comments.js | 7 - .../lib/rules/class-methods-use-this.js | 6 +- .../eslint/lib/rules/comma-dangle.js | 38 +- .../eslint/lib/rules/comma-spacing.js | 2 +- .../lib/rules/computed-property-spacing.js | 20 +- .../eslint/lib/rules/consistent-return.js | 9 +- .../eslint/lib/rules/consistent-this.js | 10 +- .../eslint/lib/rules/constructor-super.js | 30 +- tools/node_modules/eslint/lib/rules/curly.js | 8 +- .../eslint/lib/rules/default-param-last.js | 1 + .../eslint/lib/rules/dot-location.js | 23 +- .../eslint/lib/rules/func-names.js | 12 +- .../rules/function-call-argument-newline.js | 10 +- .../lib/rules/generator-star-spacing.js | 13 +- .../eslint/lib/rules/getter-return.js | 11 +- tools/node_modules/eslint/lib/rules/indent.js | 4 +- .../eslint/lib/rules/init-declarations.js | 4 +- .../eslint/lib/rules/jsx-quotes.js | 2 +- .../eslint/lib/rules/keyword-spacing.js | 88 ++-- .../lib/rules/lines-around-directive.js | 2 +- .../node_modules/eslint/lib/rules/max-len.js | 5 - .../lib/rules/max-statements-per-line.js | 10 +- .../eslint/lib/rules/multiline-ternary.js | 6 +- .../eslint/lib/rules/newline-after-var.js | 13 +- .../eslint/lib/rules/newline-before-return.js | 17 +- .../lib/rules/newline-per-chained-call.js | 6 +- .../eslint/lib/rules/no-class-assign.js | 4 +- .../eslint/lib/rules/no-compare-neg-zero.js | 3 +- .../eslint/lib/rules/no-confusing-arrow.js | 4 +- .../eslint/lib/rules/no-console.js | 12 +- .../eslint/lib/rules/no-const-assign.js | 2 +- .../eslint/lib/rules/no-dupe-args.js | 2 +- .../eslint/lib/rules/no-dupe-class-members.js | 7 +- .../eslint/lib/rules/no-dupe-keys.js | 11 +- .../eslint/lib/rules/no-duplicate-imports.js | 32 +- .../eslint/lib/rules/no-else-return.js | 8 - .../eslint/lib/rules/no-empty-function.js | 6 +- .../node_modules/eslint/lib/rules/no-eval.js | 28 +- .../eslint/lib/rules/no-ex-assign.js | 2 +- .../eslint/lib/rules/no-extra-bind.js | 17 +- .../eslint/lib/rules/no-extra-boolean-cast.js | 2 - .../eslint/lib/rules/no-extra-label.js | 13 +- .../eslint/lib/rules/no-extra-parens.js | 32 +- .../eslint/lib/rules/no-extra-semi.js | 11 +- .../eslint/lib/rules/no-fallthrough.js | 12 +- .../eslint/lib/rules/no-func-assign.js | 6 +- .../eslint/lib/rules/no-global-assign.js | 8 +- .../eslint/lib/rules/no-implicit-coercion.js | 20 +- .../eslint/lib/rules/no-implied-eval.js | 1 - .../eslint/lib/rules/no-invalid-this.js | 4 +- .../eslint/lib/rules/no-labels.js | 9 +- .../eslint/lib/rules/no-lone-blocks.js | 2 +- .../eslint/lib/rules/no-loop-func.js | 17 +- .../eslint/lib/rules/no-magic-numbers.js | 12 +- .../rules/no-misleading-character-class.js | 21 +- .../eslint/lib/rules/no-mixed-operators.js | 35 +- .../eslint/lib/rules/no-mixed-requires.js | 1 - .../eslint/lib/rules/no-multi-spaces.js | 2 +- .../eslint/lib/rules/no-native-reassign.js | 8 +- .../eslint/lib/rules/no-param-reassign.js | 35 +- .../eslint/lib/rules/no-redeclare.js | 2 +- .../eslint/lib/rules/no-regex-spaces.js | 1 - .../eslint/lib/rules/no-restricted-imports.js | 22 +- .../eslint/lib/rules/no-self-assign.js | 25 +- .../eslint/lib/rules/no-sequences.js | 6 +- .../eslint/lib/rules/no-shadow.js | 5 +- .../node_modules/eslint/lib/rules/no-tabs.js | 10 +- .../eslint/lib/rules/no-this-before-super.js | 25 +- .../eslint/lib/rules/no-trailing-spaces.js | 26 +- .../lib/rules/no-unmodified-loop-condition.js | 45 +- .../eslint/lib/rules/no-unneeded-ternary.js | 6 +- .../eslint/lib/rules/no-unreachable.js | 14 +- .../eslint/lib/rules/no-unsafe-finally.js | 11 +- .../eslint/lib/rules/no-unsafe-negation.js | 41 +- .../eslint/lib/rules/no-unused-expressions.js | 18 +- .../eslint/lib/rules/no-unused-labels.js | 9 +- .../eslint/lib/rules/no-unused-vars.js | 51 +-- .../eslint/lib/rules/no-use-before-define.js | 25 +- .../eslint/lib/rules/no-useless-call.js | 8 +- .../eslint/lib/rules/no-useless-concat.js | 8 +- .../lib/rules/no-useless-constructor.js | 36 +- .../eslint/lib/rules/no-useless-escape.js | 8 +- .../eslint/lib/rules/no-useless-rename.js | 14 +- .../eslint/lib/rules/no-useless-return.js | 23 +- tools/node_modules/eslint/lib/rules/no-var.js | 37 +- .../eslint/lib/rules/no-warning-comments.js | 1 - .../rules/no-whitespace-before-property.js | 6 +- .../eslint/lib/rules/object-curly-newline.js | 17 +- .../eslint/lib/rules/object-curly-spacing.js | 27 +- .../eslint/lib/rules/object-shorthand.js | 2 +- .../lib/rules/one-var-declaration-per-line.js | 4 +- .../eslint/lib/rules/operator-assignment.js | 23 +- .../eslint/lib/rules/padded-blocks.js | 2 +- .../rules/padding-line-between-statements.js | 16 - .../eslint/lib/rules/prefer-arrow-callback.js | 12 +- .../eslint/lib/rules/prefer-const.js | 34 +- .../eslint/lib/rules/prefer-destructuring.js | 8 +- .../lib/rules/prefer-named-capture-group.js | 1 - .../lib/rules/prefer-numeric-literals.js | 36 +- .../eslint/lib/rules/prefer-object-spread.js | 14 +- .../eslint/lib/rules/prefer-rest-params.js | 9 +- .../eslint/lib/rules/prefer-spread.js | 8 +- .../eslint/lib/rules/prefer-template.js | 11 +- .../eslint/lib/rules/quote-props.js | 2 +- tools/node_modules/eslint/lib/rules/quotes.js | 11 +- tools/node_modules/eslint/lib/rules/radix.js | 15 +- .../eslint/lib/rules/require-await.js | 7 +- .../eslint/lib/rules/require-yield.js | 4 +- .../eslint/lib/rules/rest-spread-spacing.js | 2 +- .../eslint/lib/rules/sort-imports.js | 7 +- .../eslint/lib/rules/sort-keys.js | 4 +- .../eslint/lib/rules/space-before-blocks.js | 3 +- .../eslint/lib/rules/space-in-parens.js | 8 +- .../eslint/lib/rules/space-infix-ops.js | 10 +- .../eslint/lib/rules/spaced-comment.js | 33 +- tools/node_modules/eslint/lib/rules/strict.js | 6 +- .../eslint/lib/rules/symbol-description.js | 3 +- .../lib/rules/template-curly-spacing.js | 4 +- .../eslint/lib/rules/use-isnan.js | 43 +- .../eslint/lib/rules/utils/ast-utils.js | 134 +++--- .../eslint/lib/rules/utils/fix-tracker.js | 6 - .../lib/rules/utils/lazy-loading-rule-map.js | 1 - .../eslint/lib/rules/vars-on-top.js | 22 +- .../eslint/lib/shared/config-ops.js | 4 +- .../eslint/lib/shared/runtime-info.js | 16 +- .../eslint/lib/shared/traverser.js | 2 + .../eslint/lib/source-code/source-code.js | 16 +- .../backward-token-comment-cursor.js | 10 +- .../token-store/backward-token-cursor.js | 10 +- .../lib/source-code/token-store/cursors.js | 36 +- .../token-store/decorative-cursor.js | 2 +- .../source-code/token-store/filter-cursor.js | 4 +- .../forward-token-comment-cursor.js | 10 +- .../token-store/forward-token-cursor.js | 10 +- .../lib/source-code/token-store/index.js | 178 ++++---- .../source-code/token-store/limit-cursor.js | 4 +- .../token-store/padded-token-cursor.js | 14 +- .../source-code/token-store/skip-cursor.js | 4 +- .../lib/source-code/token-store/utils.js | 22 +- .../eslint/node_modules/acorn-jsx/README.md | 10 +- .../eslint/node_modules/acorn-jsx/index.js | 111 +++-- .../node_modules/acorn-jsx/package.json | 10 +- .../eslint/node_modules/ansi-escapes/index.js | 95 ++--- .../node_modules/ansi-escapes/package.json | 18 +- .../node_modules/ansi-escapes/readme.md | 28 +- .../eslint/node_modules/ansi-regex/index.js | 12 +- .../node_modules/ansi-regex/package.json | 8 +- .../eslint/node_modules/ansi-regex/readme.md | 41 ++ .../eslint/node_modules/cli-cursor/index.js | 32 +- .../eslint/node_modules/cli-cursor/license | 20 +- .../node_modules/cli-cursor/package.json | 20 +- .../eslint/node_modules/cli-cursor/readme.md | 26 +- .../eslint/node_modules/emoji-regex/README.md | 2 +- .../node_modules/emoji-regex/es2015/index.js | 2 +- .../node_modules/emoji-regex/es2015/text.js | 2 +- .../eslint/node_modules/emoji-regex/index.js | 2 +- .../node_modules/emoji-regex/package.json | 15 +- .../eslint/node_modules/emoji-regex/text.js | 2 +- .../eslint-plugin-markdown/README.md | 122 +++--- .../eslint-plugin-markdown/lib/index.js | 4 +- .../eslint-plugin-markdown/lib/processor.js | 172 ++++---- .../eslint-plugin-markdown/package.json | 5 +- .../node_modules/eslint-utils/README.md | 10 +- .../eslint/node_modules/eslint-utils/index.js | 56 ++- .../node_modules/eslint-utils/index.mjs | 56 ++- .../node_modules/eslint-utils/package.json | 35 +- .../eslint/node_modules/espree/lib/espree.js | 390 +++++++++--------- .../eslint/node_modules/espree/package.json | 6 +- .../eslint/node_modules/figures/index.js | 26 +- .../eslint/node_modules/figures/license | 20 +- .../eslint/node_modules/figures/package.json | 22 +- .../eslint/node_modules/figures/readme.md | 25 +- .../eslint/node_modules/glob/README.md | 2 + .../eslint/node_modules/glob/package.json | 2 +- .../eslint/node_modules/inquirer/README.md | 8 +- .../inquirer/lib/prompts/checkbox.js | 2 +- .../node_modules/inquirer/lib/utils/events.js | 3 +- .../eslint/node_modules/inquirer/package.json | 22 +- .../is-fullwidth-code-point/index.js | 46 ++- .../is-fullwidth-code-point/license | 20 +- .../is-fullwidth-code-point/package.json | 19 +- .../is-fullwidth-code-point/readme.md | 12 +- .../eslint/node_modules/mimic-fn/index.js | 10 +- .../eslint/node_modules/mimic-fn/package.json | 14 +- .../eslint/node_modules/mimic-fn/readme.md | 5 +- .../mute-stream/.nyc_output/33508.json | 1 - .../mute-stream/.nyc_output/33510.json | 1 - .../node_modules/mute-stream/package.json | 7 +- .../eslint/node_modules/onetime/index.js | 41 +- .../eslint/node_modules/onetime/license | 20 +- .../eslint/node_modules/onetime/package.json | 16 +- .../eslint/node_modules/onetime/readme.md | 35 +- .../node_modules/restore-cursor/index.js | 2 +- .../node_modules/restore-cursor/license | 20 +- .../node_modules/restore-cursor/package.json | 16 +- .../node_modules/restore-cursor/readme.md | 5 +- .../is-fullwidth-code-point/index.js | 46 +++ .../is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 54 +++ .../is-fullwidth-code-point/readme.md | 39 ++ .../eslint/node_modules/string-width/index.js | 17 +- .../node_modules/strip-ansi/index.js | 4 - .../node_modules/strip-ansi/package.json | 61 --- .../node_modules/strip-ansi/readme.md | 39 -- .../node_modules/string-width/package.json | 21 +- .../node_modules/string-width/readme.md | 8 +- .../node_modules/ansi-regex/index.js | 14 - .../node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 62 --- .../node_modules/ansi-regex/readme.md | 87 ---- .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../table/node_modules/emoji-regex/README.md | 73 ++++ .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../table/node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 55 +++ .../table/node_modules/emoji-regex/text.js | 6 + .../is-fullwidth-code-point/index.js | 46 +++ .../is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 54 +++ .../is-fullwidth-code-point/readme.md | 39 ++ .../strip-ansi => type-fest}/license | 0 .../node_modules/type-fest/package.json | 59 +++ .../eslint/node_modules/type-fest/readme.md | 118 ++++++ tools/node_modules/eslint/package.json | 13 +- 258 files changed, 3003 insertions(+), 2606 deletions(-) delete mode 100644 tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33508.json delete mode 100644 tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33510.json create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/license create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json create mode 100644 tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/index.js delete mode 100644 tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/package.json delete mode 100644 tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.js delete mode 100644 tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/license delete mode 100644 tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/package.json delete mode 100644 tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/readme.md create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/README.md create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/index.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/text.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/index.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/package.json create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/text.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/index.js create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/license create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/package.json create mode 100644 tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/readme.md rename tools/node_modules/eslint/node_modules/{string-width/node_modules/strip-ansi => type-fest}/license (100%) create mode 100644 tools/node_modules/eslint/node_modules/type-fest/package.json create mode 100644 tools/node_modules/eslint/node_modules/type-fest/readme.md diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index fbd99b12df19da..fd0c14668743bc 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -40,7 +40,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J ## Installation and Usage -Prerequisites: [Node.js](https://nodejs.org/) (`^8.10.0`, `^10.13.0`, or `>=11.10.1`), npm version 3+. +Prerequisites: [Node.js](https://nodejs.org/) (`^8.10.0`, `^10.13.0`, or `>=11.10.1`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.) You can install ESLint using npm: @@ -156,8 +156,9 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na * A new CLI capability is created. * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.). * A new formatter is created. + * `eslint:recommended` is updated and will result in strictly fewer errors (e.g., rule removals). * Major release (likely to break your lint build) - * `eslint:recommended` is updated. + * `eslint:recommended` is updated and may result in new errors (e.g., rule additions, most rule option updates). * A new option to an existing rule that results in ESLint reporting more errors by default. * An existing formatter is removed. * Part of the public API is removed or changed in an incompatible way. @@ -264,7 +265,7 @@ The following companies, organizations, and individuals support ESLint's ongoing

Gold Sponsors

Shopify Salesforce Badoo Airbnb Facebook Open Source

Silver Sponsors

AMP Project

Bronze Sponsors

-

Discord Mixpanel Free Icons by Icons8 UI UX Design Agencies clay VPS Server ThemeIsle TekHattan Marfeel Fire Stick Tricks JSHeroes

+

UI UX Design Agencies Bugsnag Stability Monitoring MiniTool Software Ltd Codacy Mixpanel VPS Server Free Icons by Icons8 Crosswordsolver clay Discord ThemeIsle TekHattan Marfeel Fire Stick Tricks JSHeroes

## Technology Sponsors diff --git a/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js b/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js index 13b240f12b3d9b..6c914ea491c1b4 100644 --- a/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js +++ b/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js @@ -152,8 +152,9 @@ function createCLIConfigArray({ */ class ConfigurationNotFoundError extends Error { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} directoryPath - The directory path. + * @param {string} directoryPath The directory path. */ constructor(directoryPath) { super(`No ESLint configuration found in ${directoryPath}.`); diff --git a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js b/tools/node_modules/eslint/lib/cli-engine/cli-engine.js index 3c67d33daa6413..8afd262708fa8b 100644 --- a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js +++ b/tools/node_modules/eslint/lib/cli-engine/cli-engine.js @@ -145,7 +145,7 @@ function validateFixTypes(fixTypes) { /** * It will calculate the error and warning count for collection of messages per file - * @param {LintMessage[]} messages - Collection of messages + * @param {LintMessage[]} messages Collection of messages * @returns {Object} Contains the stats * @private */ @@ -173,7 +173,7 @@ function calculateStatsPerFile(messages) { /** * It will calculate the error and warning count for collection of results from all files - * @param {LintResult[]} results - Collection of messages from all the files + * @param {LintResult[]} results Collection of messages from all the files * @returns {Object} Contains the stats * @private */ @@ -272,8 +272,8 @@ function verifyText({ /** * Returns result with warning by ignore settings - * @param {string} filePath - File path of checked code - * @param {string} baseDir - Absolute path of base directory + * @param {string} filePath File path of checked code + * @param {string} baseDir Absolute path of base directory * @returns {LintResult} Result with single warning * @private */ @@ -387,7 +387,6 @@ function isErrorMessage(message) { * name will be the `cacheFile/.cache_hashOfCWD` * * if cacheFile points to a file or looks like a file then in will just use that file - * * @param {string} cacheFile The name of file to be used to store the cache * @param {string} cwd Current working directory * @returns {string} the resolved path to the cache file @@ -568,7 +567,7 @@ class CLIEngine { }); const lintResultCache = options.cache ? new LintResultCache(cacheFilePath) : null; - const linter = new Linter(); + const linter = new Linter({ cwd: options.cwd }); /** @type {ConfigArray[]} */ const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()]; @@ -668,11 +667,14 @@ class CLIEngine { addPlugin(name, pluginObject) { const { additionalPluginPool, - configArrayFactory + configArrayFactory, + lastConfigArrays } = internalSlotsMap.get(this); additionalPluginPool.set(name, pluginObject); configArrayFactory.clearCache(); + lastConfigArrays.length = 1; + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); } /** diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js index 6e1ba1e02b964c..cf529b6ee6313e 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js @@ -859,8 +859,14 @@ class ConfigArrayFactory { if (filePath) { try { writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require(filePath); + + debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + return new ConfigDependency({ - definition: normalizePlugin(require(filePath)), + definition: normalizePlugin(pluginDefinition), filePath, id, importerName, diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js b/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js index 6383c02115f98d..089ff305a2ba44 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js @@ -126,7 +126,6 @@ function isNonNullObject(x) { * * Assign every property values of `y` to `x` if `x` doesn't have the property. * If `x`'s property value is an object, it does recursive. - * * @param {Object} target The destination to merge * @param {Object|undefined} source The source to merge. * @returns {void} @@ -157,7 +156,6 @@ function mergeWithoutOverwrite(target, source) { /** * Merge plugins. * `target`'s definition is prior to `source`'s. - * * @param {Record} target The destination to merge * @param {Record|undefined} source The source to merge. * @returns {void} @@ -187,7 +185,6 @@ function mergePlugins(target, source) { /** * Merge rule configs. * `target`'s definition is prior to `source`'s. - * * @param {Record} target The destination to merge * @param {Record|undefined} source The source to merge. * @returns {void} @@ -382,7 +379,6 @@ function ensurePluginMemberMaps(instance) { * You need to call `ConfigArray#extractConfig(filePath)` method in order to * extract, merge and get only the config data which is related to an arbitrary * file. - * * @extends {Array} */ class ConfigArray extends Array { diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js b/tools/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js index 8db9ff00c5c287..0d5f6f71395eab 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js @@ -81,6 +81,7 @@ class ConfigDependency { this.importerPath = importerPath; } + // eslint-disable-next-line jsdoc/require-description /** * @returns {Object} a JSON compatible object. */ @@ -95,6 +96,7 @@ class ConfigDependency { return obj; } + // eslint-disable-next-line jsdoc/require-description /** * @returns {Object} an object to display by `console.log()`. */ diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/override-tester.js b/tools/node_modules/eslint/lib/cli-engine/config-array/override-tester.js index d6695423e25eb9..67c8a6ed8a0cbb 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array/override-tester.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array/override-tester.js @@ -166,6 +166,7 @@ class OverrideTester { )); } + // eslint-disable-next-line jsdoc/require-description /** * @returns {Object} a JSON compatible object. */ @@ -182,6 +183,7 @@ class OverrideTester { }; } + // eslint-disable-next-line jsdoc/require-description /** * @returns {Object} an object to display by `console.log()`. */ diff --git a/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js b/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js index a027359ae511b1..38f55de039d6d1 100644 --- a/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js +++ b/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js @@ -149,9 +149,10 @@ function readdirSafeSync(directoryPath) { */ class NoFilesFoundError extends Error { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} pattern - The glob pattern which was not found. - * @param {boolean} globDisabled - If `true` then the pattern was a glob pattern, but glob was disabled. + * @param {string} pattern The glob pattern which was not found. + * @param {boolean} globDisabled If `true` then the pattern was a glob pattern, but glob was disabled. */ constructor(pattern, globDisabled) { super(`No files matching '${pattern}' were found${globDisabled ? " (glob was disabled)" : ""}.`); @@ -165,8 +166,9 @@ class NoFilesFoundError extends Error { */ class AllFilesIgnoredError extends Error { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} pattern - The glob pattern which was not found. + * @param {string} pattern The glob pattern which was not found. */ constructor(pattern) { super(`All files matched by '${pattern}' are ignored.`); diff --git a/tools/node_modules/eslint/lib/cli-engine/formatters/html.js b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js index 091eab1c4ad772..69f7395550f2e2 100644 --- a/tools/node_modules/eslint/lib/cli-engine/formatters/html.js +++ b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -96,6 +96,7 @@ function renderMessages(messages, parentIndex, rulesMeta) { }).join("\n"); } +// eslint-disable-next-line jsdoc/require-description /** * @param {Array} results Test results. * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. diff --git a/tools/node_modules/eslint/lib/cli-engine/ignored-paths.js b/tools/node_modules/eslint/lib/cli-engine/ignored-paths.js index 12dfce06665eef..dec8e1860420e2 100644 --- a/tools/node_modules/eslint/lib/cli-engine/ignored-paths.js +++ b/tools/node_modules/eslint/lib/cli-engine/ignored-paths.js @@ -121,6 +121,7 @@ function relativize(globPattern, relativePathToOldBaseDir) { */ class IgnoredPaths { + // eslint-disable-next-line jsdoc/require-description /** * @param {Object} providedOptions object containing 'ignore', 'ignorePath' and 'patterns' properties */ diff --git a/tools/node_modules/eslint/lib/init/autoconfig.js b/tools/node_modules/eslint/lib/init/autoconfig.js index 19c4986c31bbfe..64be3d2a84f49b 100644 --- a/tools/node_modules/eslint/lib/init/autoconfig.js +++ b/tools/node_modules/eslint/lib/init/autoconfig.js @@ -31,7 +31,6 @@ const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only /** * Information about a rule configuration, in the context of a Registry. - * * @typedef {Object} registryItem * @param {ruleConfig} config A valid configuration for the rule * @param {number} specificity The number of elements in the ruleConfig array @@ -70,6 +69,7 @@ function makeRegistryItems(rulesConfig) { */ class Registry { + // eslint-disable-next-line jsdoc/require-description /** * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations */ @@ -82,7 +82,6 @@ class Registry { * * It will set the registry's `rule` property to an object having rule names * as keys and an array of registryItems as values. - * * @returns {void} */ populateFromCoreRules() { @@ -101,7 +100,6 @@ class Registry { * configurations. * * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. - * * @returns {Object[]} "rules" configurations to use for linting */ buildRuleSets() { @@ -114,7 +112,6 @@ class Registry { * * This is broken out into its own function so that it doesn't need to be * created inside of the while loop. - * * @param {string} rule The ruleId to add. * @returns {void} */ @@ -162,7 +159,6 @@ class Registry { * * Note: this also removes rule configurations which were not linted * (meaning, they have an undefined errorCount). - * * @returns {void} */ stripFailingConfigs() { @@ -185,7 +181,6 @@ class Registry { /** * Removes rule configurations which were not included in a ruleSet - * * @returns {void} */ stripExtraConfigs() { @@ -204,7 +199,6 @@ class Registry { * Creates a registry of rules which had no error-free configs. * The new registry is intended to be analyzed to determine whether its rules * should be disabled or set to warning. - * * @returns {Registry} A registry of failing rules. */ getFailingRulesRegistry() { @@ -225,7 +219,6 @@ class Registry { /** * Create an eslint config for any rules which only have one configuration * in the registry. - * * @returns {Object} An eslint config with rules section populated */ createConfig() { @@ -243,7 +236,6 @@ class Registry { /** * Return a cloned registry containing only configs with a desired specificity - * * @param {number} specificity Only keep configs with this specificity * @returns {Registry} A registry of rules */ @@ -261,7 +253,6 @@ class Registry { /** * Lint SourceCodes against all configurations in the registry, and record results - * * @param {Object[]} sourceCodes SourceCode objects for each filename * @param {Object} config ESLint config object * @param {progressCallback} [cb] Optional callback for reporting execution status @@ -327,7 +318,6 @@ class Registry { * * This will return a new config with `"extends": "eslint:recommended"` and * only the rules which have configurations different from the recommended config. - * * @param {Object} config config object * @returns {Object} config object using `"extends": "eslint:recommended"` */ diff --git a/tools/node_modules/eslint/lib/init/config-file.js b/tools/node_modules/eslint/lib/init/config-file.js index 77f14a47299cde..960b572cddb3ea 100644 --- a/tools/node_modules/eslint/lib/init/config-file.js +++ b/tools/node_modules/eslint/lib/init/config-file.js @@ -23,7 +23,6 @@ const debug = require("debug")("eslint:config-file"); * Determines sort order for object keys for json-stable-stringify * * see: https://github.com/samn/json-stable-stringify#cmp - * * @param {Object} a The first comparison object ({key: akey, value: avalue}) * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) * @returns {number} 1 or -1, used in stringify cmp method diff --git a/tools/node_modules/eslint/lib/init/config-initializer.js b/tools/node_modules/eslint/lib/init/config-initializer.js index 2e47e902c7782e..48e56ce526131a 100644 --- a/tools/node_modules/eslint/lib/init/config-initializer.js +++ b/tools/node_modules/eslint/lib/init/config-initializer.js @@ -147,7 +147,6 @@ function getModulesList(config, installESLint) { * * Note: This clones the config object and returns a new config to avoid mutating * the original config parameter. - * * @param {Object} answers answers received from inquirer * @param {Object} config config object * @returns {Object} config object with configured rules diff --git a/tools/node_modules/eslint/lib/init/config-rule.js b/tools/node_modules/eslint/lib/init/config-rule.js index e40feb7145b0cf..7aec89c3df004f 100644 --- a/tools/node_modules/eslint/lib/init/config-rule.js +++ b/tools/node_modules/eslint/lib/init/config-rule.js @@ -33,7 +33,6 @@ function explodeArray(xs) { * * For example: * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] - * * @param {Array} arr1 The first array to combine. * @param {Array} arr2 The second array to combine. * @returns {Array} A mixture of the elements of the first and second arrays. @@ -71,7 +70,6 @@ function combineArrays(arr1, arr2) { * [{before: true}, {before: false}], * [{after: true}, {after: false}] * ] - * * @param {Object[]} objects Array of objects, each with one property/value pair * @returns {Array[]} Array of arrays of objects grouped by property */ @@ -98,7 +96,6 @@ function groupByProperty(objects) { * element in the array is the severity, and is the only required element. * Configs may also have one or more additional elements to specify rule * configuration or options. - * * @typedef {Array|number} ruleConfig * @param {number} 0 The rule's severity (0, 1, 2). */ @@ -134,7 +131,6 @@ function groupByProperty(objects) { * {before: false, after: true}, * {before: false, after: false} * ] - * * @param {Object[]} objArr1 Single key/value objects, all with the same key * @param {Object[]} objArr2 Single key/value objects, all with another key * @returns {Object[]} Combined objects for each combination of input properties and values @@ -178,6 +174,7 @@ function combinePropertyObjects(objArr1, objArr2) { */ class RuleConfigSet { + // eslint-disable-next-line jsdoc/require-description /** * @param {ruleConfig[]} configs Valid rule configurations */ @@ -193,7 +190,6 @@ class RuleConfigSet { /** * Add a severity level to the front of all configs in the instance. * This should only be called after all configs have been added to the instance. - * * @returns {void} */ addErrorSeverity() { diff --git a/tools/node_modules/eslint/lib/init/npm-utils.js b/tools/node_modules/eslint/lib/init/npm-utils.js index 3d4a896b6f6e51..28c198fc8ada67 100644 --- a/tools/node_modules/eslint/lib/init/npm-utils.js +++ b/tools/node_modules/eslint/lib/init/npm-utils.js @@ -21,7 +21,6 @@ const fs = require("fs"), /** * Find the closest package.json file, starting at process.cwd (by default), * and working up to root. - * * @param {string} [startDir=process.cwd()] Starting directory * @returns {string} Absolute path to closest package.json file */ @@ -88,7 +87,6 @@ function fetchPeerDependencies(packageName) { /** * Check whether node modules are include in a project's package.json. - * * @param {string[]} packages Array of node module names * @param {Object} opt Options Object * @param {boolean} opt.dependencies Set to true to check for direct dependencies @@ -136,7 +134,6 @@ function check(packages, opt) { * package.json. * * Convenience wrapper around check(). - * * @param {string[]} packages Array of node modules to check. * @param {string} rootDir The directory contianing a package.json * @returns {Object} An object whose keys are the module names @@ -151,7 +148,6 @@ function checkDeps(packages, rootDir) { * package.json. * * Convenience wrapper around check(). - * * @param {string[]} packages Array of node modules to check. * @returns {Object} An object whose keys are the module names * and values are booleans indicating installation. @@ -162,7 +158,6 @@ function checkDevDeps(packages) { /** * Check whether package.json is found in current path. - * * @param {string} [startDir] Starting directory * @returns {boolean} Whether a package.json is found in current path. */ diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js index 821477aef9933c..6822ae2be0a6cd 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -22,8 +22,7 @@ const assert = require("assert"), /** * Checks whether or not a given node is a `case` node (not `default` node). - * - * @param {ASTNode} node - A `SwitchCase` node to check. + * @param {ASTNode} node A `SwitchCase` node to check. * @returns {boolean} `true` if the node is a `case` node (not `default` node). */ function isCaseNode(node) { @@ -33,8 +32,7 @@ function isCaseNode(node) { /** * Checks whether the given logical operator is taken into account for the code * path analysis. - * - * @param {string} operator - The operator found in the LogicalExpression node + * @param {string} operator The operator found in the LogicalExpression node * @returns {boolean} `true` if the operator is "&&" or "||" */ function isHandledLogicalOperator(operator) { @@ -43,8 +41,7 @@ function isHandledLogicalOperator(operator) { /** * Gets the label if the parent node of a given node is a LabeledStatement. - * - * @param {ASTNode} node - A node to get. + * @param {ASTNode} node A node to get. * @returns {string|null} The label or `null`. */ function getLabel(node) { @@ -57,8 +54,7 @@ function getLabel(node) { /** * Checks whether or not a given logical expression node goes different path * between the `true` case and the `false` case. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a test of a choice statement. */ function isForkingByTrueOrFalse(node) { @@ -86,8 +82,7 @@ function isForkingByTrueOrFalse(node) { * This is used to detect infinity loops (e.g. `while (true) {}`). * Statements preceded by an infinity loop are unreachable if the loop didn't * have any `break` statement. - * - * @param {ASTNode} node - A node to get. + * @param {ASTNode} node A node to get. * @returns {boolean|undefined} a boolean value if the node is a Literal node, * otherwise `undefined`. */ @@ -102,8 +97,7 @@ function getBooleanValueIfSimpleConstant(node) { * Checks that a given identifier node is a reference or not. * * This is used to detect the first throwable node in a `try` block. - * - * @param {ASTNode} node - An Identifier node to check. + * @param {ASTNode} node An Identifier node to check. * @returns {boolean} `true` if the node is a reference. */ function isIdentifierReference(node) { @@ -153,9 +147,8 @@ function isIdentifierReference(node) { * * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd" * events are fired. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function forwardCurrentToHead(analyzer, node) { @@ -211,9 +204,8 @@ function forwardCurrentToHead(analyzer, node) { /** * Updates the current segment with empty. * This is called at the last of functions or the program. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function leaveFromCurrentSegment(analyzer, node) { @@ -242,9 +234,8 @@ function leaveFromCurrentSegment(analyzer, node) { * * For example, if the node is `parent.consequent`, this creates a fork from the * current path. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function preprocess(analyzer, node) { @@ -352,9 +343,8 @@ function preprocess(analyzer, node) { /** * Updates the code path due to the type of a given node in entering. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function processCodePathToEnter(analyzer, node) { @@ -449,9 +439,8 @@ function processCodePathToEnter(analyzer, node) { /** * Updates the code path due to the type of a given node in leaving. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function processCodePathToExit(analyzer, node) { @@ -563,9 +552,8 @@ function processCodePathToExit(analyzer, node) { /** * Updates the code path to finalize the current code path. - * - * @param {CodePathAnalyzer} analyzer - The instance. - * @param {ASTNode} node - The current AST node. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. * @returns {void} */ function postprocess(analyzer, node) { @@ -609,8 +597,9 @@ function postprocess(analyzer, node) { */ class CodePathAnalyzer { + // eslint-disable-next-line jsdoc/require-description /** - * @param {EventGenerator} eventGenerator - An event generator to wrap. + * @param {EventGenerator} eventGenerator An event generator to wrap. */ constructor(eventGenerator) { this.original = eventGenerator; @@ -624,8 +613,7 @@ class CodePathAnalyzer { /** * Does the process to enter a given AST node. * This updates state of analysis and calls `enterNode` of the wrapped. - * - * @param {ASTNode} node - A node which is entering. + * @param {ASTNode} node A node which is entering. * @returns {void} */ enterNode(node) { @@ -651,8 +639,7 @@ class CodePathAnalyzer { /** * Does the process to leave a given AST node. * This updates state of analysis and calls `leaveNode` of the wrapped. - * - * @param {ASTNode} node - A node which is leaving. + * @param {ASTNode} node A node which is leaving. * @returns {void} */ leaveNode(node) { @@ -676,9 +663,8 @@ class CodePathAnalyzer { /** * This is called on a code path looped. * Then this raises a looped event. - * - * @param {CodePathSegment} fromSegment - A segment of prev. - * @param {CodePathSegment} toSegment - A segment of next. + * @param {CodePathSegment} fromSegment A segment of prev. + * @param {CodePathSegment} toSegment A segment of next. * @returns {void} */ onLooped(fromSegment, toSegment) { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js index 8145f9280162bb..6b17b25c7fdffd 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -17,8 +17,7 @@ const debug = require("./debug-helpers"); /** * Checks whether or not a given segment is reachable. - * - * @param {CodePathSegment} segment - A segment to check. + * @param {CodePathSegment} segment A segment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -34,11 +33,12 @@ function isReachable(segment) { */ class CodePathSegment { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} id - An identifier. - * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * This array includes unreachable segments. - * @param {boolean} reachable - A flag which shows this is reachable. + * @param {boolean} reachable A flag which shows this is reachable. */ constructor(id, allPrevSegments, reachable) { @@ -98,8 +98,7 @@ class CodePathSegment { /** * Checks a given previous segment is coming from the end of a loop. - * - * @param {CodePathSegment} segment - A previous segment to check. + * @param {CodePathSegment} segment A previous segment to check. * @returns {boolean} `true` if the segment is coming from the end of a loop. */ isLoopedPrevSegment(segment) { @@ -108,8 +107,7 @@ class CodePathSegment { /** * Creates the root segment. - * - * @param {string} id - An identifier. + * @param {string} id An identifier. * @returns {CodePathSegment} The created segment. */ static newRoot(id) { @@ -118,9 +116,8 @@ class CodePathSegment { /** * Creates a segment that follows given segments. - * - * @param {string} id - An identifier. - * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * @returns {CodePathSegment} The created segment. */ static newNext(id, allPrevSegments) { @@ -133,9 +130,8 @@ class CodePathSegment { /** * Creates an unreachable segment that follows given segments. - * - * @param {string} id - An identifier. - * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * @returns {CodePathSegment} The created segment. */ static newUnreachable(id, allPrevSegments) { @@ -154,9 +150,8 @@ class CodePathSegment { * Creates a segment that follows given segments. * This factory method does not connect with `allPrevSegments`. * But this inherits `reachable` flag. - * - * @param {string} id - An identifier. - * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * @returns {CodePathSegment} The created segment. */ static newDisconnected(id, allPrevSegments) { @@ -167,8 +162,7 @@ class CodePathSegment { * Makes a given segment being used. * * And this function registers the segment into the previous segments as a next. - * - * @param {CodePathSegment} segment - A segment to mark. + * @param {CodePathSegment} segment A segment to mark. * @returns {void} */ static markUsed(segment) { @@ -195,9 +189,8 @@ class CodePathSegment { /** * Marks a previous segment as looped. - * - * @param {CodePathSegment} segment - A segment. - * @param {CodePathSegment} prevSegment - A previous segment to mark. + * @param {CodePathSegment} segment A segment. + * @param {CodePathSegment} prevSegment A previous segment to mark. * @returns {void} */ static markPrevSegmentAsLooped(segment, prevSegment) { @@ -206,8 +199,7 @@ class CodePathSegment { /** * Replaces unused segments with the previous segments of each unused segment. - * - * @param {CodePathSegment[]} segments - An array of segments to replace. + * @param {CodePathSegment[]} segments An array of segments to replace. * @returns {CodePathSegment[]} The replaced array. */ static flattenUnusedSegments(segments) { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js index 57da10fa915a36..75de1bc6ce4c4a 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -22,11 +22,10 @@ const CodePathSegment = require("./code-path-segment"), * array as well. * * This adds only reachable and used segments. - * - * @param {CodePathSegment[]} dest - A destination array (`returnedSegments` or `thrownSegments`). - * @param {CodePathSegment[]} others - Another destination array (`returnedSegments` or `thrownSegments`). - * @param {CodePathSegment[]} all - The unified destination array (`finalSegments`). - * @param {CodePathSegment[]} segments - Segments to add. + * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} all The unified destination array (`finalSegments`). + * @param {CodePathSegment[]} segments Segments to add. * @returns {void} */ function addToReturnedOrThrown(dest, others, all, segments) { @@ -42,9 +41,8 @@ function addToReturnedOrThrown(dest, others, all, segments) { /** * Gets a loop-context for a `continue` statement. - * - * @param {CodePathState} state - A state to get. - * @param {string} label - The label of a `continue` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `continue` statement. * @returns {LoopContext} A loop-context for a `continue` statement. */ function getContinueContext(state, label) { @@ -67,9 +65,8 @@ function getContinueContext(state, label) { /** * Gets a context for a `break` statement. - * - * @param {CodePathState} state - A state to get. - * @param {string} label - The label of a `break` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `break` statement. * @returns {LoopContext|SwitchContext} A context for a `break` statement. */ function getBreakContext(state, label) { @@ -88,8 +85,7 @@ function getBreakContext(state, label) { /** * Gets a context for a `return` statement. - * - * @param {CodePathState} state - A state to get. + * @param {CodePathState} state A state to get. * @returns {TryContext|CodePathState} A context for a `return` statement. */ function getReturnContext(state) { @@ -107,8 +103,7 @@ function getReturnContext(state) { /** * Gets a context for a `throw` statement. - * - * @param {CodePathState} state - A state to get. + * @param {CodePathState} state A state to get. * @returns {TryContext|CodePathState} A context for a `throw` statement. */ function getThrowContext(state) { @@ -128,9 +123,8 @@ function getThrowContext(state) { /** * Removes a given element from a given array. - * - * @param {any[]} xs - An array to remove the specific element. - * @param {any} x - An element to be removed. + * @param {any[]} xs An array to remove the specific element. + * @param {any} x An element to be removed. * @returns {void} */ function remove(xs, x) { @@ -143,9 +137,8 @@ function remove(xs, x) { * This is used in a process for switch statements. * If there is the "default" chunk before other cases, the order is different * between node's and running's. - * - * @param {CodePathSegment[]} prevSegments - Forward segments to disconnect. - * @param {CodePathSegment[]} nextSegments - Backward segments to disconnect. + * @param {CodePathSegment[]} prevSegments Forward segments to disconnect. + * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. * @returns {void} */ function removeConnection(prevSegments, nextSegments) { @@ -162,10 +155,9 @@ function removeConnection(prevSegments, nextSegments) { /** * Creates looping path. - * - * @param {CodePathState} state - The instance. - * @param {CodePathSegment[]} unflattenedFromSegments - Segments which are source. - * @param {CodePathSegment[]} unflattenedToSegments - Segments which are destination. + * @param {CodePathState} state The instance. + * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. + * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. * @returns {void} */ function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { @@ -200,10 +192,9 @@ function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { * * - Adds `false` paths to paths which are leaving from the loop. * - Sets `true` paths to paths which go to the body. - * - * @param {LoopContext} context - A loop context to modify. - * @param {ChoiceContext} choiceContext - A choice context of this loop. - * @param {CodePathSegment[]} head - The current head paths. + * @param {LoopContext} context A loop context to modify. + * @param {ChoiceContext} choiceContext A choice context of this loop. + * @param {CodePathSegment[]} head The current head paths. * @returns {void} */ function finalizeTestSegmentsOfFor(context, choiceContext, head) { @@ -227,10 +218,11 @@ function finalizeTestSegmentsOfFor(context, choiceContext, head) { */ class CodePathState { + // eslint-disable-next-line jsdoc/require-description /** - * @param {IdGenerator} idGenerator - An id generator to generate id for code + * @param {IdGenerator} idGenerator An id generator to generate id for code * path segments. - * @param {Function} onLooped - A callback function to notify looping. + * @param {Function} onLooped A callback function to notify looping. */ constructor(idGenerator, onLooped) { this.idGenerator = idGenerator; @@ -275,8 +267,7 @@ class CodePathState { /** * Creates and stacks new forking context. - * - * @param {boolean} forkLeavingPath - A flag which shows being in a + * @param {boolean} forkLeavingPath A flag which shows being in a * "finally" block. * @returns {ForkContext} The created context. */ @@ -313,7 +304,6 @@ class CodePathState { /** * Creates a bypass path. * This is used for such as IfStatement which does not have "else" chunk. - * * @returns {void} */ forkBypassPath() { @@ -346,12 +336,11 @@ class CodePathState { * a -> foo(); * a -> b -> foo(); * a -> b -> bar(); - * - * @param {string} kind - A kind string. + * @param {string} kind A kind string. * If the new context is LogicalExpression's, this is `"&&"` or `"||"`. * If it's IfStatement's or ConditionalExpression's, this is `"test"`. * Otherwise, this is `"loop"`. - * @param {boolean} isForkingAsResult - A flag that shows that goes different + * @param {boolean} isForkingAsResult A flag that shows that goes different * paths between `true` and `false`. * @returns {void} */ @@ -368,7 +357,6 @@ class CodePathState { /** * Pops the last choice context and finalizes it. - * * @returns {ChoiceContext} The popped context. */ popChoiceContext() { @@ -456,7 +444,6 @@ class CodePathState { /** * Makes a code path segment of the right-hand operand of a logical * expression. - * * @returns {void} */ makeLogicalRight() { @@ -500,7 +487,6 @@ class CodePathState { /** * Makes a code path segment of the `if` block. - * * @returns {void} */ makeIfConsequent() { @@ -527,7 +513,6 @@ class CodePathState { /** * Makes a code path segment of the `else` block. - * * @returns {void} */ makeIfAlternate() { @@ -554,10 +539,9 @@ class CodePathState { /** * Creates a context object of SwitchStatement and stacks it. - * - * @param {boolean} hasCase - `true` if the switch statement has one or more + * @param {boolean} hasCase `true` if the switch statement has one or more * case parts. - * @param {string|null} label - The label text. + * @param {string|null} label The label text. * @returns {void} */ pushSwitchContext(hasCase, label) { @@ -581,7 +565,6 @@ class CodePathState { * - Creates the next code path segment from `context.brokenForkContext`. * - If the last `SwitchCase` node is not a `default` part, creates a path * to the `default` body. - * * @returns {void} */ popSwitchContext() { @@ -655,9 +638,8 @@ class CodePathState { /** * Makes a code path segment for a `SwitchCase` node. - * - * @param {boolean} isEmpty - `true` if the body is empty. - * @param {boolean} isDefault - `true` if the body is the default case. + * @param {boolean} isEmpty `true` if the body is empty. + * @param {boolean} isDefault `true` if the body is the default case. * @returns {void} */ makeSwitchCaseBody(isEmpty, isDefault) { @@ -706,8 +688,7 @@ class CodePathState { /** * Creates a context object of TryStatement and stacks it. - * - * @param {boolean} hasFinalizer - `true` if the try statement has a + * @param {boolean} hasFinalizer `true` if the try statement has a * `finally` block. * @returns {void} */ @@ -729,7 +710,6 @@ class CodePathState { /** * Pops the last context of TryStatement and finalizes it. - * * @returns {void} */ popTryContext() { @@ -785,7 +765,6 @@ class CodePathState { /** * Makes a code path segment for a `catch` block. - * * @returns {void} */ makeCatchBlock() { @@ -814,7 +793,6 @@ class CodePathState { * In the `finally` block, parallel paths are created. The parallel paths * are used as leaving-paths. The leaving-paths are paths from `return` * statements and `throw` statements in a `try` block or a `catch` block. - * * @returns {void} */ makeFinallyBlock() { @@ -874,7 +852,6 @@ class CodePathState { /** * Makes a code path segment from the first throwable node to the `catch` * block or the `finally` block. - * * @returns {void} */ makeFirstThrowablePathInTryBlock() { @@ -903,11 +880,10 @@ class CodePathState { /** * Creates a context object of a loop statement and stacks it. - * - * @param {string} type - The type of the node which was triggered. One of + * @param {string} type The type of the node which was triggered. One of * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, * and `ForStatement`. - * @param {string|null} label - A label of the node which was triggered. + * @param {string|null} label A label of the node which was triggered. * @returns {void} */ pushLoopContext(type, label) { @@ -979,7 +955,6 @@ class CodePathState { /** * Pops the last context of a loop statement and finalizes it. - * * @returns {void} */ popLoopContext() { @@ -1051,8 +1026,7 @@ class CodePathState { /** * Makes a code path segment for the test part of a WhileStatement. - * - * @param {boolean|undefined} test - The test value (only when constant). + * @param {boolean|undefined} test The test value (only when constant). * @returns {void} */ makeWhileTest(test) { @@ -1068,7 +1042,6 @@ class CodePathState { /** * Makes a code path segment for the body part of a WhileStatement. - * * @returns {void} */ makeWhileBody() { @@ -1090,7 +1063,6 @@ class CodePathState { /** * Makes a code path segment for the body part of a DoWhileStatement. - * * @returns {void} */ makeDoWhileBody() { @@ -1105,8 +1077,7 @@ class CodePathState { /** * Makes a code path segment for the test part of a DoWhileStatement. - * - * @param {boolean|undefined} test - The test value (only when constant). + * @param {boolean|undefined} test The test value (only when constant). * @returns {void} */ makeDoWhileTest(test) { @@ -1126,8 +1097,7 @@ class CodePathState { /** * Makes a code path segment for the test part of a ForStatement. - * - * @param {boolean|undefined} test - The test value (only when constant). + * @param {boolean|undefined} test The test value (only when constant). * @returns {void} */ makeForTest(test) { @@ -1145,7 +1115,6 @@ class CodePathState { /** * Makes a code path segment for the update part of a ForStatement. - * * @returns {void} */ makeForUpdate() { @@ -1173,7 +1142,6 @@ class CodePathState { /** * Makes a code path segment for the body part of a ForStatement. - * * @returns {void} */ makeForBody() { @@ -1227,7 +1195,6 @@ class CodePathState { /** * Makes a code path segment for the left part of a ForInStatement and a * ForOfStatement. - * * @returns {void} */ makeForInOfLeft() { @@ -1244,7 +1211,6 @@ class CodePathState { /** * Makes a code path segment for the right part of a ForInStatement and a * ForOfStatement. - * * @returns {void} */ makeForInOfRight() { @@ -1263,7 +1229,6 @@ class CodePathState { /** * Makes a code path segment for the body part of a ForInStatement and a * ForOfStatement. - * * @returns {void} */ makeForInOfBody() { @@ -1288,10 +1253,9 @@ class CodePathState { /** * Creates new context for BreakStatement. - * - * @param {boolean} breakable - The flag to indicate it can break by + * @param {boolean} breakable The flag to indicate it can break by * an unlabeled BreakStatement. - * @param {string|null} label - The label of this context. + * @param {string|null} label The label of this context. * @returns {Object} The new context. */ pushBreakContext(breakable, label) { @@ -1306,7 +1270,6 @@ class CodePathState { /** * Removes the top item of the break context stack. - * * @returns {Object} The removed context. */ popBreakContext() { @@ -1333,8 +1296,7 @@ class CodePathState { * * It registers the head segment to a context of `break`. * It makes new unreachable segment, then it set the head with the segment. - * - * @param {string} label - A label of the break statement. + * @param {string} label A label of the break statement. * @returns {void} */ makeBreak(label) { @@ -1359,8 +1321,7 @@ class CodePathState { * * It makes a looping path. * It makes new unreachable segment, then it set the head with the segment. - * - * @param {string} label - A label of the continue statement. + * @param {string} label A label of the continue statement. * @returns {void} */ makeContinue(label) { @@ -1395,7 +1356,6 @@ class CodePathState { * * It registers the head segment to a context of `return`. * It makes new unreachable segment, then it set the head with the segment. - * * @returns {void} */ makeReturn() { @@ -1412,7 +1372,6 @@ class CodePathState { * * It registers the head segment to a context of `throw`. * It makes new unreachable segment, then it set the head with the segment. - * * @returns {void} */ makeThrow() { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js index cb26ea18a3ee67..49b37c6b2272db 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -21,10 +21,11 @@ const IdGenerator = require("./id-generator"); */ class CodePath { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} id - An identifier. - * @param {CodePath|null} upper - The code path of the upper function scope. - * @param {Function} onLooped - A callback function to notify looping. + * @param {string} id An identifier. + * @param {CodePath|null} upper The code path of the upper function scope. + * @param {Function} onLooped A callback function to notify looping. */ constructor(id, upper, onLooped) { @@ -62,8 +63,7 @@ class CodePath { /** * Gets the state of a given code path. - * - * @param {CodePath} codePath - A code path to get. + * @param {CodePath} codePath A code path to get. * @returns {CodePathState} The state of the code path. */ static getState(codePath) { @@ -126,11 +126,10 @@ class CodePath { * * - `controller.skip()` - Skip the following segments in this branch. * - `controller.break()` - Skip all following segments. - * - * @param {Object} [options] - Omittable. - * @param {CodePathSegment} [options.first] - The first segment to traverse. - * @param {CodePathSegment} [options.last] - The last segment to traverse. - * @param {Function} callback - A callback function. + * @param {Object} [options] Omittable. + * @param {CodePathSegment} [options.first] The first segment to traverse. + * @param {CodePathSegment} [options.last] The last segment to traverse. + * @param {Function} callback A callback function. * @returns {void} */ traverseSegments(options, callback) { @@ -171,7 +170,7 @@ class CodePath { /** * Checks a given previous segment has been visited. - * @param {CodePathSegment} prevSegment - A previous segment to check. + * @param {CodePathSegment} prevSegment A previous segment to check. * @returns {boolean} `true` if the segment has been visited. */ function isVisited(prevSegment) { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js index 2ca6dbc1e5293c..35a4cb2dacb1ca 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -17,7 +17,7 @@ const debug = require("debug")("eslint:code-path"); /** * Gets id of a given segment. - * @param {CodePathSegment} segment - A segment to get. + * @param {CodePathSegment} segment A segment to get. * @returns {string} Id of the segment. */ /* istanbul ignore next */ @@ -39,18 +39,16 @@ module.exports = { /** * Dumps given objects. - * - * @param {...any} args - objects to dump. + * @param {...any} args objects to dump. * @returns {void} */ dump: debug, /** * Dumps the current analyzing state. - * - * @param {ASTNode} node - A node to dump. - * @param {CodePathState} state - A state to dump. - * @param {boolean} leaving - A flag whether or not it's leaving + * @param {ASTNode} node A node to dump. + * @param {CodePathState} state A state to dump. + * @param {boolean} leaving A flag whether or not it's leaving * @returns {void} */ dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { @@ -73,8 +71,7 @@ module.exports = { /** * Dumps a DOT code of a given code path. * The DOT code can be visialized with Graphvis. - * - * @param {CodePath} codePath - A code path to dump. + * @param {CodePath} codePath A code path to dump. * @returns {void} * @see http://www.graphviz.org * @see http://www.webgraphviz.com @@ -139,9 +136,8 @@ module.exports = { /** * Makes a DOT code of a given code path. * The DOT code can be visialized with Graphvis. - * - * @param {CodePath} codePath - A code path to make DOT. - * @param {Object} traceMap - Optional. A map to check whether or not segments had been done. + * @param {CodePath} codePath A code path to make DOT. + * @param {Object} traceMap Optional. A map to check whether or not segments had been done. * @returns {string} A DOT code of the code path. */ makeDotArrows(codePath, traceMap) { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js index 939ed2d0d9af11..eb1d2de5a7db5b 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -22,8 +22,7 @@ const assert = require("assert"), /** * Gets whether or not a given segment is reachable. - * - * @param {CodePathSegment} segment - A segment to get. + * @param {CodePathSegment} segment A segment to get. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -36,11 +35,10 @@ function isReachable(segment) { * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`. * This `h` is from `b`, `d`, and `f`. - * - * @param {ForkContext} context - An instance. - * @param {number} begin - The first index of the previous segments. - * @param {number} end - The last index of the previous segments. - * @param {Function} create - A factory function of new segments. + * @param {ForkContext} context An instance. + * @param {number} begin The first index of the previous segments. + * @param {number} end The last index of the previous segments. + * @param {Function} create A factory function of new segments. * @returns {CodePathSegment[]} New segments. */ function makeSegments(context, begin, end, create) { @@ -69,9 +67,8 @@ function makeSegments(context, begin, end, create) { * control statement (such as `break`, `continue`) from the `finally` block, the * destination's segments may be half of the source segments. In that case, this * merges segments. - * - * @param {ForkContext} context - An instance. - * @param {CodePathSegment[]} segments - Segments to merge. + * @param {ForkContext} context An instance. + * @param {CodePathSegment[]} segments Segments to merge. * @returns {CodePathSegment[]} The merged segments. */ function mergeExtraSegments(context, segments) { @@ -100,10 +97,11 @@ function mergeExtraSegments(context, segments) { */ class ForkContext { + // eslint-disable-next-line jsdoc/require-description /** - * @param {IdGenerator} idGenerator - An identifier generator for segments. - * @param {ForkContext|null} upper - An upper fork context. - * @param {number} count - A number of parallel segments. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @param {ForkContext|null} upper An upper fork context. + * @param {number} count A number of parallel segments. */ constructor(idGenerator, upper, count) { this.idGenerator = idGenerator; @@ -142,9 +140,8 @@ class ForkContext { /** * Creates new segments from this context. - * - * @param {number} begin - The first index of previous segments. - * @param {number} end - The last index of previous segments. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. * @returns {CodePathSegment[]} New segments. */ makeNext(begin, end) { @@ -154,9 +151,8 @@ class ForkContext { /** * Creates new segments from this context. * The new segments is always unreachable. - * - * @param {number} begin - The first index of previous segments. - * @param {number} end - The last index of previous segments. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. * @returns {CodePathSegment[]} New segments. */ makeUnreachable(begin, end) { @@ -167,9 +163,8 @@ class ForkContext { * Creates new segments from this context. * The new segments don't have connections for previous segments. * But these inherit the reachable flag from this context. - * - * @param {number} begin - The first index of previous segments. - * @param {number} end - The last index of previous segments. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. * @returns {CodePathSegment[]} New segments. */ makeDisconnected(begin, end) { @@ -179,8 +174,7 @@ class ForkContext { /** * Adds segments into this context. * The added segments become the head. - * - * @param {CodePathSegment[]} segments - Segments to add. + * @param {CodePathSegment[]} segments Segments to add. * @returns {void} */ add(segments) { @@ -192,8 +186,7 @@ class ForkContext { /** * Replaces the head segments with given segments. * The current head segments are removed. - * - * @param {CodePathSegment[]} segments - Segments to add. + * @param {CodePathSegment[]} segments Segments to add. * @returns {void} */ replaceHead(segments) { @@ -204,8 +197,7 @@ class ForkContext { /** * Adds all segments of a given fork context into this context. - * - * @param {ForkContext} context - A fork context to add. + * @param {ForkContext} context A fork context to add. * @returns {void} */ addAll(context) { @@ -220,7 +212,6 @@ class ForkContext { /** * Clears all secments in this context. - * * @returns {void} */ clear() { @@ -229,8 +220,7 @@ class ForkContext { /** * Creates the root fork context. - * - * @param {IdGenerator} idGenerator - An identifier generator for segments. + * @param {IdGenerator} idGenerator An identifier generator for segments. * @returns {ForkContext} New fork context. */ static newRoot(idGenerator) { @@ -243,9 +233,8 @@ class ForkContext { /** * Creates an empty fork context preceded by a given context. - * - * @param {ForkContext} parentContext - The parent fork context. - * @param {boolean} forkLeavingPath - A flag which shows inside of `finally` block. + * @param {ForkContext} parentContext The parent fork context. + * @param {boolean} forkLeavingPath A flag which shows inside of `finally` block. * @returns {ForkContext} New fork context. */ static newEmpty(parentContext, forkLeavingPath) { diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js index 062058ddc12639..4cb2e0e3d87cc1 100644 --- a/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -18,8 +18,9 @@ */ class IdGenerator { + // eslint-disable-next-line jsdoc/require-description /** - * @param {string} prefix - Optional. A prefix of generated ids. + * @param {string} prefix Optional. A prefix of generated ids. */ constructor(prefix) { this.prefix = String(prefix); @@ -28,7 +29,6 @@ class IdGenerator { /** * Generates id. - * * @returns {string} A generated id. */ next() { diff --git a/tools/node_modules/eslint/lib/linter/linter.js b/tools/node_modules/eslint/lib/linter/linter.js index 534181da9e4752..6d88cb5aa1245f 100644 --- a/tools/node_modules/eslint/lib/linter/linter.js +++ b/tools/node_modules/eslint/lib/linter/linter.js @@ -292,10 +292,15 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { if (!match) { return; } - const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(match[1]); + const directiveText = match[1]; + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText); - if (warnInlineConfig && (lineCommentSupported || comment.type === "Block")) { - const kind = comment.type === "Block" ? `/*${match[1]}*/` : `//${match[1]}`; + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + if (warnInlineConfig) { + const kind = comment.type === "Block" ? `/*${directiveText}*/` : `//${directiveText}`; problems.push(createLintingProblem({ ruleId: null, @@ -306,108 +311,101 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { return; } - const directiveValue = trimmedCommentText.slice(match.index + match[1].length); - let directiveType = ""; + if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) { + const message = `${directiveText} comment should not span multiple lines.`; - if (lineCommentSupported) { - if (comment.loc.start.line === comment.loc.end.line) { - directiveType = match[1].slice("eslint-".length); - } else { - const message = `${match[1]} comment should not span multiple lines.`; + problems.push(createLintingProblem({ + ruleId: null, + message, + loc: comment.loc + })); + return; + } - problems.push(createLintingProblem({ - ruleId: null, - message, - loc: comment.loc - })); + const directiveValue = trimmedCommentText.slice(match.index + directiveText.length); + + switch (directiveText) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = directiveText.slice("eslint-".length); + const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; + const { directives, directiveProblems } = createDisableDirectives(options); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; } - } else if (comment.type === "Block") { - switch (match[1]) { - case "exported": - Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); - break; - case "globals": - case "global": - for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { - let normalizedValue; + case "exported": + Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); + break; + + case "globals": + case "global": + for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { + let normalizedValue; + + try { + normalizedValue = ConfigOps.normalizeConfigGlobal(value); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: null, + loc: comment.loc, + message: err.message + })); + continue; + } + + if (enabledGlobals[id]) { + enabledGlobals[id].comments.push(comment); + enabledGlobals[id].value = normalizedValue; + } else { + enabledGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); + + if (parseResult.success) { + Object.keys(parseResult.config).forEach(name => { + const rule = ruleMapper(name); + const ruleValue = parseResult.config[name]; + + if (rule === null) { + problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); + return; + } try { - normalizedValue = ConfigOps.normalizeConfigGlobal(value); + validator.validateRuleOptions(rule, name, ruleValue); } catch (err) { problems.push(createLintingProblem({ - ruleId: null, - loc: comment.loc, - message: err.message + ruleId: name, + message: err.message, + loc: comment.loc })); - continue; - } - if (enabledGlobals[id]) { - enabledGlobals[id].comments.push(comment); - enabledGlobals[id].value = normalizedValue; - } else { - enabledGlobals[id] = { - comments: [comment], - value: normalizedValue - }; + // do not apply the config, if found invalid options. + return; } - } - break; - - case "eslint-disable": - directiveType = "disable"; - break; - - case "eslint-enable": - directiveType = "enable"; - break; - - case "eslint": { - const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); - - if (parseResult.success) { - Object.keys(parseResult.config).forEach(name => { - const rule = ruleMapper(name); - const ruleValue = parseResult.config[name]; - - if (rule === null) { - problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); - return; - } - - try { - validator.validateRuleOptions(rule, name, ruleValue); - } catch (err) { - problems.push(createLintingProblem({ - ruleId: name, - message: err.message, - loc: comment.loc - })); - - // do not apply the config, if found invalid options. - return; - } - - configuredRules[name] = ruleValue; - }); - } else { - problems.push(parseResult.error); - } - break; + configuredRules[name] = ruleValue; + }); + } else { + problems.push(parseResult.error); } - // no default + break; } - } - - if (directiveType !== "") { - const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; - const { directives, directiveProblems } = createDisableDirectives(options); - disableDirectives.push(...directives); - problems.push(...directiveProblems); + // no default } }); @@ -438,7 +436,7 @@ const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gu; /** * Checks whether or not there is a comment which has "eslint-env *" in a given text. - * @param {string} text - A source code text to check. + * @param {string} text A source code text to check. * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment. */ function findEslintEnv(text) { @@ -555,8 +553,7 @@ function resolveGlobals(providedGlobals, enabledEnvironments) { /** * Strips Unicode BOM from a given text. - * - * @param {string} text - A text to strip. + * @param {string} text A text to strip. * @returns {string} The stripped text. */ function stripUnicodeBOM(text) { @@ -669,6 +666,8 @@ function parse(text, parser, providedParserOptions, filePath) { // If the message includes a leading line number, strip it: const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + debug("%s\n%s", message, ex.stack); + return { success: false, error: { @@ -813,9 +812,10 @@ const BASE_TRAVERSAL_CONTEXT = Object.freeze( * @param {Object} settings The settings that were enabled in the config * @param {string} filename The reported filename of the code * @param {boolean} disableFixes If true, it doesn't make `fix` properties. + * @param {string | undefined} cwd cwd of the cli * @returns {Problem[]} An array of reported problems */ -function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes) { +function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd) { const emitter = createEmitter(); const nodeQueue = []; let currentNode = sourceCode.ast; @@ -842,6 +842,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser { getAncestors: () => getAncestors(currentNode), getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), + getCwd: () => cwd, getFilename: () => filename, getScope: () => getScope(sourceCode.scopeManager, currentNode), getSourceCode: () => sourceCode, @@ -988,6 +989,24 @@ function getRule(slots, ruleId) { ); } +/** + * Normalize the value of the cwd + * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined. + * @returns {string | undefined} normalized cwd + */ +function normalizeCwd(cwd) { + if (cwd) { + return cwd; + } + if (typeof process === "object") { + return process.cwd(); + } + + // It's more explicit to assign the undefined + // eslint-disable-next-line no-undefined + return undefined; +} + /** * The map to store private data. * @type {WeakMap} @@ -1004,8 +1023,14 @@ const internalSlotsMap = new WeakMap(); */ class Linter { - constructor() { + /** + * Initialize the Linter. + * @param {Object} [config] the config object + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + */ + constructor({ cwd } = {}) { internalSlotsMap.set(this, { + cwd: normalizeCwd(cwd), lastConfigArray: null, lastSourceCode: null, parserMap: new Map([["espree", espree]]), @@ -1137,7 +1162,8 @@ class Linter { parserName, settings, options.filename, - options.disableFixes + options.disableFixes, + slots.cwd ); } catch (err) { err.message += `\nOccurred while linting ${options.filename}`; diff --git a/tools/node_modules/eslint/lib/linter/node-event-generator.js b/tools/node_modules/eslint/lib/linter/node-event-generator.js index 1267081d95b08a..fc7b879f64172b 100644 --- a/tools/node_modules/eslint/lib/linter/node-event-generator.js +++ b/tools/node_modules/eslint/lib/linter/node-event-generator.js @@ -202,6 +202,7 @@ const parseSelector = lodash.memoize(rawSelector => { */ class NodeEventGenerator { + // eslint-disable-next-line jsdoc/require-description /** * @param {SafeEmitter} emitter * An SafeEmitter which is the destination of events. This emitter must already @@ -286,7 +287,7 @@ class NodeEventGenerator { /** * Emits an event of entering AST node. - * @param {ASTNode} node - A node which was entered. + * @param {ASTNode} node A node which was entered. * @returns {void} */ enterNode(node) { @@ -298,7 +299,7 @@ class NodeEventGenerator { /** * Emits an event of leaving AST node. - * @param {ASTNode} node - A node which was left. + * @param {ASTNode} node A node which was left. * @returns {void} */ leaveNode(node) { diff --git a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js index 9f8324a358fd77..e57cd09bd87014 100644 --- a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js +++ b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -78,8 +78,7 @@ const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); /** * Clones a given value deeply. * Note: This ignores `parent` property. - * - * @param {any} x - A value to clone. + * @param {any} x A value to clone. * @returns {any} A cloned value. */ function cloneDeeplyExcludesParent(x) { @@ -104,8 +103,7 @@ function cloneDeeplyExcludesParent(x) { /** * Freezes a given value deeply. - * - * @param {any} x - A value to freeze. + * @param {any} x A value to freeze. * @returns {void} */ function freezeDeeply(x) { @@ -146,8 +144,8 @@ const IT = Symbol("it"); /** * This is `it` default handler if `it` don't exist. * @this {Mocha} - * @param {string} text - The description of the test case. - * @param {Function} method - The logic of the test case. + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. * @returns {any} Returned value of `method`. */ function itDefaultHandler(text, method) { @@ -164,8 +162,8 @@ function itDefaultHandler(text, method) { /** * This is `describe` default handler if `describe` don't exist. * @this {Mocha} - * @param {string} text - The description of the test case. - * @param {Function} method - The logic of the test case. + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. * @returns {any} Returned value of `method`. */ function describeDefaultHandler(text, method) { diff --git a/tools/node_modules/eslint/lib/rules/accessor-pairs.js b/tools/node_modules/eslint/lib/rules/accessor-pairs.js index a33d1f32f2e000..3a32db6eac7214 100644 --- a/tools/node_modules/eslint/lib/rules/accessor-pairs.js +++ b/tools/node_modules/eslint/lib/rules/accessor-pairs.js @@ -79,7 +79,7 @@ function areEqualKeys(left, right) { /** * Checks whether or not a given node is of an accessor kind ('get' or 'set'). - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is of an accessor kind. */ function isAccessorKind(node) { @@ -88,8 +88,8 @@ function isAccessorKind(node) { /** * Checks whether or not a given node is an `Identifier` node which was named a given name. - * @param {ASTNode} node - A node to check. - * @param {string} name - An expected name of the node. + * @param {ASTNode} node A node to check. + * @param {string} name An expected name of the node. * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. */ function isIdentifier(node, name) { @@ -98,10 +98,10 @@ function isIdentifier(node, name) { /** * Checks whether or not a given node is an argument of a specified method call. - * @param {ASTNode} node - A node to check. - * @param {number} index - An expected index of the node in arguments. - * @param {string} object - An expected name of the object of the method. - * @param {string} property - An expected name of the method. + * @param {ASTNode} node A node to check. + * @param {number} index An expected index of the node in arguments. + * @param {string} object An expected name of the object of the method. + * @param {string} property An expected name of the method. * @returns {boolean} `true` if the node is an argument of the specified method call. */ function isArgumentOfMethodCall(node, index, object, property) { @@ -119,7 +119,7 @@ function isArgumentOfMethodCall(node, index, object, property) { /** * Checks whether or not a given node is a property descriptor. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a property descriptor. */ function isPropertyDescriptor(node) { diff --git a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js index f6be2e8dd02c82..b4b4dd430f6564 100644 --- a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js +++ b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -65,8 +65,7 @@ module.exports = { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} option - An option value to parse. + * @param {string|Object|undefined} option An option value to parse. * @returns {{multiline: boolean, minItems: number}} Normalized option object. */ function normalizeOptionValue(option) { @@ -97,8 +96,7 @@ module.exports = { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} options - An option value to parse. + * @param {string|Object|undefined} options An option value to parse. * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. */ function normalizeOptions(options) { @@ -109,8 +107,8 @@ module.exports = { /** * Reports that there shouldn't be a linebreak after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoBeginningLinebreak(node, token) { @@ -132,8 +130,8 @@ module.exports = { /** * Reports that there shouldn't be a linebreak before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoEndingLinebreak(node, token) { @@ -155,8 +153,8 @@ module.exports = { /** * Reports that there should be a linebreak after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredBeginningLinebreak(node, token) { @@ -172,8 +170,8 @@ module.exports = { /** * Reports that there should be a linebreak before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredEndingLinebreak(node, token) { @@ -189,8 +187,7 @@ module.exports = { /** * Reports a given node if it violated this rule. - * - * @param {ASTNode} node - A node to check. This is an ArrayExpression node or an ArrayPattern node. + * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node. * @returns {void} */ function check(node) { @@ -219,7 +216,7 @@ module.exports = { ) || ( options.consistent && - firstIncComment.loc.start.line !== openBracket.loc.end.line + openBracket.loc.end.line !== first.loc.start.line ) ); diff --git a/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js b/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js index 0a51d350cd79ea..2510159ee48fa7 100644 --- a/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js +++ b/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -59,7 +59,7 @@ module.exports = { * Determines whether an option is set, relative to the spacing option. * If spaced is "always", then check whether option is set to false. * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. + * @param {Object} option The option to exclude. * @returns {boolean} Whether or not the property is excluded. */ function isOptionSet(option) { @@ -79,8 +79,8 @@ module.exports = { /** * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoBeginningSpace(node, token) { @@ -101,8 +101,8 @@ module.exports = { /** * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoEndingSpace(node, token) { @@ -123,8 +123,8 @@ module.exports = { /** * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredBeginningSpace(node, token) { @@ -143,8 +143,8 @@ module.exports = { /** * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredEndingSpace(node, token) { @@ -163,7 +163,7 @@ module.exports = { /** * Determines if a node is an object type - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node is an object type. */ function isObjectType(node) { @@ -172,7 +172,7 @@ module.exports = { /** * Determines if a node is an array type - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} Whether or not the node is an array type. */ function isArrayType(node) { @@ -181,7 +181,7 @@ module.exports = { /** * Validates the spacing around array brackets - * @param {ASTNode} node - The node we're checking for spacing + * @param {ASTNode} node The node we're checking for spacing * @returns {void} */ function validateArraySpacing(node) { diff --git a/tools/node_modules/eslint/lib/rules/array-callback-return.js b/tools/node_modules/eslint/lib/rules/array-callback-return.js index bd1f3a37aad29d..d632a3f30c28a3 100644 --- a/tools/node_modules/eslint/lib/rules/array-callback-return.js +++ b/tools/node_modules/eslint/lib/rules/array-callback-return.js @@ -22,8 +22,7 @@ const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|map|reduce(?:Right)?|som /** * Checks a given code path segment is reachable. - * - * @param {CodePathSegment} segment - A segment to check. + * @param {CodePathSegment} segment A segment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -35,9 +34,8 @@ function isReachable(segment) { * * - FunctionExpression -> the function name or `function` keyword. * - ArrowFunctionExpression -> `=>` token. - * - * @param {ASTNode} node - A function node to get. - * @param {SourceCode} sourceCode - A source code to get tokens. + * @param {ASTNode} node A function node to get. + * @param {SourceCode} sourceCode A source code to get tokens. * @returns {ASTNode|Token} The node or the token of a location. */ function getLocation(node, sourceCode) { @@ -50,8 +48,7 @@ function getLocation(node, sourceCode) { /** * Checks a given node is a MemberExpression node which has the specified name's * property. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a MemberExpression node which has * the specified name's property */ @@ -65,8 +62,7 @@ function isTargetMethod(node) { /** * Checks whether or not a given node is a function expression which is the * callback of an array method. - * - * @param {ASTNode} node - A node to check. This is one of + * @param {ASTNode} node A node to check. This is one of * FunctionExpression or ArrowFunctionExpression. * @returns {boolean} `true` if the node is the callback of an array method. */ @@ -188,8 +184,7 @@ module.exports = { * * If the last code path segment is reachable, there are paths which are not * returned or thrown. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function checkLastSegment(node) { diff --git a/tools/node_modules/eslint/lib/rules/array-element-newline.js b/tools/node_modules/eslint/lib/rules/array-element-newline.js index c3d026ad6965b6..1da67667bee849 100644 --- a/tools/node_modules/eslint/lib/rules/array-element-newline.js +++ b/tools/node_modules/eslint/lib/rules/array-element-newline.js @@ -62,8 +62,7 @@ module.exports = { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} providedOption - An option value to parse. + * @param {string|Object|undefined} providedOption An option value to parse. * @returns {{multiline: boolean, minItems: number}} Normalized option object. */ function normalizeOptionValue(providedOption) { @@ -90,8 +89,7 @@ module.exports = { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} options - An option value to parse. + * @param {string|Object|undefined} options An option value to parse. * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. */ function normalizeOptions(options) { @@ -102,7 +100,7 @@ module.exports = { /** * Reports that there shouldn't be a line break after the first token - * @param {Token} token - The token to use for the report. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoLineBreak(token) { @@ -151,7 +149,7 @@ module.exports = { /** * Reports that there should be a line break after the first token - * @param {Token} token - The token to use for the report. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredLineBreak(token) { @@ -171,8 +169,7 @@ module.exports = { /** * Reports a given node if it violated this rule. - * - * @param {ASTNode} node - A node to check. This is an ObjectExpression node or an ObjectPattern node. + * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/arrow-parens.js b/tools/node_modules/eslint/lib/rules/arrow-parens.js index b4b26e35342dc6..dc3c3825791a68 100644 --- a/tools/node_modules/eslint/lib/rules/arrow-parens.js +++ b/tools/node_modules/eslint/lib/rules/arrow-parens.js @@ -16,7 +16,6 @@ const astUtils = require("./utils/ast-utils"); /** * Get location should be reported by AST node. - * * @param {ASTNode} node AST Node. * @returns {Location} Location information. */ diff --git a/tools/node_modules/eslint/lib/rules/block-scoped-var.js b/tools/node_modules/eslint/lib/rules/block-scoped-var.js index 053cfc334cd11a..481057ba6c7c6b 100644 --- a/tools/node_modules/eslint/lib/rules/block-scoped-var.js +++ b/tools/node_modules/eslint/lib/rules/block-scoped-var.js @@ -31,7 +31,7 @@ module.exports = { /** * Makes a block scope. - * @param {ASTNode} node - A node of a scope. + * @param {ASTNode} node A node of a scope. * @returns {void} */ function enterScope(node) { @@ -48,7 +48,7 @@ module.exports = { /** * Reports a given reference. - * @param {eslint-scope.Reference} reference - A reference to report. + * @param {eslint-scope.Reference} reference A reference to report. * @returns {void} */ function report(reference) { @@ -59,7 +59,7 @@ module.exports = { /** * Finds and reports references which are outside of valid scopes. - * @param {ASTNode} node - A node to get variables. + * @param {ASTNode} node A node to get variables. * @returns {void} */ function checkForVariables(node) { diff --git a/tools/node_modules/eslint/lib/rules/block-spacing.js b/tools/node_modules/eslint/lib/rules/block-spacing.js index e843148e5d151a..c6ed44a2798a6b 100644 --- a/tools/node_modules/eslint/lib/rules/block-spacing.js +++ b/tools/node_modules/eslint/lib/rules/block-spacing.js @@ -41,7 +41,7 @@ module.exports = { /** * Gets the open brace token from a given node. - * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. * @returns {Token} The token of the open brace. */ function getOpenBrace(node) { @@ -58,8 +58,8 @@ module.exports = { * Checks whether or not: * - given tokens are on same line. * - there is/isn't a space between given tokens. - * @param {Token} left - A token to check. - * @param {Token} right - The token which is next to `left`. + * @param {Token} left A token to check. + * @param {Token} right The token which is next to `left`. * @returns {boolean} * When the option is `"always"`, `true` if there are one or more spaces between given tokens. * When the option is `"never"`, `true` if there are not any spaces between given tokens. @@ -74,7 +74,7 @@ module.exports = { /** * Reports invalid spacing style inside braces. - * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. * @returns {void} */ function checkSpacingInsideBraces(node) { diff --git a/tools/node_modules/eslint/lib/rules/capitalized-comments.js b/tools/node_modules/eslint/lib/rules/capitalized-comments.js index dd7ef145648c66..d7524b878d2275 100644 --- a/tools/node_modules/eslint/lib/rules/capitalized-comments.js +++ b/tools/node_modules/eslint/lib/rules/capitalized-comments.js @@ -54,7 +54,6 @@ const DEFAULTS = { * set is returned. Options specified in overrides will take priority * over options specified in the main options object, which will in * turn take priority over the rule's defaults. - * * @param {Object|string} rawOptions The user-provided options. * @param {string} which Either "line" or "block". * @returns {Object} The normalized options. @@ -65,7 +64,6 @@ function getNormalizedOptions(rawOptions, which) { /** * Get normalized options for block and line comments. - * * @param {Object|string} rawOptions The user-provided options. * @returns {Object} An object with "Line" and "Block" keys and corresponding * normalized options objects. @@ -82,7 +80,6 @@ function getAllNormalizedOptions(rawOptions = {}) { * options. * * This is done in order to avoid invoking the RegExp constructor repeatedly. - * * @param {Object} normalizedOptions The normalized rule options. * @returns {void} */ @@ -162,7 +159,6 @@ module.exports = { * Also, it follows from this definition that only block comments can * be considered as possibly inline. This is because line comments * would consume any following tokens on the same line as the comment. - * * @param {ASTNode} comment The comment node to check. * @returns {boolean} True if the comment is an inline comment, false * otherwise. @@ -181,7 +177,6 @@ module.exports = { /** * Determine if a comment follows another comment. - * * @param {ASTNode} comment The comment to check. * @returns {boolean} True if the comment follows a valid comment. */ @@ -196,7 +191,6 @@ module.exports = { /** * Check a comment to determine if it is valid for this rule. - * * @param {ASTNode} comment The comment node to process. * @param {Object} options The options for checking this comment. * @returns {boolean} True if the comment is valid, false otherwise. @@ -261,7 +255,6 @@ module.exports = { /** * Process a comment to determine if it needs to be reported. - * * @param {ASTNode} comment The comment node to process. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/class-methods-use-this.js b/tools/node_modules/eslint/lib/rules/class-methods-use-this.js index 4bf17090abcb87..2cc5cc41842c0c 100644 --- a/tools/node_modules/eslint/lib/rules/class-methods-use-this.js +++ b/tools/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -61,7 +61,7 @@ module.exports = { /** * Check if the node is an instance method - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {boolean} True if its an instance method * @private */ @@ -71,7 +71,7 @@ module.exports = { /** * Check if the node is an instance method not excluded by config - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {boolean} True if it is an instance method, and not excluded by config * @private */ @@ -84,7 +84,7 @@ module.exports = { * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. * Static methods and the constructor are exempt. * Then pops the context off the stack. - * @param {ASTNode} node - A function node that was entered. + * @param {ASTNode} node A function node that was entered. * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/comma-dangle.js b/tools/node_modules/eslint/lib/rules/comma-dangle.js index 9cd6660d5d1e7f..fb2d167c77eef9 100644 --- a/tools/node_modules/eslint/lib/rules/comma-dangle.js +++ b/tools/node_modules/eslint/lib/rules/comma-dangle.js @@ -27,8 +27,7 @@ const DEFAULT_OPTIONS = Object.freeze({ /** * Checks whether or not a trailing comma is allowed in a given node. * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas. - * - * @param {ASTNode} lastItem - The node of the last element in the given node. + * @param {ASTNode} lastItem The node of the last element in the given node. * @returns {boolean} `true` if a trailing comma is allowed. */ function isTrailingCommaAllowed(lastItem) { @@ -41,20 +40,18 @@ function isTrailingCommaAllowed(lastItem) { /** * Normalize option value. - * - * @param {string|Object|undefined} optionValue - The 1st option value to normalize. + * @param {string|Object|undefined} optionValue The 1st option value to normalize. + * @param {number} ecmaVersion The normalized ECMAScript version. * @returns {Object} The normalized option value. */ -function normalizeOptions(optionValue) { +function normalizeOptions(optionValue, ecmaVersion) { if (typeof optionValue === "string") { return { arrays: optionValue, objects: optionValue, imports: optionValue, exports: optionValue, - - // For backward compatibility, always ignore functions. - functions: "ignore" + functions: (!ecmaVersion || ecmaVersion < 8) ? "ignore" : optionValue }; } if (typeof optionValue === "object" && optionValue !== null) { @@ -137,12 +134,13 @@ module.exports = { }, create(context) { - const options = normalizeOptions(context.options[0]); + const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); + const sourceCode = context.getSourceCode(); /** * Gets the last item of the given node. - * @param {ASTNode} node - The node to get. + * @param {ASTNode} node The node to get. * @returns {ASTNode|null} The last node or null. */ function getLastItem(node) { @@ -172,9 +170,8 @@ module.exports = { * Gets the trailing comma token of the given node. * If the trailing comma does not exist, this returns the token which is * the insertion point of the trailing comma token. - * - * @param {ASTNode} node - The node to get. - * @param {ASTNode} lastItem - The last item of the node. + * @param {ASTNode} node The node to get. + * @param {ASTNode} lastItem The last item of the node. * @returns {Token} The trailing comma token or the insertion point. */ function getTrailingToken(node, lastItem) { @@ -199,8 +196,7 @@ module.exports = { * Checks whether or not a given node is multiline. * This rule handles a given node as multiline when the closing parenthesis * and the last element are not on the same line. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is multiline. */ function isMultiline(node) { @@ -218,8 +214,7 @@ module.exports = { /** * Reports a trailing comma if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of + * @param {ASTNode} node A node to check. Its type is one of * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} @@ -251,8 +246,7 @@ module.exports = { * * If a given node is `ArrayPattern` which has `RestElement`, the trailing * comma is disallowed, so report if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of + * @param {ASTNode} node A node to check. Its type is one of * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} @@ -286,8 +280,7 @@ module.exports = { * If a given node is multiline, reports the last element of a given node * when it does not have a trailing comma. * Otherwise, reports a trailing comma if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of + * @param {ASTNode} node A node to check. Its type is one of * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} @@ -304,8 +297,7 @@ module.exports = { * Only if a given node is not multiline, reports the last element of a given node * when it does not have a trailing comma. * Otherwise, reports a trailing comma if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of + * @param {ASTNode} node A node to check. Its type is one of * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} diff --git a/tools/node_modules/eslint/lib/rules/comma-spacing.js b/tools/node_modules/eslint/lib/rules/comma-spacing.js index 79a556a8857d1f..73c10a7711b904 100644 --- a/tools/node_modules/eslint/lib/rules/comma-spacing.js +++ b/tools/node_modules/eslint/lib/rules/comma-spacing.js @@ -105,7 +105,7 @@ module.exports = { /** * Validates the spacing around a comma token. - * @param {Object} tokens - The tokens to be validated. + * @param {Object} tokens The tokens to be validated. * @param {Token} tokens.comma The token representing the comma. * @param {Token} [tokens.left] The last token before the comma. * @param {Token} [tokens.right] The first token after the comma. diff --git a/tools/node_modules/eslint/lib/rules/computed-property-spacing.js b/tools/node_modules/eslint/lib/rules/computed-property-spacing.js index 33f7c9401a9769..bc8be964f4ffee 100644 --- a/tools/node_modules/eslint/lib/rules/computed-property-spacing.js +++ b/tools/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -59,9 +59,9 @@ module.exports = { /** * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @param {Token} tokenAfter - The token after `token`. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenAfter The token after `token`. * @returns {void} */ function reportNoBeginningSpace(node, token, tokenAfter) { @@ -80,9 +80,9 @@ module.exports = { /** * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @param {Token} tokenBefore - The token before `token`. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenBefore The token before `token`. * @returns {void} */ function reportNoEndingSpace(node, token, tokenBefore) { @@ -101,8 +101,8 @@ module.exports = { /** * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredBeginningSpace(node, token) { @@ -121,8 +121,8 @@ module.exports = { /** * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredEndingSpace(node, token) { diff --git a/tools/node_modules/eslint/lib/rules/consistent-return.js b/tools/node_modules/eslint/lib/rules/consistent-return.js index 16f0070bc7c3be..22667fa4707724 100644 --- a/tools/node_modules/eslint/lib/rules/consistent-return.js +++ b/tools/node_modules/eslint/lib/rules/consistent-return.js @@ -18,8 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a given node is an `Identifier` node which was named a given name. - * @param {ASTNode} node - A node to check. - * @param {string} name - An expected name of the node. + * @param {ASTNode} node A node to check. + * @param {string} name An expected name of the node. * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. */ function isIdentifier(node, name) { @@ -28,7 +28,7 @@ function isIdentifier(node, name) { /** * Checks whether or not a given code path segment is unreachable. - * @param {CodePathSegment} segment - A CodePathSegment to check. + * @param {CodePathSegment} segment A CodePathSegment to check. * @returns {boolean} `true` if the segment is unreachable. */ function isUnreachable(segment) { @@ -88,8 +88,7 @@ module.exports = { /** * Checks whether of not the implicit returning is consistent if the last * code path segment is reachable. - * - * @param {ASTNode} node - A program/function node to check. + * @param {ASTNode} node A program/function node to check. * @returns {void} */ function checkLastSegment(node) { diff --git a/tools/node_modules/eslint/lib/rules/consistent-this.js b/tools/node_modules/eslint/lib/rules/consistent-this.js index 4bdcdfdc10e8f0..16f53b5374cd24 100644 --- a/tools/node_modules/eslint/lib/rules/consistent-this.js +++ b/tools/node_modules/eslint/lib/rules/consistent-this.js @@ -46,8 +46,8 @@ module.exports = { /** * Reports that a variable declarator or assignment expression is assigning * a non-'this' value to the specified alias. - * @param {ASTNode} node - The assigning node. - * @param {string} name - the name of the alias that was incorrectly used. + * @param {ASTNode} node The assigning node. + * @param {string} name the name of the alias that was incorrectly used. * @returns {void} */ function reportBadAssignment(node, name) { @@ -57,9 +57,9 @@ module.exports = { /** * Checks that an assignment to an identifier only assigns 'this' to the * appropriate alias, and the alias is only assigned to 'this'. - * @param {ASTNode} node - The assigning node. - * @param {Identifier} name - The name of the variable assigned to. - * @param {Expression} value - The value of the assignment. + * @param {ASTNode} node The assigning node. + * @param {Identifier} name The name of the variable assigned to. + * @param {Expression} value The value of the assignment. * @returns {void} */ function checkAssignment(node, name, value) { diff --git a/tools/node_modules/eslint/lib/rules/constructor-super.js b/tools/node_modules/eslint/lib/rules/constructor-super.js index e4cdb099b3bf52..5a848f210cae52 100644 --- a/tools/node_modules/eslint/lib/rules/constructor-super.js +++ b/tools/node_modules/eslint/lib/rules/constructor-super.js @@ -11,8 +11,7 @@ /** * Checks whether a given code path segment is reachable or not. - * - * @param {CodePathSegment} segment - A code path segment to check. + * @param {CodePathSegment} segment A code path segment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -21,7 +20,7 @@ function isReachable(segment) { /** * Checks whether or not a given node is a constructor. - * @param {ASTNode} node - A node to check. This node type is one of + * @param {ASTNode} node A node to check. This node type is one of * `Program`, `FunctionDeclaration`, `FunctionExpression`, and * `ArrowFunctionExpression`. * @returns {boolean} `true` if the node is a constructor. @@ -36,8 +35,7 @@ function isConstructorFunction(node) { /** * Checks whether a given node can be a constructor or not. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node can be a constructor. */ function isPossibleConstructor(node) { @@ -137,7 +135,7 @@ module.exports = { /** * Gets the flag which shows `super()` is called in some paths. - * @param {CodePathSegment} segment - A code path segment to get. + * @param {CodePathSegment} segment A code path segment to get. * @returns {boolean} The flag which shows `super()` is called in some paths */ function isCalledInSomePath(segment) { @@ -146,7 +144,7 @@ module.exports = { /** * Gets the flag which shows `super()` is called in all paths. - * @param {CodePathSegment} segment - A code path segment to get. + * @param {CodePathSegment} segment A code path segment to get. * @returns {boolean} The flag which shows `super()` is called in all paths. */ function isCalledInEveryPath(segment) { @@ -168,8 +166,8 @@ module.exports = { /** * Stacks a constructor information. - * @param {CodePath} codePath - A code path which was started. - * @param {ASTNode} node - The current node. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. * @returns {void} */ onCodePathStart(codePath, node) { @@ -200,8 +198,8 @@ module.exports = { /** * Pops a constructor information. * And reports if `super()` lacked. - * @param {CodePath} codePath - A code path which was ended. - * @param {ASTNode} node - The current node. + * @param {CodePath} codePath A code path which was ended. + * @param {ASTNode} node The current node. * @returns {void} */ onCodePathEnd(codePath, node) { @@ -231,7 +229,7 @@ module.exports = { /** * Initialize information of a given code path segment. - * @param {CodePathSegment} segment - A code path segment to initialize. + * @param {CodePathSegment} segment A code path segment to initialize. * @returns {void} */ onCodePathSegmentStart(segment) { @@ -258,9 +256,9 @@ module.exports = { /** * Update information of the code path segment when a code path was * looped. - * @param {CodePathSegment} fromSegment - The code path segment of the + * @param {CodePathSegment} fromSegment The code path segment of the * end of a loop. - * @param {CodePathSegment} toSegment - A code path segment of the head + * @param {CodePathSegment} toSegment A code path segment of the head * of a loop. * @returns {void} */ @@ -303,7 +301,7 @@ module.exports = { /** * Checks for a call of `super()`. - * @param {ASTNode} node - A CallExpression node to check. + * @param {ASTNode} node A CallExpression node to check. * @returns {void} */ "CallExpression:exit"(node) { @@ -358,7 +356,7 @@ module.exports = { /** * Set the mark to the returned path as `super()` was called. - * @param {ASTNode} node - A ReturnStatement node to check. + * @param {ASTNode} node A ReturnStatement node to check. * @returns {void} */ ReturnStatement(node) { diff --git a/tools/node_modules/eslint/lib/rules/curly.js b/tools/node_modules/eslint/lib/rules/curly.js index 8eaaddc25c6ff7..93c74d11fcf35f 100644 --- a/tools/node_modules/eslint/lib/rules/curly.js +++ b/tools/node_modules/eslint/lib/rules/curly.js @@ -119,8 +119,7 @@ module.exports = { /** * Checks if the given token is an `else` token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is an `else` token. */ function isElseKeywordToken(token) { @@ -129,7 +128,7 @@ module.exports = { /** * Gets the `else` keyword token of a given `IfStatement` node. - * @param {ASTNode} node - A `IfStatement` node to get. + * @param {ASTNode} node A `IfStatement` node to get. * @returns {Token} The `else` keyword token. */ function getElseKeyword(node) { @@ -143,8 +142,7 @@ module.exports = { * 1. The given node has the `alternate` node. * 2. There is a `IfStatement` which doesn't have `alternate` node in the * trailing statement chain of the `consequent` node. - * - * @param {ASTNode} node - A IfStatement node to check. + * @param {ASTNode} node A IfStatement node to check. * @returns {boolean} `true` if the node requires braces of the consequent chunk. */ function requiresBraceOfConsequent(node) { diff --git a/tools/node_modules/eslint/lib/rules/default-param-last.js b/tools/node_modules/eslint/lib/rules/default-param-last.js index ee73aaf3215969..12e0b5950dace6 100644 --- a/tools/node_modules/eslint/lib/rules/default-param-last.js +++ b/tools/node_modules/eslint/lib/rules/default-param-last.js @@ -25,6 +25,7 @@ module.exports = { create(context) { + // eslint-disable-next-line jsdoc/require-description /** * @param {ASTNode} node function node * @returns {void} diff --git a/tools/node_modules/eslint/lib/rules/dot-location.js b/tools/node_modules/eslint/lib/rules/dot-location.js index c2e734a1a0b141..d483e217a94980 100644 --- a/tools/node_modules/eslint/lib/rules/dot-location.js +++ b/tools/node_modules/eslint/lib/rules/dot-location.js @@ -47,19 +47,18 @@ module.exports = { /** * Reports if the dot between object and property is on the correct loccation. - * @param {ASTNode} obj The object owning the property. - * @param {ASTNode} prop The property of the object. - * @param {ASTNode} node The corresponding node of the token. + * @param {ASTNode} node The `MemberExpression` node. * @returns {void} */ - function checkDotLocation(obj, prop, node) { - const dot = sourceCode.getTokenBefore(prop); + function checkDotLocation(node) { + const property = node.property; + const dot = sourceCode.getTokenBefore(property); // `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node. const tokenBeforeDot = sourceCode.getTokenBefore(dot); const textBeforeDot = sourceCode.getText().slice(tokenBeforeDot.range[1], dot.range[0]); - const textAfterDot = sourceCode.getText().slice(dot.range[1], prop.range[0]); + const textAfterDot = sourceCode.getText().slice(dot.range[1], property.range[0]); if (onObject) { if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dot)) { @@ -67,17 +66,17 @@ module.exports = { context.report({ node, - loc: dot.loc.start, + loc: dot.loc, messageId: "expectedDotAfterObject", - fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], prop.range[0]], `${neededTextAfterToken}.${textBeforeDot}${textAfterDot}`) + fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], property.range[0]], `${neededTextAfterToken}.${textBeforeDot}${textAfterDot}`) }); } - } else if (!astUtils.isTokenOnSameLine(dot, prop)) { + } else if (!astUtils.isTokenOnSameLine(dot, property)) { context.report({ node, - loc: dot.loc.start, + loc: dot.loc, messageId: "expectedDotBeforeProperty", - fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], prop.range[0]], `${textBeforeDot}${textAfterDot}.`) + fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], property.range[0]], `${textBeforeDot}${textAfterDot}.`) }); } } @@ -89,7 +88,7 @@ module.exports = { */ function checkNode(node) { if (!node.computed) { - checkDotLocation(node.object, node.property, node); + checkDotLocation(node); } } diff --git a/tools/node_modules/eslint/lib/rules/func-names.js b/tools/node_modules/eslint/lib/rules/func-names.js index ff3a1f4b5bf890..1341d03630823f 100644 --- a/tools/node_modules/eslint/lib/rules/func-names.js +++ b/tools/node_modules/eslint/lib/rules/func-names.js @@ -13,7 +13,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a given variable is a function name. - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is a function name. */ function isFunctionName(variable) { @@ -73,7 +73,7 @@ module.exports = { /** * Returns the config option for the given node. - * @param {ASTNode} node - A node to get the config for. + * @param {ASTNode} node A node to get the config for. * @returns {string} The config option. */ function getConfigForNode(node) { @@ -91,7 +91,7 @@ module.exports = { /** * Determines whether the current FunctionExpression node is a get, set, or * shorthand method in an object literal or a class. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} True if the node is a get, set, or shorthand method. */ function isObjectOrClassMethod(node) { @@ -109,7 +109,7 @@ module.exports = { /** * Determines whether the current FunctionExpression node has a name that would be * inferred from context in a conforming ES6 environment. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} True if the node would have a name assigned automatically. */ function hasInferredName(node) { @@ -125,7 +125,7 @@ module.exports = { /** * Reports that an unnamed function should be named - * @param {ASTNode} node - The node to report in the event of an error. + * @param {ASTNode} node The node to report in the event of an error. * @returns {void} */ function reportUnexpectedUnnamedFunction(node) { @@ -139,7 +139,7 @@ module.exports = { /** * Reports that a named function should be unnamed - * @param {ASTNode} node - The node to report in the event of an error. + * @param {ASTNode} node The node to report in the event of an error. * @returns {void} */ function reportUnexpectedNamedFunction(node) { diff --git a/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js b/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js index 8bf31f7c713d5d..31ebc097c46f51 100644 --- a/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js +++ b/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -40,13 +40,13 @@ module.exports = { const checkers = { unexpected: { messageId: "unexpectedLineBreak", - check: (prevToken, currentToken) => prevToken.loc.start.line !== currentToken.loc.start.line, + check: (prevToken, currentToken) => prevToken.loc.end.line !== currentToken.loc.start.line, createFix: (token, tokenBefore) => fixer => fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ") }, missing: { messageId: "missingLineBreak", - check: (prevToken, currentToken) => prevToken.loc.start.line === currentToken.loc.start.line, + check: (prevToken, currentToken) => prevToken.loc.end.line === currentToken.loc.start.line, createFix: (token, tokenBefore) => fixer => fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") } @@ -61,7 +61,7 @@ module.exports = { */ function checkArguments(node, checker) { for (let i = 1; i < node.arguments.length; i++) { - const prevArgToken = sourceCode.getFirstToken(node.arguments[i - 1]); + const prevArgToken = sourceCode.getLastToken(node.arguments[i - 1]); const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); if (checker.check(prevArgToken, currentArgToken)) { @@ -101,10 +101,10 @@ module.exports = { } else if (option === "always") { checkArguments(node, checkers.missing); } else if (option === "consistent") { - const firstArgToken = sourceCode.getFirstToken(node.arguments[0]); + const firstArgToken = sourceCode.getLastToken(node.arguments[0]); const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); - if (firstArgToken.loc.start.line === secondArgToken.loc.start.line) { + if (firstArgToken.loc.end.line === secondArgToken.loc.start.line) { checkArguments(node, checkers.unexpected); } else { checkArguments(node, checkers.missing); diff --git a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js index 6f860290cec8b6..65534f727fad0e 100644 --- a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js +++ b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -78,9 +78,8 @@ module.exports = { /** * Returns resolved option definitions based on an option and defaults - * - * @param {any} option - The option object or string value - * @param {Object} defaults - The defaults to use if options are not present + * @param {any} option The option object or string value + * @param {Object} defaults The defaults to use if options are not present * @returns {Object} the resolved object definition */ function optionToDefinition(option, defaults) { @@ -107,8 +106,7 @@ module.exports = { /** * Checks if the given token is a star token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a star token. */ function isStarToken(token) { @@ -117,8 +115,7 @@ module.exports = { /** * Gets the generator star token of the given function node. - * - * @param {ASTNode} node - The function node to get. + * @param {ASTNode} node The function node to get. * @returns {Token} Found star token. */ function getStarToken(node) { @@ -139,7 +136,6 @@ module.exports = { /** * Checks the spacing between two tokens before or after the star token. - * * @param {string} kind Either "named", "anonymous", or "method" * @param {string} side Either "before" or "after". * @param {Token} leftToken `function` keyword token if side is "before", or @@ -173,7 +169,6 @@ module.exports = { /** * Enforces the spacing around the star if node is a generator function. - * * @param {ASTNode} node A function expression or declaration node. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/getter-return.js b/tools/node_modules/eslint/lib/rules/getter-return.js index 6549555646e355..e1468a5b19f88d 100644 --- a/tools/node_modules/eslint/lib/rules/getter-return.js +++ b/tools/node_modules/eslint/lib/rules/getter-return.js @@ -18,8 +18,7 @@ const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; /** * Checks a given code path segment is reachable. - * - * @param {CodePathSegment} segment - A segment to check. + * @param {CodePathSegment} segment A segment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -30,8 +29,7 @@ function isReachable(segment) { * Gets a readable location. * * - FunctionExpression -> the function name or `function` keyword. - * - * @param {ASTNode} node - A function node to get. + * @param {ASTNode} node A function node to get. * @returns {ASTNode|Token} The node or the token of a location. */ function getId(node) { @@ -92,8 +90,7 @@ module.exports = { * * If the last code path segment is reachable, there are paths which are not * returned or thrown. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function checkLastSegment(node) { @@ -113,7 +110,7 @@ module.exports = { /** * Checks whether a node means a getter function. - * @param {ASTNode} node - a node to check. + * @param {ASTNode} node a node to check. * @returns {boolean} if node means a getter, return true; else return false. */ function isGetter(node) { diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js index a2fa9c4f409c01..94c83692b39f0f 100644 --- a/tools/node_modules/eslint/lib/rules/indent.js +++ b/tools/node_modules/eslint/lib/rules/indent.js @@ -187,6 +187,7 @@ class BinarySearchTree { */ class TokenInfo { + // eslint-disable-next-line jsdoc/require-description /** * @param {SourceCode} sourceCode A SourceCode object */ @@ -236,6 +237,7 @@ class TokenInfo { */ class OffsetStorage { + // eslint-disable-next-line jsdoc/require-description /** * @param {TokenInfo} tokenInfo a TokenInfo instance * @param {number} indentSize The desired size of each indentation level @@ -329,7 +331,6 @@ class OffsetStorage { * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed * in the second case. - * * @param {Token} token The token * @param {Token} fromToken The token that `token` should be offset from * @param {number} offset The desired indent level @@ -358,7 +359,6 @@ class OffsetStorage { * * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: * `setDesiredOffsets([30, 43], fooToken, 1);` - * * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. * @param {Token} fromToken The token that this is offset from * @param {number} offset The desired indent level diff --git a/tools/node_modules/eslint/lib/rules/init-declarations.js b/tools/node_modules/eslint/lib/rules/init-declarations.js index 65197358e60df8..6cfdf92c909155 100644 --- a/tools/node_modules/eslint/lib/rules/init-declarations.js +++ b/tools/node_modules/eslint/lib/rules/init-declarations.js @@ -11,7 +11,7 @@ /** * Checks whether or not a given node is a for loop. - * @param {ASTNode} block - A node to check. + * @param {ASTNode} block A node to check. * @returns {boolean} `true` when the node is a for loop. */ function isForLoop(block) { @@ -22,7 +22,7 @@ function isForLoop(block) { /** * Checks whether or not a given declarator node has its initializer. - * @param {ASTNode} node - A declarator node to check. + * @param {ASTNode} node A declarator node to check. * @returns {boolean} `true` when the node has its initializer. */ function isInitialized(node) { diff --git a/tools/node_modules/eslint/lib/rules/jsx-quotes.js b/tools/node_modules/eslint/lib/rules/jsx-quotes.js index e6764b2e817732..3b282df2f07601 100644 --- a/tools/node_modules/eslint/lib/rules/jsx-quotes.js +++ b/tools/node_modules/eslint/lib/rules/jsx-quotes.js @@ -65,7 +65,7 @@ module.exports = { /** * Checks if the given string literal node uses the expected quotes - * @param {ASTNode} node - A string literal node. + * @param {ASTNode} node A string literal node. * @returns {boolean} Whether or not the string literal used the expected quotes. * @public */ diff --git a/tools/node_modules/eslint/lib/rules/keyword-spacing.js b/tools/node_modules/eslint/lib/rules/keyword-spacing.js index a1bf9910427eae..2b3fef33bd7ac4 100644 --- a/tools/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/tools/node_modules/eslint/lib/rules/keyword-spacing.js @@ -41,8 +41,7 @@ const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of" /** * Checks whether or not a given token is a "Template" token ends with "${". - * - * @param {Token} token - A token to check. + * @param {Token} token A token to check. * @returns {boolean} `true` if the token is a "Template" token ends with "${". */ function isOpenParenOfTemplate(token) { @@ -51,8 +50,7 @@ function isOpenParenOfTemplate(token) { /** * Checks whether or not a given token is a "Template" token starts with "}". - * - * @param {Token} token - A token to check. + * @param {Token} token A token to check. * @returns {boolean} `true` if the token is a "Template" token starts with "}". */ function isCloseParenOfTemplate(token) { @@ -88,8 +86,8 @@ module.exports = { retv[key] = { type: "object", properties: { - before: { type: "boolean", default: true }, - after: { type: "boolean", default: true } + before: { type: "boolean" }, + after: { type: "boolean" } }, additionalProperties: false }; @@ -114,9 +112,8 @@ module.exports = { /** * Reports a given token if there are not space(s) before the token. - * - * @param {Token} token - A token to report. - * @param {RegExp} pattern - A pattern of the previous token to check. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. * @returns {void} */ function expectSpaceBefore(token, pattern) { @@ -141,9 +138,8 @@ module.exports = { /** * Reports a given token if there are space(s) before the token. - * - * @param {Token} token - A token to report. - * @param {RegExp} pattern - A pattern of the previous token to check. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. * @returns {void} */ function unexpectSpaceBefore(token, pattern) { @@ -168,9 +164,8 @@ module.exports = { /** * Reports a given token if there are not space(s) after the token. - * - * @param {Token} token - A token to report. - * @param {RegExp} pattern - A pattern of the next token to check. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. * @returns {void} */ function expectSpaceAfter(token, pattern) { @@ -195,9 +190,8 @@ module.exports = { /** * Reports a given token if there are space(s) after the token. - * - * @param {Token} token - A token to report. - * @param {RegExp} pattern - A pattern of the next token to check. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. * @returns {void} */ function unexpectSpaceAfter(token, pattern) { @@ -222,8 +216,7 @@ module.exports = { /** * Parses the option object and determines check methods for each keyword. - * - * @param {Object|undefined} options - The option object to parse. + * @param {Object|undefined} options The option object to parse. * @returns {Object} - Normalized option object. * Keys are keywords (there are for every keyword). * Values are instances of `{"before": function, "after": function}`. @@ -263,9 +256,8 @@ module.exports = { /** * Reports a given token if usage of spacing followed by the token is * invalid. - * - * @param {Token} token - A token to report. - * @param {RegExp|undefined} pattern - Optional. A pattern of the previous + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the previous * token to check. * @returns {void} */ @@ -276,9 +268,8 @@ module.exports = { /** * Reports a given token if usage of spacing preceded by the token is * invalid. - * - * @param {Token} token - A token to report. - * @param {RegExp|undefined} pattern - Optional. A pattern of the next + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the next * token to check. * @returns {void} */ @@ -288,8 +279,7 @@ module.exports = { /** * Reports a given token if usage of spacing around the token is invalid. - * - * @param {Token} token - A token to report. + * @param {Token} token A token to report. * @returns {void} */ function checkSpacingAround(token) { @@ -300,8 +290,7 @@ module.exports = { /** * Reports the first token of a given node if the first token is a keyword * and usage of spacing around the token is invalid. - * - * @param {ASTNode|null} node - A node to report. + * @param {ASTNode|null} node A node to report. * @returns {void} */ function checkSpacingAroundFirstToken(node) { @@ -318,8 +307,7 @@ module.exports = { * * This is used for unary operators (e.g. `typeof`), `function`, and `super`. * Other rules are handling usage of spacing preceded by those keywords. - * - * @param {ASTNode|null} node - A node to report. + * @param {ASTNode|null} node A node to report. * @returns {void} */ function checkSpacingBeforeFirstToken(node) { @@ -333,8 +321,7 @@ module.exports = { /** * Reports the previous token of a given node if the token is a keyword and * usage of spacing around the token is invalid. - * - * @param {ASTNode|null} node - A node to report. + * @param {ASTNode|null} node A node to report. * @returns {void} */ function checkSpacingAroundTokenBefore(node) { @@ -348,8 +335,7 @@ module.exports = { /** * Reports `async` or `function` keywords of a given node if usage of * spacing around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForFunction(node) { @@ -366,8 +352,7 @@ module.exports = { /** * Reports `class` and `extends` keywords of a given node if usage of * spacing around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForClass(node) { @@ -378,8 +363,7 @@ module.exports = { /** * Reports `if` and `else` keywords of a given node if usage of spacing * around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForIfStatement(node) { @@ -390,8 +374,7 @@ module.exports = { /** * Reports `try`, `catch`, and `finally` keywords of a given node if usage * of spacing around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForTryStatement(node) { @@ -403,8 +386,7 @@ module.exports = { /** * Reports `do` and `while` keywords of a given node if usage of spacing * around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForDoWhileStatement(node) { @@ -415,8 +397,7 @@ module.exports = { /** * Reports `for` and `in` keywords of a given node if usage of spacing * around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForForInStatement(node) { @@ -427,8 +408,7 @@ module.exports = { /** * Reports `for` and `of` keywords of a given node if usage of spacing * around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForForOfStatement(node) { @@ -449,8 +429,7 @@ module.exports = { * * import*as A from "./a"; /*error Expected space(s) after "import". * error Expected space(s) before "as". - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForModuleDeclaration(node) { @@ -474,8 +453,7 @@ module.exports = { /** * Reports `as` keyword of a given node if usage of spacing around this * keyword is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForImportNamespaceSpecifier(node) { @@ -487,8 +465,7 @@ module.exports = { /** * Reports `static`, `get`, and `set` keywords of a given node if usage of * spacing around those keywords is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForProperty(node) { @@ -528,8 +505,7 @@ module.exports = { /** * Reports `await` keyword of a given node if usage of spacing before * this keyword is invalid. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function checkSpacingForAwaitExpression(node) { diff --git a/tools/node_modules/eslint/lib/rules/lines-around-directive.js b/tools/node_modules/eslint/lib/rules/lines-around-directive.js index 39686d98916f80..fb439dad6a3c75 100644 --- a/tools/node_modules/eslint/lib/rules/lines-around-directive.js +++ b/tools/node_modules/eslint/lib/rules/lines-around-directive.js @@ -131,7 +131,7 @@ module.exports = { /** * Check lines around directives in node - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {void} */ function checkDirectives(node) { diff --git a/tools/node_modules/eslint/lib/rules/max-len.js b/tools/node_modules/eslint/lib/rules/max-len.js index 45b02f35117834..b29099ed4c4f09 100644 --- a/tools/node_modules/eslint/lib/rules/max-len.js +++ b/tools/node_modules/eslint/lib/rules/max-len.js @@ -198,7 +198,6 @@ module.exports = { /** * Ensure that an array exists at [key] on `object`, and add `value` to it. - * * @param {Object} object the object to mutate * @param {string} key the object's key * @param {*} value the value to add @@ -214,7 +213,6 @@ module.exports = { /** * Retrieves an array containing all strings (" or ') in the source code. - * * @returns {ASTNode[]} An array of string nodes. */ function getAllStrings() { @@ -224,7 +222,6 @@ module.exports = { /** * Retrieves an array containing all template literals in the source code. - * * @returns {ASTNode[]} An array of template literal nodes. */ function getAllTemplateLiterals() { @@ -234,7 +231,6 @@ module.exports = { /** * Retrieves an array containing all RegExp literals in the source code. - * * @returns {ASTNode[]} An array of RegExp literal nodes. */ function getAllRegExpLiterals() { @@ -244,7 +240,6 @@ module.exports = { /** * A reducer to group an AST node by line number, both start and end. - * * @param {Object} acc the accumulator * @param {ASTNode} node the AST node in question * @returns {Object} the modified accumulator diff --git a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js index e9212001a34156..5407cff3c54874 100644 --- a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js +++ b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -61,7 +61,6 @@ module.exports = { /** * Reports with the first extra statement, and clears it. - * * @returns {void} */ function reportFirstExtraStatementAndClear() { @@ -81,8 +80,7 @@ module.exports = { /** * Gets the actual last token of a given node. - * - * @param {ASTNode} node - A node to get. This is a node except EmptyStatement. + * @param {ASTNode} node A node to get. This is a node except EmptyStatement. * @returns {Token} The actual last token. */ function getActualLastToken(node) { @@ -92,8 +90,7 @@ module.exports = { /** * Addresses a given node. * It updates the state of this rule, then reports the node if the node violated this rule. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function enterStatement(node) { @@ -127,8 +124,7 @@ module.exports = { /** * Updates the state of this rule with the end line of leaving node to check with the next statement. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function leaveStatement(node) { diff --git a/tools/node_modules/eslint/lib/rules/multiline-ternary.js b/tools/node_modules/eslint/lib/rules/multiline-ternary.js index 3b98d0b3cf12dc..1df90b6feb8321 100644 --- a/tools/node_modules/eslint/lib/rules/multiline-ternary.js +++ b/tools/node_modules/eslint/lib/rules/multiline-ternary.js @@ -46,9 +46,9 @@ module.exports = { /** * Tests whether node is preceded by supplied tokens - * @param {ASTNode} node - node to check - * @param {ASTNode} parentNode - parent of node to report - * @param {boolean} expected - whether newline was expected or not + * @param {ASTNode} node node to check + * @param {ASTNode} parentNode parent of node to report + * @param {boolean} expected whether newline was expected or not * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/newline-after-var.js b/tools/node_modules/eslint/lib/rules/newline-after-var.js index 8f244149c5574a..4809d9bfc5a2da 100644 --- a/tools/node_modules/eslint/lib/rules/newline-after-var.js +++ b/tools/node_modules/eslint/lib/rules/newline-after-var.js @@ -72,8 +72,7 @@ module.exports = { * var foo = 1 * * ;(a || b).doSomething() - * - * @param {ASTNode} node - The node to get. + * @param {ASTNode} node The node to get. * @returns {Token} The token to compare line to the next statement. */ function getLastToken(node) { @@ -93,7 +92,7 @@ module.exports = { /** * Determine if provided keyword is a variable declaration * @private - * @param {string} keyword - keyword to test + * @param {string} keyword keyword to test * @returns {boolean} True if `keyword` is a type of var */ function isVar(keyword) { @@ -103,7 +102,7 @@ module.exports = { /** * Determine if provided keyword is a variant of for specifiers * @private - * @param {string} keyword - keyword to test + * @param {string} keyword keyword to test * @returns {boolean} True if `keyword` is a variant of for specifier */ function isForTypeSpecifier(keyword) { @@ -113,7 +112,7 @@ module.exports = { /** * Determine if provided keyword is an export specifiers * @private - * @param {string} nodeType - nodeType to test + * @param {string} nodeType nodeType to test * @returns {boolean} True if `nodeType` is an export specifier */ function isExportSpecifier(nodeType) { @@ -124,7 +123,7 @@ module.exports = { /** * Determine if provided node is the last of their parent block. * @private - * @param {ASTNode} node - node to test + * @param {ASTNode} node node to test * @returns {boolean} True if `node` is last of their parent block. */ function isLastNode(node) { @@ -159,7 +158,7 @@ module.exports = { * set to "always", or checks that there is no blank line when mode is set * to "never" * @private - * @param {ASTNode} node - `VariableDeclaration` node to test + * @param {ASTNode} node `VariableDeclaration` node to test * @returns {void} */ function checkForBlankLine(node) { diff --git a/tools/node_modules/eslint/lib/rules/newline-before-return.js b/tools/node_modules/eslint/lib/rules/newline-before-return.js index 816ddba72b2c5a..65ca32321cc823 100644 --- a/tools/node_modules/eslint/lib/rules/newline-before-return.js +++ b/tools/node_modules/eslint/lib/rules/newline-before-return.js @@ -39,8 +39,8 @@ module.exports = { /** * Tests whether node is preceded by supplied tokens - * @param {ASTNode} node - node to check - * @param {Array} testTokens - array of tokens to test against + * @param {ASTNode} node node to check + * @param {Array} testTokens array of tokens to test against * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens * @private */ @@ -52,7 +52,7 @@ module.exports = { /** * Checks whether node is the first node after statement or in block - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {boolean} Whether or not the node is the first node after statement or in block * @private */ @@ -80,8 +80,8 @@ module.exports = { /** * Returns the number of lines of comments that precede the node - * @param {ASTNode} node - node to check for overlapping comments - * @param {number} lineNumTokenBefore - line number of previous token, to check for overlapping comments + * @param {ASTNode} node node to check for overlapping comments + * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments * @returns {number} Number of lines of comments that precede the node * @private */ @@ -115,7 +115,7 @@ module.exports = { /** * Returns the line number of the token before the node that is passed in as an argument - * @param {ASTNode} node - The node to use as the start of the calculation + * @param {ASTNode} node The node to use as the start of the calculation * @returns {number} Line number of the token before `node` * @private */ @@ -142,7 +142,7 @@ module.exports = { /** * Checks whether node is preceded by a newline - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {boolean} Whether or not the node is preceded by a newline * @private */ @@ -160,8 +160,7 @@ module.exports = { * The fix is not considered safe if the given return statement has leading comments, * as we cannot safely determine if the newline should be added before or after the comments. * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211 - * - * @param {ASTNode} node - The return statement node to check. + * @param {ASTNode} node The return statement node to check. * @returns {boolean} `true` if it can fix the node. * @private */ diff --git a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js index 4aee76da108989..8ad88386c0f61d 100644 --- a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js +++ b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -53,8 +53,7 @@ module.exports = { * Get the prefix of a given MemberExpression node. * If the MemberExpression node is a computed value it returns a * left bracket. If not it returns a period. - * - * @param {ASTNode} node - A MemberExpression node to get + * @param {ASTNode} node A MemberExpression node to get * @returns {string} The prefix of the node. */ function getPrefix(node) { @@ -64,8 +63,7 @@ module.exports = { /** * Gets the property text of a given MemberExpression node. * If the text is multiline, this returns only the first line. - * - * @param {ASTNode} node - A MemberExpression node to get. + * @param {ASTNode} node A MemberExpression node to get. * @returns {string} The property text of the node. */ function getPropertyText(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-class-assign.js b/tools/node_modules/eslint/lib/rules/no-class-assign.js index 986bdd7c1c3e01..887058ba0f967d 100644 --- a/tools/node_modules/eslint/lib/rules/no-class-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-class-assign.js @@ -33,7 +33,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { @@ -45,7 +45,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {ASTNode} node - A ClassDeclaration/ClassExpression node to check. + * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check. * @returns {void} */ function checkForClass(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js index f5c8d5f417b20a..0c6865ad59e8fe 100644 --- a/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js +++ b/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -35,8 +35,7 @@ module.exports = { /** * Checks a given node is -0 - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is -0. */ function isNegZero(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js index 895b9499dde051..b9a0e6ed0a70b5 100644 --- a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js +++ b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -14,7 +14,7 @@ const astUtils = require("./utils/ast-utils.js"); /** * Checks whether or not a node is a conditional expression. - * @param {ASTNode} node - node to test + * @param {ASTNode} node node to test * @returns {boolean} `true` if the node is a conditional expression. */ function isConditional(node) { @@ -59,7 +59,7 @@ module.exports = { /** * Reports if an arrow function contains an ambiguous conditional. - * @param {ASTNode} node - A node to check and report. + * @param {ASTNode} node A node to check and report. * @returns {void} */ function checkArrowFunc(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-console.js b/tools/node_modules/eslint/lib/rules/no-console.js index e4b5ce1ea44739..56dbbc3a9fd595 100644 --- a/tools/node_modules/eslint/lib/rules/no-console.js +++ b/tools/node_modules/eslint/lib/rules/no-console.js @@ -54,8 +54,7 @@ module.exports = { /** * Checks whether the given reference is 'console' or not. - * - * @param {eslint-scope.Reference} reference - The reference to check. + * @param {eslint-scope.Reference} reference The reference to check. * @returns {boolean} `true` if the reference is 'console'. */ function isConsole(reference) { @@ -67,8 +66,7 @@ module.exports = { /** * Checks whether the property name of the given MemberExpression node * is allowed by options or not. - * - * @param {ASTNode} node - The MemberExpression node to check. + * @param {ASTNode} node The MemberExpression node to check. * @returns {boolean} `true` if the property name of the node is allowed. */ function isAllowed(node) { @@ -80,8 +78,7 @@ module.exports = { /** * Checks whether the given reference is a member access which is not * allowed by options or not. - * - * @param {eslint-scope.Reference} reference - The reference to check. + * @param {eslint-scope.Reference} reference The reference to check. * @returns {boolean} `true` if the reference is a member access which * is not allowed by options. */ @@ -98,8 +95,7 @@ module.exports = { /** * Reports the given reference as a violation. - * - * @param {eslint-scope.Reference} reference - The reference to report. + * @param {eslint-scope.Reference} reference The reference to report. * @returns {void} */ function report(reference) { diff --git a/tools/node_modules/eslint/lib/rules/no-const-assign.js b/tools/node_modules/eslint/lib/rules/no-const-assign.js index 9f4c91fa305c16..e4ae891705f899 100644 --- a/tools/node_modules/eslint/lib/rules/no-const-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-const-assign.js @@ -33,7 +33,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-args.js b/tools/node_modules/eslint/lib/rules/no-dupe-args.js index 4e42336ae3dc34..817277f522e732 100644 --- a/tools/node_modules/eslint/lib/rules/no-dupe-args.js +++ b/tools/node_modules/eslint/lib/rules/no-dupe-args.js @@ -35,7 +35,7 @@ module.exports = { /** * Checks whether or not a given definition is a parameter's. - * @param {eslint-scope.DefEntry} def - A definition to check. + * @param {eslint-scope.DefEntry} def A definition to check. * @returns {boolean} `true` if the definition is a parameter's. */ function isParameter(def) { diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js b/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js index 97f63a2896282b..6041e9e371ce5e 100644 --- a/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js +++ b/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -32,8 +32,8 @@ module.exports = { /** * Gets state of a given member name. - * @param {string} name - A name of a member. - * @param {boolean} isStatic - A flag which specifies that is a static member. + * @param {string} name A name of a member. + * @param {boolean} isStatic A flag which specifies that is a static member. * @returns {Object} A state of a given member name. * - retv.init {boolean} A flag which shows the name is declared as normal member. * - retv.get {boolean} A flag which shows the name is declared as getter. @@ -55,8 +55,7 @@ module.exports = { /** * Gets the name text of a given node. - * - * @param {ASTNode} node - A node to get the name. + * @param {ASTNode} node A node to get the name. * @returns {string} The name text of the node. */ function getName(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-keys.js b/tools/node_modules/eslint/lib/rules/no-dupe-keys.js index 1b7f69cfaca655..89e1f2de642285 100644 --- a/tools/node_modules/eslint/lib/rules/no-dupe-keys.js +++ b/tools/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -23,9 +23,10 @@ const SET_KIND = /^(?:init|set)$/u; */ class ObjectInfo { + // eslint-disable-next-line jsdoc/require-description /** - * @param {ObjectInfo|null} upper - The information of the outer object. - * @param {ASTNode} node - The ObjectExpression node of this information. + * @param {ObjectInfo|null} upper The information of the outer object. + * @param {ASTNode} node The ObjectExpression node of this information. */ constructor(upper, node) { this.upper = upper; @@ -35,7 +36,7 @@ class ObjectInfo { /** * Gets the information of the given Property node. - * @param {ASTNode} node - The Property node to get. + * @param {ASTNode} node The Property node to get. * @returns {{get: boolean, set: boolean}} The information of the property. */ getPropertyInfo(node) { @@ -49,7 +50,7 @@ class ObjectInfo { /** * Checks whether the given property has been defined already or not. - * @param {ASTNode} node - The Property node to check. + * @param {ASTNode} node The Property node to check. * @returns {boolean} `true` if the property has been defined. */ isPropertyDefined(node) { @@ -63,7 +64,7 @@ class ObjectInfo { /** * Defines the given property. - * @param {ASTNode} node - The Property node to define. + * @param {ASTNode} node The Property node to define. * @returns {void} */ defineProperty(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js index 03b5e2c12393ae..7218dc64add343 100644 --- a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -10,8 +10,7 @@ /** * Returns the name of the module imported or re-exported. - * - * @param {ASTNode} node - A node to get. + * @param {ASTNode} node A node to get. * @returns {string} the name of the module, or empty string if no name. */ function getValue(node) { @@ -24,12 +23,11 @@ function getValue(node) { /** * Checks if the name of the import or export exists in the given array, and reports if so. - * - * @param {RuleContext} context - The ESLint rule context object. - * @param {ASTNode} node - A node to get. - * @param {string} value - The name of the imported or exported module. - * @param {string[]} array - The array containing other imports or exports in the file. - * @param {string} messageId - A messageId to be reported after the name of the module + * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {string} value The name of the imported or exported module. + * @param {string[]} array The array containing other imports or exports in the file. + * @param {string} messageId A messageId to be reported after the name of the module * * @returns {void} No return value */ @@ -47,16 +45,15 @@ function checkAndReport(context, node, value, array, messageId) { /** * @callback nodeCallback - * @param {ASTNode} node - A node to handle. + * @param {ASTNode} node A node to handle. */ /** * Returns a function handling the imports of a given file - * - * @param {RuleContext} context - The ESLint rule context object. - * @param {boolean} includeExports - Whether or not to check for exports in addition to imports. - * @param {string[]} importsInFile - The array containing other imports in the file. - * @param {string[]} exportsInFile - The array containing other exports in the file. + * @param {RuleContext} context The ESLint rule context object. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. * * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ @@ -78,10 +75,9 @@ function handleImports(context, includeExports, importsInFile, exportsInFile) { /** * Returns a function handling the exports of a given file - * - * @param {RuleContext} context - The ESLint rule context object. - * @param {string[]} importsInFile - The array containing other imports in the file. - * @param {string[]} exportsInFile - The array containing other exports in the file. + * @param {RuleContext} context The ESLint rule context object. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. * * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ diff --git a/tools/node_modules/eslint/lib/rules/no-else-return.js b/tools/node_modules/eslint/lib/rules/no-else-return.js index c63af2be523e1c..84409fac87cff8 100644 --- a/tools/node_modules/eslint/lib/rules/no-else-return.js +++ b/tools/node_modules/eslint/lib/rules/no-else-return.js @@ -58,7 +58,6 @@ module.exports = { * * This is not a generic function. In particular, it is assumed that the scope is a function scope or * a function's inner scope, and that the names can be valid identifiers in the given scope. - * * @param {string[]} names Array of variable names. * @param {eslint-scope.Scope} scope Function scope or a function's inner scope. * @returns {boolean} True if all names can be safely declared, false otherwise. @@ -134,7 +133,6 @@ module.exports = { /** * Checks whether the removal of `else` and its braces is safe from variable name collisions. - * * @param {Node} node The 'else' node. * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is. * @returns {boolean} True if it is safe, false otherwise. @@ -171,7 +169,6 @@ module.exports = { /** * Display the context report if rule is violated - * * @param {Node} node The 'else' node * @returns {void} */ @@ -255,7 +252,6 @@ module.exports = { /** * Check to see if the node is a ReturnStatement - * * @param {Node} node The node being evaluated * @returns {boolean} True if node is a return */ @@ -267,7 +263,6 @@ module.exports = { * Naive return checking, does not iterate through the whole * BlockStatement because we make the assumption that the ReturnStatement * will be the last node in the body of the BlockStatement. - * * @param {Node} node The consequent/alternate node * @returns {boolean} True if it has a return */ @@ -284,7 +279,6 @@ module.exports = { /** * Check to see if the node is valid for evaluation, * meaning it has an else. - * * @param {Node} node The node being evaluated * @returns {boolean} True if the node is valid */ @@ -296,7 +290,6 @@ module.exports = { * If the consequent is an IfStatement, check to see if it has an else * and both its consequent and alternate path return, meaning this is * a nested case of rule violation. If-Else not considered currently. - * * @param {Node} node The consequent node * @returns {boolean} True if this is a nested rule violation */ @@ -309,7 +302,6 @@ module.exports = { * Check the consequent/body node to make sure it is not * a ReturnStatement or an IfStatement that returns on both * code paths. - * * @param {Node} node The consequent or body node * @returns {boolean} `true` if it is a Return/If node that always returns. */ diff --git a/tools/node_modules/eslint/lib/rules/no-empty-function.js b/tools/node_modules/eslint/lib/rules/no-empty-function.js index 149b1477dc1bd9..c57e66fd534048 100644 --- a/tools/node_modules/eslint/lib/rules/no-empty-function.js +++ b/tools/node_modules/eslint/lib/rules/no-empty-function.js @@ -28,8 +28,7 @@ const ALLOW_OPTIONS = Object.freeze([ /** * Gets the kind of a given function node. - * - * @param {ASTNode} node - A function node to get. This is one of + * @param {ASTNode} node A function node to get. This is one of * an ArrowFunctionExpression, a FunctionDeclaration, or a * FunctionExpression. * @returns {string} The kind of the function. This is one of "functions", @@ -130,8 +129,7 @@ module.exports = { * - Not allowed by options. * - The body is empty. * - The body doesn't have any comments. - * - * @param {ASTNode} node - A function node to report. This is one of + * @param {ASTNode} node A function node to report. This is one of * an ArrowFunctionExpression, a FunctionDeclaration, or a * FunctionExpression. * @returns {void} diff --git a/tools/node_modules/eslint/lib/rules/no-eval.js b/tools/node_modules/eslint/lib/rules/no-eval.js index d580f369259e2d..9e56fb00b9fc5b 100644 --- a/tools/node_modules/eslint/lib/rules/no-eval.js +++ b/tools/node_modules/eslint/lib/rules/no-eval.js @@ -22,9 +22,8 @@ const candidatesOfGlobalObject = Object.freeze([ /** * Checks a given node is a Identifier node of the specified name. - * - * @param {ASTNode} node - A node to check. - * @param {string} name - A name to check. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. * @returns {boolean} `true` if the node is a Identifier node of the name. */ function isIdentifier(node, name) { @@ -33,9 +32,8 @@ function isIdentifier(node, name) { /** * Checks a given node is a Literal node of the specified string value. - * - * @param {ASTNode} node - A node to check. - * @param {string} name - A name to check. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. * @returns {boolean} `true` if the node is a Literal node of the name. */ function isConstant(node, name) { @@ -57,9 +55,8 @@ function isConstant(node, name) { /** * Checks a given node is a MemberExpression node which has the specified name's * property. - * - * @param {ASTNode} node - A node to check. - * @param {string} name - A name to check. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. * @returns {boolean} `true` if the node is a MemberExpression node which has * the specified name's property */ @@ -113,8 +110,7 @@ module.exports = { * * This is used in order to check whether or not `this` binding is a * reference to the global object. - * - * @param {ASTNode} node - A node of the scope. This is one of Program, + * @param {ASTNode} node A node of the scope. This is one of Program, * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. * @returns {void} */ @@ -132,7 +128,6 @@ module.exports = { /** * Pops a variable scope from the stack. - * * @returns {void} */ function exitVarScope() { @@ -148,8 +143,7 @@ module.exports = { * The location of the report is always `eval` `Identifier` (or possibly * `Literal`). The type of the report is `CallExpression` if the parent is * `CallExpression`. Otherwise, it's the given node type. - * - * @param {ASTNode} node - A node to report. + * @param {ASTNode} node A node to report. * @returns {void} */ function report(node) { @@ -171,8 +165,7 @@ module.exports = { /** * Reports accesses of `eval` via the global object. - * - * @param {eslint-scope.Scope} globalScope - The global scope. + * @param {eslint-scope.Scope} globalScope The global scope. * @returns {void} */ function reportAccessingEvalViaGlobalObject(globalScope) { @@ -205,8 +198,7 @@ module.exports = { /** * Reports all accesses of `eval` (excludes direct calls to eval). - * - * @param {eslint-scope.Scope} globalScope - The global scope. + * @param {eslint-scope.Scope} globalScope The global scope. * @returns {void} */ function reportAccessingEval(globalScope) { diff --git a/tools/node_modules/eslint/lib/rules/no-ex-assign.js b/tools/node_modules/eslint/lib/rules/no-ex-assign.js index 21d3220799b876..1163920361d2d4 100644 --- a/tools/node_modules/eslint/lib/rules/no-ex-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-ex-assign.js @@ -33,7 +33,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { diff --git a/tools/node_modules/eslint/lib/rules/no-extra-bind.js b/tools/node_modules/eslint/lib/rules/no-extra-bind.js index cc5611b10894ee..d938c0f51b06dd 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-bind.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-bind.js @@ -47,7 +47,6 @@ module.exports = { * Checks if a node is free of side effects. * * This check is stricter than it needs to be, in order to keep the implementation simple. - * * @param {ASTNode} node A node to check. * @returns {boolean} True if the node is known to be side-effect free, false otherwise. */ @@ -57,8 +56,7 @@ module.exports = { /** * Reports a given function node. - * - * @param {ASTNode} node - A node to report. This is a FunctionExpression or + * @param {ASTNode} node A node to report. This is a FunctionExpression or * an ArrowFunctionExpression. * @returns {void} */ @@ -90,8 +88,7 @@ module.exports = { * method. * * e.g. `(function() {}.bind(foo))` - * - * @param {ASTNode} node - A node to report. This is a FunctionExpression or + * @param {ASTNode} node A node to report. This is a FunctionExpression or * an ArrowFunctionExpression. * @returns {boolean} `true` if the node is the callee of `.bind()` method. */ @@ -113,8 +110,7 @@ module.exports = { /** * Adds a scope information object to the stack. - * - * @param {ASTNode} node - A node to add. This node is a FunctionExpression + * @param {ASTNode} node A node to add. This node is a FunctionExpression * or a FunctionDeclaration node. * @returns {void} */ @@ -130,8 +126,7 @@ module.exports = { * Removes the scope information object from the top of the stack. * At the same time, this reports the function node if the function has * `.bind()` and the `this` keywords found. - * - * @param {ASTNode} node - A node to remove. This node is a + * @param {ASTNode} node A node to remove. This node is a * FunctionExpression or a FunctionDeclaration node. * @returns {void} */ @@ -146,8 +141,7 @@ module.exports = { /** * Reports a given arrow function if the function is callee of `.bind()` * method. - * - * @param {ASTNode} node - A node to report. This node is an + * @param {ASTNode} node A node to report. This node is an * ArrowFunctionExpression. * @returns {void} */ @@ -159,7 +153,6 @@ module.exports = { /** * Set the mark as the `this` keyword was found in this scope. - * * @returns {void} */ function markAsThisFound() { diff --git a/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js index e818cd448c495a..336f601d1652de 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -49,7 +49,6 @@ module.exports = { /** * Check if a node is in a context where its value would be coerced to a boolean at runtime. - * * @param {ASTNode} node The node * @param {ASTNode} parent Its parent * @returns {boolean} If it is in a boolean context @@ -67,7 +66,6 @@ module.exports = { /** * Check if a node has comments inside. - * * @param {ASTNode} node The node to check. * @returns {boolean} `true` if it has comments inside. */ diff --git a/tools/node_modules/eslint/lib/rules/no-extra-label.js b/tools/node_modules/eslint/lib/rules/no-extra-label.js index 48add937e6ef57..81406e76095733 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-label.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-label.js @@ -40,8 +40,7 @@ module.exports = { /** * Creates a new scope with a breakable statement. - * - * @param {ASTNode} node - A node to create. This is a BreakableStatement. + * @param {ASTNode} node A node to create. This is a BreakableStatement. * @returns {void} */ function enterBreakableStatement(node) { @@ -54,7 +53,6 @@ module.exports = { /** * Removes the top scope of the stack. - * * @returns {void} */ function exitBreakableStatement() { @@ -66,8 +64,7 @@ module.exports = { * * This ignores it if the body is a breakable statement. * In this case it's handled in the `enterBreakableStatement` function. - * - * @param {ASTNode} node - A node to create. This is a LabeledStatement. + * @param {ASTNode} node A node to create. This is a LabeledStatement. * @returns {void} */ function enterLabeledStatement(node) { @@ -85,8 +82,7 @@ module.exports = { * * This ignores it if the body is a breakable statement. * In this case it's handled in the `exitBreakableStatement` function. - * - * @param {ASTNode} node - A node. This is a LabeledStatement. + * @param {ASTNode} node A node. This is a LabeledStatement. * @returns {void} */ function exitLabeledStatement(node) { @@ -97,8 +93,7 @@ module.exports = { /** * Reports a given control node if it's unnecessary. - * - * @param {ASTNode} node - A node. This is a BreakStatement or a + * @param {ASTNode} node A node. This is a BreakStatement or a * ContinueStatement. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/no-extra-parens.js b/tools/node_modules/eslint/lib/rules/no-extra-parens.js index c6809c355bc752..f96e572bfeef54 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-parens.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-parens.js @@ -50,7 +50,8 @@ module.exports = { returnAssign: { type: "boolean" }, ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, enforceForArrowConditionals: { type: "boolean" }, - enforceForSequenceExpressions: { type: "boolean" } + enforceForSequenceExpressions: { type: "boolean" }, + enforceForNewInMemberExpressions: { type: "boolean" } }, additionalProperties: false } @@ -80,6 +81,8 @@ module.exports = { context.options[1].enforceForArrowConditionals === false; const IGNORE_SEQUENCE_EXPRESSIONS = ALL_NODES && context.options[1] && context.options[1].enforceForSequenceExpressions === false; + const IGNORE_NEW_IN_MEMBER_EXPR = ALL_NODES && context.options[1] && + context.options[1].enforceForNewInMemberExpressions === false; const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); @@ -88,7 +91,7 @@ module.exports = { /** * Determines if this rule should be enforced for a node given the current configuration. - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the rule should be enforced for this node. * @private */ @@ -127,7 +130,7 @@ module.exports = { /** * Determines if a node is surrounded by parentheses. - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is parenthesised. * @private */ @@ -137,7 +140,7 @@ module.exports = { /** * Determines if a node is surrounded by parentheses twice. - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is doubly parenthesised. * @private */ @@ -147,7 +150,7 @@ module.exports = { /** * Determines if a node is surrounded by (potentially) invalid parentheses. - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is incorrectly parenthesised. * @private */ @@ -158,7 +161,7 @@ module.exports = { /** * Determines if a node that is expected to be parenthesised is surrounded by * (potentially) invalid extra parentheses. - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. * @private */ @@ -168,7 +171,7 @@ module.exports = { /** * Determines if a node test expression is allowed to have a parenthesised assignment - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the assignment can be parenthesised. * @private */ @@ -178,7 +181,7 @@ module.exports = { /** * Determines if a node is in a return statement - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is in a return statement. * @private */ @@ -197,7 +200,7 @@ module.exports = { /** * Determines if a constructor function is newed-up with parens - * @param {ASTNode} newExpression - The NewExpression node to be checked. + * @param {ASTNode} newExpression The NewExpression node to be checked. * @returns {boolean} True if the constructor is called with parens. * @private */ @@ -217,7 +220,7 @@ module.exports = { /** * Determines if a node is or contains an assignment expression - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is or contains an assignment expression. * @private */ @@ -239,7 +242,7 @@ module.exports = { /** * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment - * @param {ASTNode} node - The node to be checked. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the assignment can be parenthesised. * @private */ @@ -261,8 +264,8 @@ module.exports = { /** * Determines if a node following a [no LineTerminator here] restriction is * surrounded by (potentially) invalid extra parentheses. - * @param {Token} token - The token preceding the [no LineTerminator here] restriction. - * @param {ASTNode} node - The node to be checked. + * @param {Token} token The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node The node to be checked. * @returns {boolean} True if the node is incorrectly parenthesised. * @private */ @@ -567,7 +570,6 @@ module.exports = { /** * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop. - * * @param {ASTNode} node Ancestor of an 'in' expression. * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself. * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis. @@ -599,7 +601,6 @@ module.exports = { /** * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately. * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings. - * * @returns {void} */ function startNewReportsBuffering() { @@ -895,6 +896,7 @@ module.exports = { } if (nodeObjHasExcessParens && + !IGNORE_NEW_IN_MEMBER_EXPR && node.object.type === "NewExpression" && isNewExpressionWithParens(node.object)) { report(node.object); diff --git a/tools/node_modules/eslint/lib/rules/no-extra-semi.js b/tools/node_modules/eslint/lib/rules/no-extra-semi.js index e99dd67b35b8fc..e0a8df0565af98 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-semi.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-semi.js @@ -40,7 +40,7 @@ module.exports = { /** * Reports an unnecessary semicolon error. - * @param {Node|Token} nodeOrToken - A node or a token to be reported. + * @param {Node|Token} nodeOrToken A node or a token to be reported. * @returns {void} */ function report(nodeOrToken) { @@ -64,8 +64,7 @@ module.exports = { /** * Checks for a part of a class body. * This checks tokens from a specified token to a next MethodDefinition or the end of class body. - * - * @param {Token} firstToken - The first token to check. + * @param {Token} firstToken The first token to check. * @returns {void} */ function checkForPartOfClassBody(firstToken) { @@ -83,7 +82,7 @@ module.exports = { /** * Reports this empty statement, except if the parent node is a loop. - * @param {Node} node - A EmptyStatement node to be reported. + * @param {Node} node A EmptyStatement node to be reported. * @returns {void} */ EmptyStatement(node) { @@ -106,7 +105,7 @@ module.exports = { /** * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. - * @param {Node} node - A ClassBody node to check. + * @param {Node} node A ClassBody node to check. * @returns {void} */ ClassBody(node) { @@ -115,7 +114,7 @@ module.exports = { /** * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. - * @param {Node} node - A MethodDefinition node of the start point. + * @param {Node} node A MethodDefinition node of the start point. * @returns {void} */ MethodDefinition(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-fallthrough.js b/tools/node_modules/eslint/lib/rules/no-fallthrough.js index c6a71b6c8c63b2..dd1f3ed9d9a74e 100644 --- a/tools/node_modules/eslint/lib/rules/no-fallthrough.js +++ b/tools/node_modules/eslint/lib/rules/no-fallthrough.js @@ -18,9 +18,9 @@ const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; /** * Checks whether or not a given node has a fallthrough comment. - * @param {ASTNode} node - A SwitchCase node to get comments. - * @param {RuleContext} context - A rule context which stores comments. - * @param {RegExp} fallthroughCommentPattern - A pattern to match comment to. + * @param {ASTNode} node A SwitchCase node to get comments. + * @param {RuleContext} context A rule context which stores comments. + * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. * @returns {boolean} `true` if the node has a valid fallthrough comment. */ function hasFallthroughComment(node, context, fallthroughCommentPattern) { @@ -32,7 +32,7 @@ function hasFallthroughComment(node, context, fallthroughCommentPattern) { /** * Checks whether or not a given code path segment is reachable. - * @param {CodePathSegment} segment - A CodePathSegment to check. + * @param {CodePathSegment} segment A CodePathSegment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -41,8 +41,8 @@ function isReachable(segment) { /** * Checks whether a node and a token are separated by blank lines - * @param {ASTNode} node - The node to check - * @param {Token} token - The token to compare against + * @param {ASTNode} node The node to check + * @param {Token} token The token to compare against * @returns {boolean} `true` if there are blank lines between node and token */ function hasBlankLinesBetween(node, token) { diff --git a/tools/node_modules/eslint/lib/rules/no-func-assign.js b/tools/node_modules/eslint/lib/rules/no-func-assign.js index d2b4109fa33964..66756e62bef5b2 100644 --- a/tools/node_modules/eslint/lib/rules/no-func-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-func-assign.js @@ -29,7 +29,7 @@ module.exports = { /** * Reports a reference if is non initializer and writable. - * @param {References} references - Collection of reference to check. + * @param {References} references Collection of reference to check. * @returns {void} */ function checkReference(references) { @@ -40,7 +40,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { @@ -51,7 +51,7 @@ module.exports = { /** * Checks parameters of a given function node. - * @param {ASTNode} node - A function node to check. + * @param {ASTNode} node A function node to check. * @returns {void} */ function checkForFunction(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-global-assign.js b/tools/node_modules/eslint/lib/rules/no-global-assign.js index 73f36b25e4763e..4ab0c706446256 100644 --- a/tools/node_modules/eslint/lib/rules/no-global-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-global-assign.js @@ -41,9 +41,9 @@ module.exports = { /** * Reports write references. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. * @returns {void} */ function checkReference(reference, index, references) { @@ -68,7 +68,7 @@ module.exports = { /** * Reports write references if a given variable is read-only builtin. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { diff --git a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js index 7d463ac2bdc107..c80f9813020be5 100644 --- a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js +++ b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -16,7 +16,7 @@ const ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; /** * Parses and normalizes an option object. - * @param {Object} options - An option object to parse. + * @param {Object} options An option object to parse. * @returns {Object} The parsed and normalized option object. */ function parseOptions(options) { @@ -30,7 +30,7 @@ function parseOptions(options) { /** * Checks whether or not a node is a double logical nigating. - * @param {ASTNode} node - An UnaryExpression node to check. + * @param {ASTNode} node An UnaryExpression node to check. * @returns {boolean} Whether or not the node is a double logical nigating. */ function isDoubleLogicalNegating(node) { @@ -43,7 +43,7 @@ function isDoubleLogicalNegating(node) { /** * Checks whether or not a node is a binary negating of `.indexOf()` method calling. - * @param {ASTNode} node - An UnaryExpression node to check. + * @param {ASTNode} node An UnaryExpression node to check. * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. */ function isBinaryNegatingOfIndexOf(node) { @@ -58,7 +58,7 @@ function isBinaryNegatingOfIndexOf(node) { /** * Checks whether or not a node is a multiplying by one. - * @param {BinaryExpression} node - A BinaryExpression node to check. + * @param {BinaryExpression} node A BinaryExpression node to check. * @returns {boolean} Whether or not the node is a multiplying by one. */ function isMultiplyByOne(node) { @@ -118,7 +118,7 @@ function isEmptyString(node) { /** * Checks whether or not a node is a concatenating with an empty string. - * @param {ASTNode} node - A BinaryExpression node to check. + * @param {ASTNode} node A BinaryExpression node to check. * @returns {boolean} Whether or not the node is a concatenating with an empty string. */ function isConcatWithEmptyString(node) { @@ -130,7 +130,7 @@ function isConcatWithEmptyString(node) { /** * Checks whether or not a node is appended with an empty string. - * @param {ASTNode} node - An AssignmentExpression node to check. + * @param {ASTNode} node An AssignmentExpression node to check. * @returns {boolean} Whether or not the node is appended with an empty string. */ function isAppendEmptyString(node) { @@ -139,7 +139,7 @@ function isAppendEmptyString(node) { /** * Returns the operand that is not an empty string from a flagged BinaryExpression. - * @param {ASTNode} node - The flagged BinaryExpression node to check. + * @param {ASTNode} node The flagged BinaryExpression node to check. * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression. */ function getNonEmptyOperand(node) { @@ -196,9 +196,9 @@ module.exports = { /** * Reports an error and autofixes the node - * @param {ASTNode} node - An ast node to report the error on. - * @param {string} recommendation - The recommended code for the issue - * @param {bool} shouldFix - Whether this report should fix the node + * @param {ASTNode} node An ast node to report the error on. + * @param {string} recommendation The recommended code for the issue + * @param {bool} shouldFix Whether this report should fix the node * @returns {void} */ function report(node, recommendation, shouldFix) { diff --git a/tools/node_modules/eslint/lib/rules/no-implied-eval.js b/tools/node_modules/eslint/lib/rules/no-implied-eval.js index f2f6f9cea4fb68..e0764d8223db0a 100644 --- a/tools/node_modules/eslint/lib/rules/no-implied-eval.js +++ b/tools/node_modules/eslint/lib/rules/no-implied-eval.js @@ -64,7 +64,6 @@ module.exports = { * Determines if a node represents a call to a potentially implied eval. * * This checks the callee name and that there's an argument, but not the type of the argument. - * * @param {ASTNode} node The CallExpression to check. * @returns {boolean} True if the node matches, false if not. * @private diff --git a/tools/node_modules/eslint/lib/rules/no-invalid-this.js b/tools/node_modules/eslint/lib/rules/no-invalid-this.js index 30ae3fdc31a58f..b1dddd9319c745 100644 --- a/tools/node_modules/eslint/lib/rules/no-invalid-this.js +++ b/tools/node_modules/eslint/lib/rules/no-invalid-this.js @@ -38,7 +38,6 @@ module.exports = { * * The return value has a flag that whether or not `this` keyword is valid. * The flag is initialized when got at the first time. - * * @returns {{valid: boolean}} * an object which has a flag that whether or not `this` keyword is valid. */ @@ -61,8 +60,7 @@ module.exports = { * The checking context is not initialized yet. * Because most functions don't have `this` keyword. * When `this` keyword was found, the checking context is initialized. - * - * @param {ASTNode} node - A function node that was entered. + * @param {ASTNode} node A function node that was entered. * @returns {void} */ function enterFunction(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-labels.js b/tools/node_modules/eslint/lib/rules/no-labels.js index 8168dc06c17f91..52f4b0f5168b71 100644 --- a/tools/node_modules/eslint/lib/rules/no-labels.js +++ b/tools/node_modules/eslint/lib/rules/no-labels.js @@ -51,8 +51,7 @@ module.exports = { /** * Gets the kind of a given node. - * - * @param {ASTNode} node - A node to get. + * @param {ASTNode} node A node to get. * @returns {string} The kind of the node. */ function getBodyKind(node) { @@ -67,8 +66,7 @@ module.exports = { /** * Checks whether the label of a given kind is allowed or not. - * - * @param {string} kind - A kind to check. + * @param {string} kind A kind to check. * @returns {boolean} `true` if the kind is allowed. */ function isAllowed(kind) { @@ -81,8 +79,7 @@ module.exports = { /** * Checks whether a given name is a label of a loop or not. - * - * @param {string} label - A name of a label to check. + * @param {string} label A name of a label to check. * @returns {boolean} `true` if the name is a label of a loop. */ function getKind(label) { diff --git a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js index 4365b047861cc0..37561b0f9a3055 100644 --- a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js +++ b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -31,7 +31,7 @@ module.exports = { /** * Reports a node as invalid. - * @param {ASTNode} node - The node to be reported. + * @param {ASTNode} node The node to be reported. * @returns {void} */ function report(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-loop-func.js b/tools/node_modules/eslint/lib/rules/no-loop-func.js index f4531f3a7da5e7..13ebd3ee22b8d7 100644 --- a/tools/node_modules/eslint/lib/rules/no-loop-func.js +++ b/tools/node_modules/eslint/lib/rules/no-loop-func.js @@ -14,8 +14,7 @@ * * We don't need to check nested functions, so this ignores those. * `Scope.through` contains references of nested functions. - * - * @param {ASTNode} node - An AST node to get. + * @param {ASTNode} node An AST node to get. * @returns {ASTNode|null} The containing loop node of the specified node, or * `null`. */ @@ -63,9 +62,8 @@ function getContainingLoopNode(node) { /** * Gets the containing loop node of a given node. * If the loop was nested, this returns the most outer loop. - * - * @param {ASTNode} node - A node to get. This is a loop node. - * @param {ASTNode|null} excludedNode - A node that the result node should not + * @param {ASTNode} node A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode A node that the result node should not * include. * @returns {ASTNode} The most outer loop node. */ @@ -85,9 +83,8 @@ function getTopLoopNode(node, excludedNode) { /** * Checks whether a given reference which refers to an upper scope's variable is * safe or not. - * - * @param {ASTNode} loopNode - A containing loop node. - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {ASTNode} loopNode A containing loop node. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is safe or not. */ function isSafe(loopNode, reference) { @@ -131,8 +128,7 @@ function isSafe(loopNode, reference) { * It's safeafe if the reference matches one of the following condition. * - is readonly. * - doesn't exist inside a local function and after the border. - * - * @param {eslint-scope.Reference} upperRef - A reference to check. + * @param {eslint-scope.Reference} upperRef A reference to check. * @returns {boolean} `true` if the reference is safe. */ function isSafeReference(upperRef) { @@ -177,7 +173,6 @@ module.exports = { * * - has a loop node in ancestors. * - has any references which refers to an unsafe variable. - * * @param {ASTNode} node The AST node to check. * @returns {boolean} Whether or not the node is within a loop. */ diff --git a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js index 2c6ea61e283315..0909e3166d952e 100644 --- a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js +++ b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -61,7 +61,7 @@ module.exports = { /** * Returns whether the node is number literal - * @param {Node} node - the node literal being evaluated + * @param {Node} node the node literal being evaluated * @returns {boolean} true if the node is a number literal */ function isNumber(node) { @@ -70,7 +70,7 @@ module.exports = { /** * Returns whether the number should be ignored - * @param {number} num - the number + * @param {number} num the number * @returns {boolean} true if the number should be ignored */ function shouldIgnoreNumber(num) { @@ -79,8 +79,8 @@ module.exports = { /** * Returns whether the number should be ignored when used as a radix within parseInt() or Number.parseInt() - * @param {ASTNode} parent - the non-"UnaryExpression" parent - * @param {ASTNode} node - the node literal being evaluated + * @param {ASTNode} parent the non-"UnaryExpression" parent + * @param {ASTNode} node the node literal being evaluated * @returns {boolean} true if the number should be ignored */ function shouldIgnoreParseInt(parent, node) { @@ -93,7 +93,7 @@ module.exports = { /** * Returns whether the number should be ignored when used to define a JSX prop - * @param {ASTNode} parent - the non-"UnaryExpression" parent + * @param {ASTNode} parent the non-"UnaryExpression" parent * @returns {boolean} true if the number should be ignored */ function shouldIgnoreJSXNumbers(parent) { @@ -102,7 +102,7 @@ module.exports = { /** * Returns whether the number should be ignored when used as an array index with enabled 'ignoreArrayIndexes' option. - * @param {ASTNode} parent - the non-"UnaryExpression" parent. + * @param {ASTNode} parent the non-"UnaryExpression" parent. * @returns {boolean} true if the number should be ignored */ function shouldIgnoreArrayIndexes(parent) { diff --git a/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js b/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js index d7c394f463b6a6..9315ba64972f79 100644 --- a/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js +++ b/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -16,7 +16,6 @@ const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurr * * CharacterClassRange syntax can steal a part of character sequence, * so this function reverts CharacterClassRange syntax and restore the sequence. - * * @param {regexpp.AST.CharacterClassElement[]} nodes The node list to iterate character sequences. * @returns {IterableIterator} The list of character sequences. */ @@ -131,12 +130,6 @@ module.exports = { * @returns {void} */ function verify(node, pattern, flags) { - const patternNode = parser.parsePattern( - pattern, - 0, - pattern.length, - flags.includes("u") - ); const has = { surrogatePairWithoutUFlag: false, combiningClass: false, @@ -145,6 +138,20 @@ module.exports = { regionalIndicatorSymbol: false, zwj: false }; + let patternNode; + + try { + patternNode = parser.parsePattern( + pattern, + 0, + pattern.length, + flags.includes("u") + ); + } catch (e) { + + // Ignore regular expressions with syntax errors + return; + } visitRegExpAST(patternNode, { onCharacterClassEnter(ccNode) { diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js index 8d1c7a6af43975..80fac79affdb0e 100644 --- a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js +++ b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -40,8 +40,7 @@ const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; /** * Normalizes options. - * - * @param {Object|undefined} options - A options object to normalize. + * @param {Object|undefined} options A options object to normalize. * @returns {Object} Normalized option object. */ function normalizeOptions(options = {}) { @@ -57,10 +56,9 @@ function normalizeOptions(options = {}) { /** * Checks whether any group which includes both given operator exists or not. - * - * @param {Array.} groups - A list of groups to check. - * @param {string} left - An operator. - * @param {string} right - Another operator. + * @param {Array.} groups A list of groups to check. + * @param {string} left An operator. + * @param {string} right Another operator. * @returns {boolean} `true` if such group existed. */ function includesBothInAGroup(groups, left, right) { @@ -69,8 +67,7 @@ function includesBothInAGroup(groups, left, right) { /** * Checks whether the given node is a conditional expression and returns the test node else the left node. - * - * @param {ASTNode} node - A node which can be a BinaryExpression or a LogicalExpression node. + * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node. * This parent node can be BinaryExpression, LogicalExpression * , or a ConditionalExpression node * @returns {ASTNode} node the appropriate node(left or test). @@ -124,8 +121,7 @@ module.exports = { /** * Checks whether a given node should be ignored by options or not. - * - * @param {ASTNode} node - A node to check. This is a BinaryExpression + * @param {ASTNode} node A node to check. This is a BinaryExpression * node or a LogicalExpression node. This parent node is one of * them, too. * @returns {boolean} `true` if the node should be ignored. @@ -146,8 +142,7 @@ module.exports = { /** * Checks whether the operator of a given node is mixed with parent * node's operator or not. - * - * @param {ASTNode} node - A node to check. This is a BinaryExpression + * @param {ASTNode} node A node to check. This is a BinaryExpression * node or a LogicalExpression node. This parent node is one of * them, too. * @returns {boolean} `true` if the node was mixed. @@ -163,8 +158,7 @@ module.exports = { /** * Checks whether the operator of a given node is mixed with a * conditional expression. - * - * @param {ASTNode} node - A node to check. This is a conditional + * @param {ASTNode} node A node to check. This is a conditional * expression node * @returns {boolean} `true` if the node was mixed. */ @@ -174,8 +168,7 @@ module.exports = { /** * Gets the operator token of a given node. - * - * @param {ASTNode} node - A node to check. This is a BinaryExpression + * @param {ASTNode} node A node to check. This is a BinaryExpression * node or a LogicalExpression node. * @returns {Token} The operator token of the node. */ @@ -186,8 +179,7 @@ module.exports = { /** * Reports both the operator of a given node and the operator of the * parent node. - * - * @param {ASTNode} node - A node to check. This is a BinaryExpression + * @param {ASTNode} node A node to check. This is a BinaryExpression * node or a LogicalExpression node. This parent node is one of * them, too. * @returns {void} @@ -205,13 +197,13 @@ module.exports = { context.report({ node: left, - loc: getOperatorToken(left).loc.start, + loc: getOperatorToken(left).loc, message, data }); context.report({ node: right, - loc: getOperatorToken(right).loc.start, + loc: getOperatorToken(right).loc, message, data }); @@ -220,8 +212,7 @@ module.exports = { /** * Checks between the operator of this node and the operator of the * parent node. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js index e3164a8aba67e5..fda8a11d9e2e74 100644 --- a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js +++ b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -58,7 +58,6 @@ module.exports = { /** * Returns the list of built-in modules. - * * @returns {string[]} An array of built-in Node.js modules. */ function getBuiltinModules() { diff --git a/tools/node_modules/eslint/lib/rules/no-multi-spaces.js b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js index 64a04c5cc58354..403d04da9dd9ec 100644 --- a/tools/node_modules/eslint/lib/rules/no-multi-spaces.js +++ b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -121,7 +121,7 @@ module.exports = { context.report({ node: rightToken, - loc: rightToken.loc.start, + loc: { start: leftToken.loc.end, end: rightToken.loc.start }, message: "Multiple spaces found before '{{displayValue}}'.", data: { displayValue }, fix: fixer => fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ") diff --git a/tools/node_modules/eslint/lib/rules/no-native-reassign.js b/tools/node_modules/eslint/lib/rules/no-native-reassign.js index 9ecfb4da7cbee9..eb233c80b1cca0 100644 --- a/tools/node_modules/eslint/lib/rules/no-native-reassign.js +++ b/tools/node_modules/eslint/lib/rules/no-native-reassign.js @@ -46,9 +46,9 @@ module.exports = { /** * Reports write references. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. * @returns {void} */ function checkReference(reference, index, references) { @@ -73,7 +73,7 @@ module.exports = { /** * Reports write references if a given variable is read-only builtin. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { diff --git a/tools/node_modules/eslint/lib/rules/no-param-reassign.js b/tools/node_modules/eslint/lib/rules/no-param-reassign.js index 9b8c828d2c2a1d..d65eb34762aaf2 100644 --- a/tools/node_modules/eslint/lib/rules/no-param-reassign.js +++ b/tools/node_modules/eslint/lib/rules/no-param-reassign.js @@ -45,6 +45,13 @@ module.exports = { type: "string" }, uniqueItems: true + }, + ignorePropertyModificationsForRegex: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true } }, additionalProperties: false @@ -57,10 +64,11 @@ module.exports = { create(context) { const props = context.options[0] && context.options[0].props; const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; + const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; /** * Checks whether or not the reference modifies properties of its variable. - * @param {Reference} reference - A reference to check. + * @param {Reference} reference A reference to check. * @returns {boolean} Whether or not the reference modifies properties of its variable. */ function isModifyingProp(reference) { @@ -136,11 +144,24 @@ module.exports = { return false; } + /** + * Tests that an identifier name matches any of the ignored property assignments. + * First we test strings in ignoredPropertyAssignmentsFor. + * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings. + * @param {string} identifierName A string that describes the name of an identifier to + * ignore property assignments for. + * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not. + */ + function isIgnoredPropertyAssignment(identifierName) { + return ignoredPropertyAssignmentsFor.includes(identifierName) || + ignoredPropertyAssignmentsForRegex.some(ignored => new RegExp(ignored, "u").test(identifierName)); + } + /** * Reports a reference if is non initializer and writable. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. * @returns {void} */ function checkReference(reference, index, references) { @@ -157,7 +178,7 @@ module.exports = { ) { if (reference.isWrite()) { context.report({ node: identifier, message: "Assignment to function parameter '{{name}}'.", data: { name: identifier.name } }); - } else if (props && isModifyingProp(reference) && ignoredPropertyAssignmentsFor.indexOf(identifier.name) === -1) { + } else if (props && isModifyingProp(reference) && !isIgnoredPropertyAssignment(identifier.name)) { context.report({ node: identifier, message: "Assignment to property of function parameter '{{name}}'.", data: { name: identifier.name } }); } } @@ -165,7 +186,7 @@ module.exports = { /** * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. + * @param {Variable} variable A variable to check. * @returns {void} */ function checkVariable(variable) { @@ -176,7 +197,7 @@ module.exports = { /** * Checks parameters of a given function node. - * @param {ASTNode} node - A function node to check. + * @param {ASTNode} node A function node to check. * @returns {void} */ function checkForFunction(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-redeclare.js b/tools/node_modules/eslint/lib/rules/no-redeclare.js index 9de2f4ed730364..6ddb21c9e15d9d 100644 --- a/tools/node_modules/eslint/lib/rules/no-redeclare.js +++ b/tools/node_modules/eslint/lib/rules/no-redeclare.js @@ -86,7 +86,7 @@ module.exports = { /** * Find variables in a given scope and flag redeclared ones. - * @param {Scope} scope - An eslint-scope scope object. + * @param {Scope} scope An eslint-scope scope object. * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-regex-spaces.js b/tools/node_modules/eslint/lib/rules/no-regex-spaces.js index 41f5e149df049b..7581e9271fdf14 100644 --- a/tools/node_modules/eslint/lib/rules/no-regex-spaces.js +++ b/tools/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -52,7 +52,6 @@ module.exports = { /** * Validate regular expression - * * @param {ASTNode} nodeToReport Node to report. * @param {string} pattern Regular expression pattern to validate. * @param {string} rawPattern Raw representation of the pattern in the source code. diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js index 6f3d2158c8d239..bed9c2432a58dd 100644 --- a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -116,7 +116,7 @@ module.exports = { /** * Checks to see if "*" is being used to import everything. - * @param {Set.} importNames - Set of import names that are being imported + * @param {Set.} importNames Set of import names that are being imported * @returns {boolean} whether everything is imported or not */ function isEverythingImported(importNames) { @@ -145,7 +145,7 @@ module.exports = { /** * Report a restricted path specifically for patterns. - * @param {node} node - representing the restricted path reference + * @param {node} node representing the restricted path reference * @returns {void} * @private */ @@ -163,8 +163,8 @@ module.exports = { /** * Report a restricted path specifically when using the '*' import. - * @param {string} importSource - path of the import - * @param {node} node - representing the restricted path reference + * @param {string} importSource path of the import + * @param {node} node representing the restricted path reference * @returns {void} * @private */ @@ -185,8 +185,8 @@ module.exports = { /** * Check if the given importSource is restricted because '*' is being imported. - * @param {string} importSource - path of the import - * @param {Set.} importNames - Set of import names that are being imported + * @param {string} importSource path of the import + * @param {Set.} importNames Set of import names that are being imported * @returns {boolean} whether the path is restricted * @private */ @@ -198,8 +198,8 @@ module.exports = { /** * Check if the given importNames are restricted given a list of restrictedImportNames. - * @param {Set.} importNames - Set of import names that are being imported - * @param {string[]} restrictedImportNames - array of import names that are restricted for this import + * @param {Set.} importNames Set of import names that are being imported + * @param {string[]} restrictedImportNames array of import names that are restricted for this import * @returns {boolean} whether the objectName is restricted * @private */ @@ -211,8 +211,8 @@ module.exports = { /** * Check if the given importSource is a restricted path. - * @param {string} importSource - path of the import - * @param {Set.} importNames - Set of import names that are being imported + * @param {string} importSource path of the import + * @param {Set.} importNames Set of import names that are being imported * @returns {boolean} whether the variable is a restricted path or not * @private */ @@ -232,7 +232,7 @@ module.exports = { /** * Check if the given importSource is restricted by a pattern. - * @param {string} importSource - path of the import + * @param {string} importSource path of the import * @returns {boolean} whether the variable is a restricted pattern or not * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-self-assign.js b/tools/node_modules/eslint/lib/rules/no-self-assign.js index 6ebd1925e497cd..705d0f409c4128 100644 --- a/tools/node_modules/eslint/lib/rules/no-self-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-self-assign.js @@ -20,9 +20,8 @@ const SPACES = /\s+/gu; /** * Checks whether the property of 2 given member expression nodes are the same * property or not. - * - * @param {ASTNode} left - A member expression node to check. - * @param {ASTNode} right - Another member expression node to check. + * @param {ASTNode} left A member expression node to check. + * @param {ASTNode} right Another member expression node to check. * @returns {boolean} `true` if the member expressions have the same property. */ function isSameProperty(left, right) { @@ -43,9 +42,8 @@ function isSameProperty(left, right) { /** * Checks whether 2 given member expression nodes are the reference to the same * property or not. - * - * @param {ASTNode} left - A member expression node to check. - * @param {ASTNode} right - Another member expression node to check. + * @param {ASTNode} left A member expression node to check. + * @param {ASTNode} right Another member expression node to check. * @returns {boolean} `true` if the member expressions are the reference to the * same property or not. */ @@ -63,18 +61,20 @@ function isSameMember(left, right) { if (lobj.type === "MemberExpression") { return isSameMember(lobj, robj); } + if (lobj.type === "ThisExpression") { + return true; + } return lobj.type === "Identifier" && lobj.name === robj.name; } /** * Traverses 2 Pattern nodes in parallel, then reports self-assignments. - * - * @param {ASTNode|null} left - A left node to traverse. This is a Pattern or + * @param {ASTNode|null} left A left node to traverse. This is a Pattern or * a Property. - * @param {ASTNode|null} right - A right node to traverse. This is a Pattern or + * @param {ASTNode|null} right A right node to traverse. This is a Pattern or * a Property. - * @param {boolean} props - The flag to check member expressions as well. - * @param {Function} report - A callback function to report. + * @param {boolean} props The flag to check member expressions as well. + * @param {Function} report A callback function to report. * @returns {void} */ function eachSelfAssignment(left, right, props, report) { @@ -205,8 +205,7 @@ module.exports = { /** * Reports a given node as self assignments. - * - * @param {ASTNode} node - A node to report. This is an Identifier node. + * @param {ASTNode} node A node to report. This is an Identifier node. * @returns {void} */ function report(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-sequences.js b/tools/node_modules/eslint/lib/rules/no-sequences.js index 39d147b69be165..8046a8711a3e9a 100644 --- a/tools/node_modules/eslint/lib/rules/no-sequences.js +++ b/tools/node_modules/eslint/lib/rules/no-sequences.js @@ -54,7 +54,7 @@ module.exports = { /** * Determines whether a node is required by the grammar to be wrapped in * parens, e.g. the test of an if statement. - * @param {ASTNode} node - The AST node + * @param {ASTNode} node The AST node * @returns {boolean} True if parens around node belong to parent node. */ function requiresExtraParens(node) { @@ -64,7 +64,7 @@ module.exports = { /** * Check if a node is wrapped in parens. - * @param {ASTNode} node - The AST node + * @param {ASTNode} node The AST node * @returns {boolean} True if the node has a paren on each side. */ function isParenthesised(node) { @@ -73,7 +73,7 @@ module.exports = { /** * Check if a node is wrapped in two levels of parens. - * @param {ASTNode} node - The AST node + * @param {ASTNode} node The AST node * @returns {boolean} True if two parens surround the node on each side. */ function isParenthesisedTwice(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-shadow.js b/tools/node_modules/eslint/lib/rules/no-shadow.js index 1993d60078b662..bad6cb5f3094cc 100644 --- a/tools/node_modules/eslint/lib/rules/no-shadow.js +++ b/tools/node_modules/eslint/lib/rules/no-shadow.js @@ -54,7 +54,6 @@ module.exports = { /** * Check if variable name is allowed. - * * @param {ASTNode} variable The variable to check. * @returns {boolean} Whether or not the variable name is allowed. */ @@ -67,7 +66,6 @@ module.exports = { * * ClassDeclaration creates two variables of its name into its outer scope and its class scope. * So we should ignore the variable in the class scope. - * * @param {Object} variable The variable to check. * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. */ @@ -82,7 +80,6 @@ module.exports = { * * To avoid reporting at declarations such as `var a = function a() {};`. * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. - * * @param {Object} variable The variable to check. * @param {Object} scopeVar The scope variable to look for. * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. @@ -139,7 +136,7 @@ module.exports = { /** * Checks the current context for shadowed variables. - * @param {Scope} scope - Fixme + * @param {Scope} scope Fixme * @returns {void} */ function checkForShadows(scope) { diff --git a/tools/node_modules/eslint/lib/rules/no-tabs.js b/tools/node_modules/eslint/lib/rules/no-tabs.js index 0c0a220110c609..3fc0b78b6e741c 100644 --- a/tools/node_modules/eslint/lib/rules/no-tabs.js +++ b/tools/node_modules/eslint/lib/rules/no-tabs.js @@ -55,8 +55,14 @@ module.exports = { context.report({ node, loc: { - line: index + 1, - column: match.index + start: { + line: index + 1, + column: match.index + }, + end: { + line: index + 1, + column: match.index + match[0].length + } }, message: "Unexpected tab character." }); diff --git a/tools/node_modules/eslint/lib/rules/no-this-before-super.js b/tools/node_modules/eslint/lib/rules/no-this-before-super.js index b271797240a5ec..6975ea060bf00d 100644 --- a/tools/node_modules/eslint/lib/rules/no-this-before-super.js +++ b/tools/node_modules/eslint/lib/rules/no-this-before-super.js @@ -17,7 +17,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a given node is a constructor. - * @param {ASTNode} node - A node to check. This node type is one of + * @param {ASTNode} node A node to check. This node type is one of * `Program`, `FunctionDeclaration`, `FunctionExpression`, and * `ArrowFunctionExpression`. * @returns {boolean} `true` if the node is a constructor. @@ -71,7 +71,7 @@ module.exports = { /** * Gets whether or not `super()` is called in a given code path segment. - * @param {CodePathSegment} segment - A code path segment to get. + * @param {CodePathSegment} segment A code path segment to get. * @returns {boolean} `true` if `super()` is called. */ function isCalled(segment) { @@ -99,7 +99,7 @@ module.exports = { /** * Sets a given node as invalid. - * @param {ASTNode} node - A node to set as invalid. This is one of + * @param {ASTNode} node A node to set as invalid. This is one of * a ThisExpression and a Super. * @returns {void} */ @@ -135,8 +135,8 @@ module.exports = { /** * Adds information of a constructor into the stack. - * @param {CodePath} codePath - A code path which was started. - * @param {ASTNode} node - The current node. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. * @returns {void} */ onCodePathStart(codePath, node) { @@ -169,8 +169,7 @@ module.exports = { * * And this treverses all segments of this code path then reports every * invalid node. - * - * @param {CodePath} codePath - A code path which was ended. + * @param {CodePath} codePath A code path which was ended. * @returns {void} */ onCodePathEnd(codePath) { @@ -204,7 +203,7 @@ module.exports = { /** * Initialize information of a given code path segment. - * @param {CodePathSegment} segment - A code path segment to initialize. + * @param {CodePathSegment} segment A code path segment to initialize. * @returns {void} */ onCodePathSegmentStart(segment) { @@ -225,9 +224,9 @@ module.exports = { /** * Update information of the code path segment when a code path was * looped. - * @param {CodePathSegment} fromSegment - The code path segment of the + * @param {CodePathSegment} fromSegment The code path segment of the * end of a loop. - * @param {CodePathSegment} toSegment - A code path segment of the head + * @param {CodePathSegment} toSegment A code path segment of the head * of a loop. * @returns {void} */ @@ -258,7 +257,7 @@ module.exports = { /** * Reports if this is before `super()`. - * @param {ASTNode} node - A target node. + * @param {ASTNode} node A target node. * @returns {void} */ ThisExpression(node) { @@ -269,7 +268,7 @@ module.exports = { /** * Reports if this is before `super()`. - * @param {ASTNode} node - A target node. + * @param {ASTNode} node A target node. * @returns {void} */ Super(node) { @@ -280,7 +279,7 @@ module.exports = { /** * Marks `super()` called. - * @param {ASTNode} node - A target node. + * @param {ASTNode} node A target node. * @returns {void} */ "CallExpression:exit"(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js index 83c01d5e7e2bb3..3a4124f4c0f7a4 100644 --- a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js +++ b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -90,7 +90,11 @@ module.exports = { const lines = new Set(); comments.forEach(comment => { - for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) { + const endLine = comment.type === "Block" + ? comment.loc.end.line - 1 + : comment.loc.end.line; + + for (let i = comment.loc.start.line; i <= endLine; i++) { lines.add(i); } }); @@ -122,7 +126,7 @@ module.exports = { fixRange = []; for (let i = 0, ii = lines.length; i < ii; i++) { - const matches = re.exec(lines[i]); + const lineNumber = i + 1; /* * Always add linebreak length to line length to accommodate for line break (\n or \r\n) @@ -132,14 +136,22 @@ module.exports = { const linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; const lineLength = lines[i].length + linebreakLength; + const matches = re.exec(lines[i]); + if (matches) { const location = { - line: i + 1, - column: matches.index + start: { + line: lineNumber, + column: matches.index + }, + end: { + line: lineNumber, + column: lineLength - linebreakLength + } }; - const rangeStart = totalLength + location.column; - const rangeEnd = totalLength + lineLength - linebreakLength; + const rangeStart = totalLength + location.start.column; + const rangeEnd = totalLength + location.end.column; const containingNode = sourceCode.getNodeByRangeIndex(rangeStart); if (containingNode && containingNode.type === "TemplateElement" && @@ -160,7 +172,7 @@ module.exports = { fixRange = [rangeStart, rangeEnd]; - if (!ignoreComments || !commentLineNumbers.has(location.line)) { + if (!ignoreComments || !commentLineNumbers.has(lineNumber)) { report(node, location, fixRange); } } diff --git a/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js index 85292d136ec532..3b8e7417d5b586 100644 --- a/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +++ b/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -35,8 +35,7 @@ const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; /** * Checks whether or not a given reference is a write reference. - * - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is a write reference. */ function isWriteReference(reference) { @@ -53,8 +52,7 @@ function isWriteReference(reference) { /** * Checks whether or not a given loop condition info does not have the modified * flag. - * - * @param {LoopConditionInfo} condition - A loop condition info to check. + * @param {LoopConditionInfo} condition A loop condition info to check. * @returns {boolean} `true` if the loop condition info is "unmodified". */ function isUnmodified(condition) { @@ -64,8 +62,7 @@ function isUnmodified(condition) { /** * Checks whether or not a given loop condition info does not have the modified * flag and does not have the group this condition belongs to. - * - * @param {LoopConditionInfo} condition - A loop condition info to check. + * @param {LoopConditionInfo} condition A loop condition info to check. * @returns {boolean} `true` if the loop condition info is "unmodified". */ function isUnmodifiedAndNotBelongToGroup(condition) { @@ -74,9 +71,8 @@ function isUnmodifiedAndNotBelongToGroup(condition) { /** * Checks whether or not a given reference is inside of a given node. - * - * @param {ASTNode} node - A node to check. - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is inside of the node. */ function isInRange(node, reference) { @@ -88,9 +84,8 @@ function isInRange(node, reference) { /** * Checks whether or not a given reference is inside of a loop node's condition. - * - * @param {ASTNode} node - A node to check. - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is inside of the loop node's * condition. */ @@ -108,8 +103,7 @@ const isInLoop = { /** * Gets the function which encloses a given reference. * This supports only FunctionDeclaration. - * - * @param {eslint-scope.Reference} reference - A reference to get. + * @param {eslint-scope.Reference} reference A reference to get. * @returns {ASTNode|null} The function node or null. */ function getEncloseFunctionDeclaration(reference) { @@ -128,9 +122,8 @@ function getEncloseFunctionDeclaration(reference) { /** * Updates the "modified" flags of given loop conditions with given modifiers. - * - * @param {LoopConditionInfo[]} conditions - The loop conditions to be updated. - * @param {eslint-scope.Reference[]} modifiers - The references to update. + * @param {LoopConditionInfo[]} conditions The loop conditions to be updated. + * @param {eslint-scope.Reference[]} modifiers The references to update. * @returns {void} */ function updateModifiedFlag(conditions, modifiers) { @@ -183,8 +176,7 @@ module.exports = { /** * Reports a given condition info. - * - * @param {LoopConditionInfo} condition - A loop condition info to report. + * @param {LoopConditionInfo} condition A loop condition info to report. * @returns {void} */ function report(condition) { @@ -199,8 +191,7 @@ module.exports = { /** * Registers given conditions to the group the condition belongs to. - * - * @param {LoopConditionInfo[]} conditions - A loop condition info to + * @param {LoopConditionInfo[]} conditions A loop condition info to * register. * @returns {void} */ @@ -222,8 +213,7 @@ module.exports = { /** * Reports references which are inside of unmodified groups. - * - * @param {LoopConditionInfo[]} conditions - A loop condition info to report. + * @param {LoopConditionInfo[]} conditions A loop condition info to report. * @returns {void} */ function checkConditionsInGroup(conditions) { @@ -234,8 +224,7 @@ module.exports = { /** * Checks whether or not a given group node has any dynamic elements. - * - * @param {ASTNode} root - A node to check. + * @param {ASTNode} root A node to check. * This node is one of BinaryExpression or ConditionalExpression. * @returns {boolean} `true` if the node is dynamic. */ @@ -259,8 +248,7 @@ module.exports = { /** * Creates the loop condition information from a given reference. - * - * @param {eslint-scope.Reference} reference - A reference to create. + * @param {eslint-scope.Reference} reference A reference to create. * @returns {LoopConditionInfo|null} Created loop condition info, or null. */ function toLoopCondition(reference) { @@ -313,8 +301,7 @@ module.exports = { /** * Finds unmodified references which are inside of a loop condition. * Then reports the references which are outside of groups. - * - * @param {eslint-scope.Variable} variable - A variable to report. + * @param {eslint-scope.Variable} variable A variable to report. * @returns {void} */ function checkReferences(variable) { diff --git a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js index 331c9ce94d7fad..893baa34f74917 100644 --- a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js +++ b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -57,7 +57,7 @@ module.exports = { /** * Test if the node is a boolean literal - * @param {ASTNode} node - The node to report. + * @param {ASTNode} node The node to report. * @returns {boolean} True if the its a boolean literal * @private */ @@ -91,7 +91,7 @@ module.exports = { /** * Tests if a given node always evaluates to a boolean value - * @param {ASTNode} node - An expression node + * @param {ASTNode} node An expression node * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value */ function isBooleanExpression(node) { @@ -101,7 +101,7 @@ module.exports = { /** * Test if the node matches the pattern id ? id : expression - * @param {ASTNode} node - The ConditionalExpression to check. + * @param {ASTNode} node The ConditionalExpression to check. * @returns {boolean} True if the pattern is matched, and false otherwise * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-unreachable.js b/tools/node_modules/eslint/lib/rules/no-unreachable.js index 8ea2583f7cb251..91c4ca7150903f 100644 --- a/tools/node_modules/eslint/lib/rules/no-unreachable.js +++ b/tools/node_modules/eslint/lib/rules/no-unreachable.js @@ -10,7 +10,7 @@ /** * Checks whether or not a given variable declarator has the initializer. - * @param {ASTNode} node - A VariableDeclarator node to check. + * @param {ASTNode} node A VariableDeclarator node to check. * @returns {boolean} `true` if the node has the initializer. */ function isInitialized(node) { @@ -19,7 +19,7 @@ function isInitialized(node) { /** * Checks whether or not a given code path segment is unreachable. - * @param {CodePathSegment} segment - A CodePathSegment to check. + * @param {CodePathSegment} segment A CodePathSegment to check. * @returns {boolean} `true` if the segment is unreachable. */ function isUnreachable(segment) { @@ -57,7 +57,7 @@ class ConsecutiveRange { /** * Checks whether the given node is inside of this range. - * @param {ASTNode|Token} node - The node to check. + * @param {ASTNode|Token} node The node to check. * @returns {boolean} `true` if the node is inside of this range. */ contains(node) { @@ -69,7 +69,7 @@ class ConsecutiveRange { /** * Checks whether the given node is consecutive to this range. - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is consecutive to this range. */ isConsecutive(node) { @@ -78,7 +78,7 @@ class ConsecutiveRange { /** * Merges the given node to this range. - * @param {ASTNode} node - The node to merge. + * @param {ASTNode} node The node to merge. * @returns {void} */ merge(node) { @@ -87,7 +87,7 @@ class ConsecutiveRange { /** * Resets this range by the given node or null. - * @param {ASTNode|null} node - The node to reset, or null. + * @param {ASTNode|null} node The node to reset, or null. * @returns {void} */ reset(node) { @@ -120,7 +120,7 @@ module.exports = { /** * Reports a given node if it's unreachable. - * @param {ASTNode} node - A statement node to report. + * @param {ASTNode} node A statement node to report. * @returns {void} */ function reportIfUnreachable(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js b/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js index 4daa63b6929e30..a41dff9c80372f 100644 --- a/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js +++ b/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -35,8 +35,7 @@ module.exports = { /** * Checks if the node is the finalizer of a TryStatement - * - * @param {ASTNode} node - node to check. + * @param {ASTNode} node node to check. * @returns {boolean} - true if the node is the finalizer of a TryStatement */ function isFinallyBlock(node) { @@ -45,9 +44,8 @@ module.exports = { /** * Climbs up the tree if the node is not a sentinel node - * - * @param {ASTNode} node - node to check. - * @param {string} label - label of the break or continue statement + * @param {ASTNode} node node to check. + * @param {string} label label of the break or continue statement * @returns {boolean} - return whether the node is a finally block or a sentinel node */ function isInFinallyBlock(node, label) { @@ -82,8 +80,7 @@ module.exports = { /** * Checks whether the possibly-unsafe statement is inside a finally block. - * - * @param {ASTNode} node - node to check. + * @param {ASTNode} node node to check. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js b/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js index 717e5f6be3977e..5c8f569d7b8a2d 100644 --- a/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js +++ b/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -16,19 +16,26 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ /** - * Checks whether the given operator is a relational operator or not. - * - * @param {string} op - The operator type to check. - * @returns {boolean} `true` if the operator is a relational operator. + * Checks whether the given operator is `in` or `instanceof` + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is `in` or `instanceof` */ -function isRelationalOperator(op) { +function isInOrInstanceOfOperator(op) { return op === "in" || op === "instanceof"; } +/** + * Checks whether the given operator is an ordering relational operator or not. + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is an ordering relational operator. + */ +function isOrderingRelationalOperator(op) { + return op === "<" || op === ">" || op === ">=" || op === "<="; +} + /** * Checks whether the given node is a logical negation expression or not. - * - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is a logical negation expression. */ function isNegation(node) { @@ -50,7 +57,18 @@ module.exports = { url: "https://eslint.org/docs/rules/no-unsafe-negation" }, - schema: [], + schema: [ + { + type: "object", + properties: { + enforceForOrderingRelations: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], fixable: null, messages: { unexpected: "Unexpected negating the left operand of '{{operator}}' operator." @@ -59,10 +77,15 @@ module.exports = { create(context) { const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const enforceForOrderingRelations = options.enforceForOrderingRelations === true; return { BinaryExpression(node) { - if (isRelationalOperator(node.operator) && + const orderingRelationRuleApplies = enforceForOrderingRelations && isOrderingRelationalOperator(node.operator); + + if ( + (isInOrInstanceOfOperator(node.operator) || orderingRelationRuleApplies) && isNegation(node.left) && !astUtils.isParenthesised(sourceCode, node.left) ) { diff --git a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js index 02cce309ee973a..fd0440256be016 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -47,8 +47,9 @@ module.exports = { allowTernary = config.allowTernary || false, allowTaggedTemplates = config.allowTaggedTemplates || false; + // eslint-disable-next-line jsdoc/require-description /** - * @param {ASTNode} node - any node + * @param {ASTNode} node any node * @returns {boolean} whether the given node structurally represents a directive */ function looksLikeDirective(node) { @@ -56,9 +57,10 @@ module.exports = { node.expression.type === "Literal" && typeof node.expression.value === "string"; } + // eslint-disable-next-line jsdoc/require-description /** - * @param {Function} predicate - ([a] -> Boolean) the function used to make the determination - * @param {a[]} list - the input list + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list * @returns {a[]} the leading sequence of members in the given list that pass the given predicate */ function takeWhile(predicate, list) { @@ -70,17 +72,19 @@ module.exports = { return list.slice(); } + // eslint-disable-next-line jsdoc/require-description /** - * @param {ASTNode} node - a Program or BlockStatement node + * @param {ASTNode} node a Program or BlockStatement node * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body */ function directives(node) { return takeWhile(looksLikeDirective, node.body); } + // eslint-disable-next-line jsdoc/require-description /** - * @param {ASTNode} node - any node - * @param {ASTNode[]} ancestors - the given node's ancestors + * @param {ASTNode} node any node + * @param {ASTNode[]} ancestors the given node's ancestors * @returns {boolean} whether the given node is considered a directive in its current position */ function isDirective(node, ancestors) { @@ -94,7 +98,7 @@ module.exports = { /** * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags. - * @param {ASTNode} node - any node + * @param {ASTNode} node any node * @returns {boolean} whether the given node is a valid expression */ function isValidExpression(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-unused-labels.js b/tools/node_modules/eslint/lib/rules/no-unused-labels.js index 1ba1d05d5c6ae7..b33fcb786790c4 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-labels.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-labels.js @@ -35,8 +35,7 @@ module.exports = { /** * Adds a scope info to the stack. - * - * @param {ASTNode} node - A node to add. This is a LabeledStatement. + * @param {ASTNode} node A node to add. This is a LabeledStatement. * @returns {void} */ function enterLabeledScope(node) { @@ -50,8 +49,7 @@ module.exports = { /** * Removes the top of the stack. * At the same time, this reports the label if it's never used. - * - * @param {ASTNode} node - A node to report. This is a LabeledStatement. + * @param {ASTNode} node A node to report. This is a LabeledStatement. * @returns {void} */ function exitLabeledScope(node) { @@ -81,8 +79,7 @@ module.exports = { /** * Marks the label of a given node as used. - * - * @param {ASTNode} node - A node to mark. This is a BreakStatement or + * @param {ASTNode} node A node to mark. This is a BreakStatement or * ContinueStatement. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/no-unused-vars.js b/tools/node_modules/eslint/lib/rules/no-unused-vars.js index 8094de57c731fb..63e6e048ef1e46 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js @@ -103,7 +103,7 @@ module.exports = { /** * Generate the warning message about the variable being * defined and unused, including the ignore pattern if configured. - * @param {Variable} unusedVar - eslint-scope variable object. + * @param {Variable} unusedVar eslint-scope variable object. * @returns {string} The warning message to be used with this unused variable. */ function getDefinedMessage(unusedVar) { @@ -146,7 +146,7 @@ module.exports = { /** * Determines if a given variable is being exported from a module. - * @param {Variable} variable - eslint-scope variable object. + * @param {Variable} variable eslint-scope variable object. * @returns {boolean} True if the variable is exported, false if not. * @private */ @@ -172,7 +172,7 @@ module.exports = { /** * Determines if a variable has a sibling rest property - * @param {Variable} variable - eslint-scope variable object. + * @param {Variable} variable eslint-scope variable object. * @returns {boolean} True if the variable is exported, false if not. * @private */ @@ -195,7 +195,7 @@ module.exports = { /** * Determines if a reference is a read operation. - * @param {Reference} ref - An eslint-scope Reference + * @param {Reference} ref An eslint-scope Reference * @returns {boolean} whether the given reference represents a read operation * @private */ @@ -205,8 +205,8 @@ module.exports = { /** * Determine if an identifier is referencing an enclosing function name. - * @param {Reference} ref - The reference to check. - * @param {ASTNode[]} nodes - The candidate function nodes. + * @param {Reference} ref The reference to check. + * @param {ASTNode[]} nodes The candidate function nodes. * @returns {boolean} True if it's a self-reference, false if not. * @private */ @@ -226,7 +226,7 @@ module.exports = { /** * Gets a list of function definitions for a specified variable. - * @param {Variable} variable - eslint-scope variable object. + * @param {Variable} variable eslint-scope variable object. * @returns {ASTNode[]} Function nodes. * @private */ @@ -252,9 +252,8 @@ module.exports = { /** * Checks the position of given nodes. - * - * @param {ASTNode} inner - A node which is expected as inside. - * @param {ASTNode} outer - A node which is expected as outside. + * @param {ASTNode} inner A node which is expected as inside. + * @param {ASTNode} outer A node which is expected as outside. * @returns {boolean} `true` if the `inner` node exists in the `outer` node. * @private */ @@ -275,9 +274,8 @@ module.exports = { * - The reference is inside of a loop. * - The reference is inside of a function scope which is different from * the declaration. - * - * @param {eslint-scope.Reference} ref - A reference to check. - * @param {ASTNode} prevRhsNode - The previous RHS node. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} prevRhsNode The previous RHS node. * @returns {ASTNode|null} The RHS node or null. * @private */ @@ -310,9 +308,8 @@ module.exports = { /** * Checks whether a given function node is stored to somewhere or not. * If the function node is stored, the function can be used later. - * - * @param {ASTNode} funcNode - A function node to check. - * @param {ASTNode} rhsNode - The RHS node of the previous assignment. + * @param {ASTNode} funcNode A function node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. * @returns {boolean} `true` if under the following conditions: * - the funcNode is assigned to a variable. * - the funcNode is bound as an argument of a function call. @@ -367,9 +364,8 @@ module.exports = { * - the function is bound as an argument of a function call. * * If a reference exists in a function which can be used later, the reference is read when the function is called. - * - * @param {ASTNode} id - An Identifier node to check. - * @param {ASTNode} rhsNode - The RHS node of the previous assignment. + * @param {ASTNode} id An Identifier node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later. * @private */ @@ -385,9 +381,8 @@ module.exports = { /** * Checks whether a given reference is a read to update itself or not. - * - * @param {eslint-scope.Reference} ref - A reference to check. - * @param {ASTNode} rhsNode - The RHS node of the previous assignment. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. * @returns {boolean} The reference is a read to update itself. * @private */ @@ -416,8 +411,7 @@ module.exports = { /** * Determine if an identifier is used either in for-in loops. - * - * @param {Reference} ref - The reference to check. + * @param {Reference} ref The reference to check. * @returns {boolean} whether reference is used in the for-in loops * @private */ @@ -453,7 +447,7 @@ module.exports = { /** * Determines if the variable is used. - * @param {Variable} variable - The variable to check. + * @param {Variable} variable The variable to check. * @returns {boolean} True if the variable is used * @private */ @@ -481,8 +475,7 @@ module.exports = { /** * Checks whether the given variable is after the last used parameter. - * - * @param {eslint-scope.Variable} variable - The variable to check. + * @param {eslint-scope.Variable} variable The variable to check. * @returns {boolean} `true` if the variable is defined after the last * used parameter. */ @@ -497,8 +490,8 @@ module.exports = { /** * Gets an array of variables without read references. - * @param {Scope} scope - an eslint-scope Scope object. - * @param {Variable[]} unusedVars - an array that saving result. + * @param {Scope} scope an eslint-scope Scope object. + * @param {Variable[]} unusedVars an array that saving result. * @returns {Variable[]} unused variables of the scope and descendant scopes. * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-use-before-define.js b/tools/node_modules/eslint/lib/rules/no-use-before-define.js index a98f6c87ff8c98..ed3540532f9095 100644 --- a/tools/node_modules/eslint/lib/rules/no-use-before-define.js +++ b/tools/node_modules/eslint/lib/rules/no-use-before-define.js @@ -14,8 +14,7 @@ const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; /** * Parses a given value as options. - * - * @param {any} options - A value to parse. + * @param {any} options A value to parse. * @returns {Object} The parsed options. */ function parseOptions(options) { @@ -36,8 +35,7 @@ function parseOptions(options) { /** * Checks whether or not a given variable is a function declaration. - * - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is a function declaration. */ function isFunction(variable) { @@ -46,9 +44,8 @@ function isFunction(variable) { /** * Checks whether or not a given variable is a class declaration in an upper function scope. - * - * @param {eslint-scope.Variable} variable - A variable to check. - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the variable is a class declaration. */ function isOuterClass(variable, reference) { @@ -60,8 +57,8 @@ function isOuterClass(variable, reference) { /** * Checks whether or not a given variable is a variable declaration in an upper function scope. - * @param {eslint-scope.Variable} variable - A variable to check. - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the variable is a variable declaration. */ function isOuterVariable(variable, reference) { @@ -73,9 +70,8 @@ function isOuterVariable(variable, reference) { /** * Checks whether or not a given location is inside of the range of a given node. - * - * @param {ASTNode} node - An node to check. - * @param {number} location - A location to check. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. * @returns {boolean} `true` if the location is inside of the range of the node. */ function isInRange(node, location) { @@ -92,9 +88,8 @@ function isInRange(node, location) { * var {a = a} = obj * for (var a in a) {} * for (var a of a) {} - * - * @param {Variable} variable - A variable to check. - * @param {Reference} reference - A reference to check. + * @param {Variable} variable A variable to check. + * @param {Reference} reference A reference to check. * @returns {boolean} `true` if the reference is inside of the initializers. */ function isInInitializer(variable, reference) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-call.js b/tools/node_modules/eslint/lib/rules/no-useless-call.js index d08b9cb8cb7bb5..11cf524d124211 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-call.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-call.js @@ -13,7 +13,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a node is a `.call()`/`.apply()`. - * @param {ASTNode} node - A CallExpression node to check. + * @param {ASTNode} node A CallExpression node to check. * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. */ function isCallOrNonVariadicApply(node) { @@ -31,9 +31,9 @@ function isCallOrNonVariadicApply(node) { /** * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. - * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. - * @param {ASTNode} thisArg - The node that is given to the first argument of the `.call()`/`.apply()`. - * @param {SourceCode} sourceCode - The ESLint source code object. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {SourceCode} sourceCode The ESLint source code object. * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. */ function isValidThisArg(expectedThis, thisArg, sourceCode) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-concat.js b/tools/node_modules/eslint/lib/rules/no-useless-concat.js index d26003f1e4f4a0..cdaca273eb003f 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-concat.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-concat.js @@ -16,7 +16,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a given node is a concatenation. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a concatenation. */ function isConcatenation(node) { @@ -25,7 +25,7 @@ function isConcatenation(node) { /** * Checks if the given token is a `+` token or not. - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a `+` token. */ function isConcatOperatorToken(token) { @@ -34,7 +34,7 @@ function isConcatOperatorToken(token) { /** * Get's the right most node on the left side of a BinaryExpression with + operator. - * @param {ASTNode} node - A BinaryExpression node to check. + * @param {ASTNode} node A BinaryExpression node to check. * @returns {ASTNode} node */ function getLeft(node) { @@ -48,7 +48,7 @@ function getLeft(node) { /** * Get's the left most node on the right side of a BinaryExpression with + operator. - * @param {ASTNode} node - A BinaryExpression node to check. + * @param {ASTNode} node A BinaryExpression node to check. * @returns {ASTNode} node */ function getRight(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-constructor.js b/tools/node_modules/eslint/lib/rules/no-useless-constructor.js index c10376450eb5b5..7cf033805f99d9 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-constructor.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -10,8 +10,7 @@ /** * Checks whether a given array of statements is a single call of `super`. - * - * @param {ASTNode[]} body - An array of statements to check. + * @param {ASTNode[]} body An array of statements to check. * @returns {boolean} `true` if the body is a single call of `super`. */ function isSingleSuperCall(body) { @@ -26,8 +25,7 @@ function isSingleSuperCall(body) { /** * Checks whether a given node is a pattern which doesn't have any side effects. * Default parameters and Destructuring parameters can have side effects. - * - * @param {ASTNode} node - A pattern node. + * @param {ASTNode} node A pattern node. * @returns {boolean} `true` if the node doesn't have any side effects. */ function isSimple(node) { @@ -37,8 +35,7 @@ function isSimple(node) { /** * Checks whether a given array of expressions is `...arguments` or not. * `super(...arguments)` passes all arguments through. - * - * @param {ASTNode[]} superArgs - An array of expressions to check. + * @param {ASTNode[]} superArgs An array of expressions to check. * @returns {boolean} `true` if the superArgs is `...arguments`. */ function isSpreadArguments(superArgs) { @@ -52,9 +49,8 @@ function isSpreadArguments(superArgs) { /** * Checks whether given 2 nodes are identifiers which have the same name or not. - * - * @param {ASTNode} ctorParam - A node to check. - * @param {ASTNode} superArg - A node to check. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. * @returns {boolean} `true` if the nodes are identifiers which have the same * name. */ @@ -68,9 +64,8 @@ function isValidIdentifierPair(ctorParam, superArg) { /** * Checks whether given 2 nodes are a rest/spread pair which has the same values. - * - * @param {ASTNode} ctorParam - A node to check. - * @param {ASTNode} superArg - A node to check. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. * @returns {boolean} `true` if the nodes are a rest/spread pair which has the * same values. */ @@ -84,9 +79,8 @@ function isValidRestSpreadPair(ctorParam, superArg) { /** * Checks whether given 2 nodes have the same value or not. - * - * @param {ASTNode} ctorParam - A node to check. - * @param {ASTNode} superArg - A node to check. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. * @returns {boolean} `true` if the nodes have the same value or not. */ function isValidPair(ctorParam, superArg) { @@ -99,9 +93,8 @@ function isValidPair(ctorParam, superArg) { /** * Checks whether the parameters of a constructor and the arguments of `super()` * have the same values or not. - * - * @param {ASTNode} ctorParams - The parameters of a constructor to check. - * @param {ASTNode} superArgs - The arguments of `super()` to check. + * @param {ASTNode} ctorParams The parameters of a constructor to check. + * @param {ASTNode} superArgs The arguments of `super()` to check. * @returns {boolean} `true` if those have the same values. */ function isPassingThrough(ctorParams, superArgs) { @@ -120,9 +113,8 @@ function isPassingThrough(ctorParams, superArgs) { /** * Checks whether the constructor body is a redundant super call. - * - * @param {Array} body - constructor body content. - * @param {Array} ctorParams - The params to check against super call. + * @param {Array} body constructor body content. + * @param {Array} ctorParams The params to check against super call. * @returns {boolean} true if the construtor body is redundant */ function isRedundantSuperCall(body, ctorParams) { @@ -158,7 +150,7 @@ module.exports = { /** * Checks whether a node is a redundant constructor - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {void} */ function checkForConstructor(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-escape.js b/tools/node_modules/eslint/lib/rules/no-useless-escape.js index e161e4acedf270..ebfe4cba38a9a7 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-escape.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-escape.js @@ -117,10 +117,9 @@ module.exports = { /** * Checks if the escape character in given string slice is unnecessary. - * * @private - * @param {ASTNode} node - node to validate. - * @param {string} match - string slice to validate. + * @param {ASTNode} node node to validate. + * @param {string} match string slice to validate. * @returns {void} */ function validateString(node, match) { @@ -156,8 +155,7 @@ module.exports = { /** * Checks if a node has an escape. - * - * @param {ASTNode} node - node to check. + * @param {ASTNode} node node to check. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-rename.js b/tools/node_modules/eslint/lib/rules/no-useless-rename.js index f31459bd8ae281..eb570a3ef5c1d3 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-rename.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-rename.js @@ -48,10 +48,10 @@ module.exports = { /** * Reports error for unnecessarily renamed assignments - * @param {ASTNode} node - node to report - * @param {ASTNode} initial - node with initial name value - * @param {ASTNode} result - node with new name value - * @param {string} type - the type of the offending node + * @param {ASTNode} node node to report + * @param {ASTNode} initial node with initial name value + * @param {ASTNode} result node with new name value + * @param {string} type the type of the offending node * @returns {void} */ function reportError(node, initial, result, type) { @@ -83,7 +83,7 @@ module.exports = { /** * Checks whether a destructured assignment is unnecessarily renamed - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {void} */ function checkDestructured(node) { @@ -120,7 +120,7 @@ module.exports = { /** * Checks whether an import is unnecessarily renamed - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {void} */ function checkImport(node) { @@ -136,7 +136,7 @@ module.exports = { /** * Checks whether an export is unnecessarily renamed - * @param {ASTNode} node - node to check + * @param {ASTNode} node node to check * @returns {void} */ function checkExport(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-useless-return.js b/tools/node_modules/eslint/lib/rules/no-useless-return.js index 7b12e85091c644..942d4eede9964e 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-return.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-return.js @@ -17,9 +17,8 @@ const astUtils = require("./utils/ast-utils"), /** * Removes the given element from the array. - * - * @param {Array} array - The source array to remove. - * @param {any} element - The target item to remove. + * @param {Array} array The source array to remove. + * @param {any} element The target item to remove. * @returns {void} */ function remove(array, element) { @@ -32,8 +31,7 @@ function remove(array, element) { /** * Checks whether it can remove the given return statement or not. - * - * @param {ASTNode} node - The return statement node to check. + * @param {ASTNode} node The return statement node to check. * @returns {boolean} `true` if the node is removeable. */ function isRemovable(node) { @@ -42,8 +40,7 @@ function isRemovable(node) { /** * Checks whether the given return statement is in a `finally` block or not. - * - * @param {ASTNode} node - The return statement node to check. + * @param {ASTNode} node The return statement node to check. * @returns {boolean} `true` if the node is in a `finally` block. */ function isInFinally(node) { @@ -87,8 +84,7 @@ module.exports = { /** * Checks whether the given segment is terminated by a return statement or not. - * - * @param {CodePathSegment} segment - The segment to check. + * @param {CodePathSegment} segment The segment to check. * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable. */ function isReturned(segment) { @@ -110,9 +106,8 @@ module.exports = { * * This behavior would simulate code paths for the case that the return * statement does not exist. - * - * @param {ASTNode[]} uselessReturns - The collected return statements. - * @param {CodePathSegment[]} prevSegments - The previous segments to traverse. + * @param {ASTNode[]} uselessReturns The collected return statements. + * @param {CodePathSegment[]} prevSegments The previous segments to traverse. * @param {WeakSet} [providedTraversedSegments] A set of segments that have already been traversed in this call * @returns {ASTNode[]} `uselessReturns`. */ @@ -152,8 +147,7 @@ module.exports = { * * This behavior would simulate code paths for the case that the return * statement does not exist. - * - * @param {CodePathSegment} segment - The segment to get return statements. + * @param {CodePathSegment} segment The segment to get return statements. * @returns {void} */ function markReturnStatementsOnSegmentAsUsed(segment) { @@ -184,7 +178,6 @@ module.exports = { * - FunctionDeclarations are always executed whether it's returned or not. * - BlockStatements do nothing. * - BreakStatements go the next merely. - * * @returns {void} */ function markReturnStatementsOnCurrentSegmentsAsUsed() { diff --git a/tools/node_modules/eslint/lib/rules/no-var.js b/tools/node_modules/eslint/lib/rules/no-var.js index a3c750f9011bb7..74203f8bf3bebf 100644 --- a/tools/node_modules/eslint/lib/rules/no-var.js +++ b/tools/node_modules/eslint/lib/rules/no-var.js @@ -27,8 +27,7 @@ function isGlobal(variable) { /** * Finds the nearest function scope or global scope walking up the scope * hierarchy. - * - * @param {eslint-scope.Scope} scope - The scope to traverse. + * @param {eslint-scope.Scope} scope The scope to traverse. * @returns {eslint-scope.Scope} a function scope or global scope containing the given * scope. */ @@ -44,8 +43,7 @@ function getEnclosingFunctionScope(scope) { /** * Checks whether the given variable has any references from a more specific * function expression (i.e. a closure). - * - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is used from a closure. */ function isReferencedInClosure(variable) { @@ -57,8 +55,7 @@ function isReferencedInClosure(variable) { /** * Checks whether the given node is the assignee of a loop. - * - * @param {ASTNode} node - A VariableDeclaration node to check. + * @param {ASTNode} node A VariableDeclaration node to check. * @returns {boolean} `true` if the declaration is assigned as part of loop * iteration. */ @@ -69,8 +66,7 @@ function isLoopAssignee(node) { /** * Checks whether the given variable declaration is immediately initialized. - * - * @param {ASTNode} node - A VariableDeclaration node to check. + * @param {ASTNode} node A VariableDeclaration node to check. * @returns {boolean} `true` if the declaration has an initializer. */ function isDeclarationInitialized(node) { @@ -81,8 +77,7 @@ const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement /** * Gets the scope node which directly contains a given node. - * - * @param {ASTNode} node - A node to get. This is a `VariableDeclaration` or + * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or * an `Identifier`. * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`, * `SwitchStatement`, `ForStatement`, `ForInStatement`, and @@ -101,8 +96,7 @@ function getScopeNode(node) { /** * Checks whether a given variable is redeclared or not. - * - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is redeclared. */ function isRedeclared(variable) { @@ -111,8 +105,7 @@ function isRedeclared(variable) { /** * Checks whether a given variable is used from outside of the specified scope. - * - * @param {ASTNode} scopeNode - A scope node to check. + * @param {ASTNode} scopeNode A scope node to check. * @returns {Function} The predicate function which checks whether a given * variable is used from outside of the specified scope. */ @@ -120,8 +113,7 @@ function isUsedFromOutsideOf(scopeNode) { /** * Checks whether a given reference is inside of the specified scope or not. - * - * @param {eslint-scope.Reference} reference - A reference to check. + * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is inside of the specified * scope. */ @@ -145,8 +137,7 @@ function isUsedFromOutsideOf(scopeNode) { * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};) * - if a reference is in the expression of their default value. E.g. (var {a = a} = {};) * - if a reference is in the expression of their initializer. E.g. (var a = a;) - * - * @param {ASTNode} node - The initializer node of VariableDeclarator. + * @param {ASTNode} node The initializer node of VariableDeclarator. * @returns {Function} The predicate function. * @private */ @@ -177,7 +168,6 @@ function hasReferenceInTDZ(node) { /** * Checks whether a given variable has name that is allowed for 'var' declarations, * but disallowed for `let` declarations. - * * @param {eslint-scope.Variable} variable The variable to check. * @returns {boolean} `true` if the variable has a disallowed name. */ @@ -209,8 +199,7 @@ module.exports = { /** * Checks whether the variables which are defined by the given declarator node have their references in TDZ. - * - * @param {ASTNode} declarator - The VariableDeclarator node to check. + * @param {ASTNode} declarator The VariableDeclarator node to check. * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. */ function hasSelfReferenceInTDZ(declarator) { @@ -271,8 +260,7 @@ module.exports = { * the implementation simple, we only convert `var` to `let` within * loops when the variable is a loop assignee or the declaration has an * initializer. - * - * @param {ASTNode} node - A variable declaration node to check. + * @param {ASTNode} node A variable declaration node to check. * @returns {boolean} `true` if it can fix the node. */ function canFix(node) { @@ -313,8 +301,7 @@ module.exports = { /** * Reports a given variable declaration node. - * - * @param {ASTNode} node - A variable declaration node to report. + * @param {ASTNode} node A variable declaration node to report. * @returns {void} */ function report(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-warning-comments.js b/tools/node_modules/eslint/lib/rules/no-warning-comments.js index 5a8e0bc7ec221c..a400c446767ff7 100644 --- a/tools/node_modules/eslint/lib/rules/no-warning-comments.js +++ b/tools/node_modules/eslint/lib/rules/no-warning-comments.js @@ -54,7 +54,6 @@ module.exports = { * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not * require word boundaries on that side. - * * @param {string} term A term to convert to a RegExp * @returns {RegExp} The term converted to a RegExp */ diff --git a/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js index 83ff801b2b8a83..9541401a3176b7 100644 --- a/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js +++ b/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -38,9 +38,9 @@ module.exports = { /** * Reports whitespace before property token - * @param {ASTNode} node - the node to report in the event of an error - * @param {Token} leftToken - the left token - * @param {Token} rightToken - the right token + * @param {ASTNode} node the node to report in the event of an error + * @param {Token} leftToken the left token + * @param {Token} rightToken the right token * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/object-curly-newline.js b/tools/node_modules/eslint/lib/rules/object-curly-newline.js index be9ae23a6f4d40..e870a69a954180 100644 --- a/tools/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/tools/node_modules/eslint/lib/rules/object-curly-newline.js @@ -44,8 +44,7 @@ const OPTION_VALUE = { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} value - An option value to parse. + * @param {string|Object|undefined} value An option value to parse. * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object. */ function normalizeOptionValue(value) { @@ -72,8 +71,7 @@ function normalizeOptionValue(value) { /** * Normalizes a given option value. - * - * @param {string|Object|undefined} options - An option value to parse. + * @param {string|Object|undefined} options An option value to parse. * @returns {{ * ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean}, * ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean}, @@ -101,11 +99,10 @@ function normalizeOptions(options) { /** * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration * node needs to be checked for missing line breaks - * - * @param {ASTNode} node - Node under inspection - * @param {Object} options - option specific to node type - * @param {Token} first - First object property - * @param {Token} last - Last object property + * @param {ASTNode} node Node under inspection + * @param {Object} options option specific to node type + * @param {Token} first First object property + * @param {Token} last Last object property * @returns {boolean} `true` if node needs to be checked for missing line breaks */ function areLineBreaksRequired(node, options, first, last) { @@ -171,7 +168,7 @@ module.exports = { /** * Reports a given node if it violated this rule. - * @param {ASTNode} node - A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. + * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/object-curly-spacing.js b/tools/node_modules/eslint/lib/rules/object-curly-spacing.js index 48a7dd953b7e72..53ddaaa24ad01e 100644 --- a/tools/node_modules/eslint/lib/rules/object-curly-spacing.js +++ b/tools/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -50,7 +50,7 @@ module.exports = { * Determines whether an option is set, relative to the spacing option. * If spaced is "always", then check whether option is set to false. * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. + * @param {Object} option The option to exclude. * @returns {boolean} Whether or not the property is excluded. */ function isOptionSet(option) { @@ -69,8 +69,8 @@ module.exports = { /** * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoBeginningSpace(node, token) { @@ -91,8 +91,8 @@ module.exports = { /** * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportNoEndingSpace(node, token) { @@ -113,8 +113,8 @@ module.exports = { /** * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredBeginningSpace(node, token) { @@ -133,8 +133,8 @@ module.exports = { /** * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. * @returns {void} */ function reportRequiredEndingSpace(node, token) { @@ -201,8 +201,7 @@ module.exports = { * Because the last token of object patterns might be a type annotation, * this traverses tokens preceded by the last property, then returns the * first '}' token. - * - * @param {ASTNode} node - The node to get. This node is an + * @param {ASTNode} node The node to get. This node is an * ObjectExpression or an ObjectPattern. And this node has one or * more properties. * @returns {Token} '}' token. @@ -215,7 +214,7 @@ module.exports = { /** * Reports a given object node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check. + * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check. * @returns {void} */ function checkForObject(node) { @@ -233,7 +232,7 @@ module.exports = { /** * Reports a given import node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ImportDeclaration node to check. + * @param {ASTNode} node An ImportDeclaration node to check. * @returns {void} */ function checkForImport(node) { @@ -261,7 +260,7 @@ module.exports = { /** * Reports a given export node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ExportNamedDeclaration node to check. + * @param {ASTNode} node An ExportNamedDeclaration node to check. * @returns {void} */ function checkForExport(node) { diff --git a/tools/node_modules/eslint/lib/rules/object-shorthand.js b/tools/node_modules/eslint/lib/rules/object-shorthand.js index df302b5e8728c8..d4afd09c5a52c4 100644 --- a/tools/node_modules/eslint/lib/rules/object-shorthand.js +++ b/tools/node_modules/eslint/lib/rules/object-shorthand.js @@ -147,7 +147,7 @@ module.exports = { /** * Checks whether a node is a string literal. - * @param {ASTNode} node - Any AST node. + * @param {ASTNode} node Any AST node. * @returns {boolean} `true` if it is a string literal. */ function isStringLiteral(node) { diff --git a/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js index e7e40d66c0ced4..b64656eefed0a9 100644 --- a/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +++ b/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -41,7 +41,7 @@ module.exports = { /** * Determine if provided keyword is a variant of for specifiers * @private - * @param {string} keyword - keyword to test + * @param {string} keyword keyword to test * @returns {boolean} True if `keyword` is a variant of for specifier */ function isForTypeSpecifier(keyword) { @@ -51,7 +51,7 @@ module.exports = { /** * Checks newlines around variable declarations. * @private - * @param {ASTNode} node - `VariableDeclaration` node to test + * @param {ASTNode} node `VariableDeclaration` node to test * @returns {void} */ function checkForNewLine(node) { diff --git a/tools/node_modules/eslint/lib/rules/operator-assignment.js b/tools/node_modules/eslint/lib/rules/operator-assignment.js index 63982cf39202fa..e294668b42b1ce 100644 --- a/tools/node_modules/eslint/lib/rules/operator-assignment.js +++ b/tools/node_modules/eslint/lib/rules/operator-assignment.js @@ -150,6 +150,11 @@ module.exports = { const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]); const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]); + // Check for comments that would be removed. + if (sourceCode.commentsExistBetween(equalsToken, operatorToken)) { + return null; + } + return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); } return null; @@ -182,11 +187,17 @@ module.exports = { messageId: "unexpected", fix(fixer) { if (canBeFixed(node.left)) { + const firstToken = sourceCode.getFirstToken(node); const operatorToken = getOperatorToken(node); const leftText = sourceCode.getText().slice(node.range[0], operatorToken.range[0]); const newOperator = node.operator.slice(0, -1); let rightText; + // Check for comments that would be duplicated. + if (sourceCode.commentsExistBetween(firstToken, operatorToken)) { + return null; + } + // If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side. if ( astUtils.getPrecedence(node.right) <= astUtils.getPrecedence({ type: "BinaryExpression", operator: newOperator }) && @@ -194,7 +205,17 @@ module.exports = { ) { rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`; } else { - rightText = sourceCode.text.slice(operatorToken.range[1], node.range[1]); + const firstRightToken = sourceCode.getFirstToken(node.right); + let rightTextPrefix = ""; + + if ( + operatorToken.range[1] === firstRightToken.range[0] && + !astUtils.canTokensBeAdjacent(newOperator, firstRightToken) + ) { + rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar + } + + rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`; } return fixer.replaceText(node, `${leftText}= ${leftText}${newOperator}${rightText}`); diff --git a/tools/node_modules/eslint/lib/rules/padded-blocks.js b/tools/node_modules/eslint/lib/rules/padded-blocks.js index d5bd5499c6e167..dafa88115edd78 100644 --- a/tools/node_modules/eslint/lib/rules/padded-blocks.js +++ b/tools/node_modules/eslint/lib/rules/padded-blocks.js @@ -97,7 +97,7 @@ module.exports = { /** * Gets the open brace token from a given node. - * @param {ASTNode} node - A BlockStatement or SwitchStatement node from which to get the open brace. + * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace. * @returns {Token} The token of the open brace. */ function getOpenBrace(node) { diff --git a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js index d98cb1f247fbb7..350a9dbf2aba15 100644 --- a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js +++ b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -25,7 +25,6 @@ const CJS_IMPORT = /^require\(/u; /** * Creates tester which check if a node starts with specific keyword. - * * @param {string} keyword The keyword to test. * @returns {Object} the created tester. * @private @@ -39,7 +38,6 @@ function newKeywordTester(keyword) { /** * Creates tester which check if a node starts with specific keyword and spans a single line. - * * @param {string} keyword The keyword to test. * @returns {Object} the created tester. * @private @@ -54,7 +52,6 @@ function newSinglelineKeywordTester(keyword) { /** * Creates tester which check if a node starts with specific keyword and spans multiple lines. - * * @param {string} keyword The keyword to test. * @returns {Object} the created tester. * @private @@ -69,7 +66,6 @@ function newMultilineKeywordTester(keyword) { /** * Creates tester which check if a node is specific type. - * * @param {string} type The node type to test. * @returns {Object} the created tester. * @private @@ -83,7 +79,6 @@ function newNodeTypeTester(type) { /** * Checks the given node is an expression statement of IIFE. - * * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is an expression statement of IIFE. * @private @@ -103,7 +98,6 @@ function isIIFEStatement(node) { /** * Checks whether the given node is a block-like statement. * This checks the last token of the node is the closing brace of a block. - * * @param {SourceCode} sourceCode The source code to get tokens. * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is a block-like statement. @@ -187,7 +181,6 @@ function isDirectivePrologue(node, sourceCode) { * * foo() * ;[1, 2, 3].forEach(bar) - * * @param {SourceCode} sourceCode The source code to get tokens. * @param {ASTNode} node The node to get. * @returns {Token} The actual last token. @@ -224,7 +217,6 @@ function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { /** * Check and report statements for `any` configuration. * It does nothing. - * * @returns {void} * @private */ @@ -236,7 +228,6 @@ function verifyForAny() { * This autofix removes blank lines between the given 2 statements. * However, if comments exist between 2 blank lines, it does not remove those * blank lines automatically. - * * @param {RuleContext} context The rule context to report. * @param {ASTNode} _ Unused. The previous node to check. * @param {ASTNode} nextNode The next node to check. @@ -276,7 +267,6 @@ function verifyForNever(context, _, nextNode, paddingLines) { * This autofix inserts a blank line between the given 2 statements. * If the `prevNode` has trailing comments, it inserts a blank line after the * trailing comments. - * * @param {RuleContext} context The rule context to report. * @param {ASTNode} prevNode The previous node to check. * @param {ASTNode} nextNode The next node to check. @@ -318,7 +308,6 @@ function verifyForAlways(context, prevNode, nextNode, paddingLines) { * * // comment. * bar(); - * * @param {Token} token The token to check. * @returns {boolean} `true` if the token is not a trailing comment. * @private @@ -511,7 +500,6 @@ module.exports = { /** * Checks whether the given node matches the given type. - * * @param {ASTNode} node The statement node to check. * @param {string|string[]} type The statement type to check. * @returns {boolean} `true` if the statement node matched the type. @@ -531,7 +519,6 @@ module.exports = { /** * Finds the last matched configure from configureList. - * * @param {ASTNode} prevNode The previous statement to match. * @param {ASTNode} nextNode The current statement to match. * @returns {Object} The tester of the last matched configure. @@ -554,7 +541,6 @@ module.exports = { /** * Gets padding line sequences between the given 2 statements. * Comments are separators of the padding line sequences. - * * @param {ASTNode} prevNode The previous statement to count. * @param {ASTNode} nextNode The current statement to count. * @returns {Array} The array of token pairs. @@ -584,7 +570,6 @@ module.exports = { /** * Verify padding lines between the given node and the previous node. - * * @param {ASTNode} node The node to verify. * @returns {void} * @private @@ -616,7 +601,6 @@ module.exports = { /** * Verify padding lines between the given node and the previous node. * Then process to enter to new scope. - * * @param {ASTNode} node The node to verify. * @returns {void} * @private diff --git a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js index a0957399ea5ad1..08126e5b1a5459 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js +++ b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -11,7 +11,7 @@ /** * Checks whether or not a given variable is a function name. - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is a function name. */ function isFunctionName(variable) { @@ -20,9 +20,9 @@ function isFunctionName(variable) { /** * Checks whether or not a given MetaProperty node equals to a given value. - * @param {ASTNode} node - A MetaProperty node to check. - * @param {string} metaName - The name of `MetaProperty.meta`. - * @param {string} propertyName - The name of `MetaProperty.property`. + * @param {ASTNode} node A MetaProperty node to check. + * @param {string} metaName The name of `MetaProperty.meta`. + * @param {string} propertyName The name of `MetaProperty.property`. * @returns {boolean} `true` if the node is the specific value. */ function checkMetaProperty(node, metaName, propertyName) { @@ -31,7 +31,7 @@ function checkMetaProperty(node, metaName, propertyName) { /** * Gets the variable object of `arguments` which is defined implicitly. - * @param {eslint-scope.Scope} scope - A scope to get. + * @param {eslint-scope.Scope} scope A scope to get. * @returns {eslint-scope.Variable} The found variable object. */ function getVariableOfArguments(scope) { @@ -57,7 +57,7 @@ function getVariableOfArguments(scope) { /** * Checkes whether or not a given node is a callback. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {Object} * {boolean} retv.isCallback - `true` if the node is a callback. * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. diff --git a/tools/node_modules/eslint/lib/rules/prefer-const.js b/tools/node_modules/eslint/lib/rules/prefer-const.js index 854da310e4be72..87f83892126d50 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-const.js +++ b/tools/node_modules/eslint/lib/rules/prefer-const.js @@ -17,8 +17,7 @@ const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u /** * Checks whether a given node is located at `ForStatement.init` or not. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is located at `ForStatement.init`. */ function isInitOfForStatement(node) { @@ -27,8 +26,7 @@ function isInitOfForStatement(node) { /** * Checks whether a given Identifier node becomes a VariableDeclaration or not. - * - * @param {ASTNode} identifier - An Identifier node to check. + * @param {ASTNode} identifier An Identifier node to check. * @returns {boolean} `true` if the node can become a VariableDeclaration. */ function canBecomeVariableDeclaration(identifier) { @@ -51,9 +49,8 @@ function canBecomeVariableDeclaration(identifier) { /** * Checks if an property or element is from outer scope or function parameters * in destructing pattern. - * - * @param {string} name - A variable name to be checked. - * @param {eslint-scope.Scope} initScope - A scope to start find. + * @param {string} name A variable name to be checked. + * @param {eslint-scope.Scope} initScope A scope to start find. * @returns {boolean} Indicates if the variable is from outer scope or function parameters. */ function isOuterVariableInDestructing(name, initScope) { @@ -76,8 +73,7 @@ function isOuterVariableInDestructing(name, initScope) { * belongs to. * This is used to detect a mix of reassigned and never reassigned in a * destructuring. - * - * @param {eslint-scope.Reference} reference - A reference to get. + * @param {eslint-scope.Reference} reference A reference to get. * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or * null. */ @@ -162,9 +158,8 @@ function hasMemberExpressionAssignment(node) { * `/*exported foo` directive comment makes such variables. This rule does not * warn such variables because this rule cannot distinguish whether the * exported variables are reassigned or not. - * - * @param {eslint-scope.Variable} variable - A variable to get. - * @param {boolean} ignoreReadBeforeAssign - + * @param {eslint-scope.Variable} variable A variable to get. + * @param {boolean} ignoreReadBeforeAssign * The value of `ignoreReadBeforeAssign` option. * @returns {ASTNode|null} * An Identifier node if the variable should change to const. @@ -262,9 +257,8 @@ function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { * reference of given variables belongs to. * This is used to detect a mix of reassigned and never reassigned in a * destructuring. - * - * @param {eslint-scope.Variable[]} variables - Variables to group by destructuring. - * @param {boolean} ignoreReadBeforeAssign - + * @param {eslint-scope.Variable[]} variables Variables to group by destructuring. + * @param {boolean} ignoreReadBeforeAssign * The value of `ignoreReadBeforeAssign` option. * @returns {Map} Grouped identifier nodes. */ @@ -308,10 +302,9 @@ function groupByDestructuring(variables, ignoreReadBeforeAssign) { /** * Finds the nearest parent of node with a given type. - * - * @param {ASTNode} node – The node to search from. - * @param {string} type – The type field of the parent node. - * @param {Function} shouldStop – a predicate that returns true if the traversal should stop, and false otherwise. + * @param {ASTNode} node The node to search from. + * @param {string} type The type field of the parent node. + * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise. * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists. */ function findUp(node, type, shouldStop) { @@ -374,8 +367,7 @@ module.exports = { * nullable. In simple declaration or assignment cases, the length of * the array is 1. In destructuring cases, the length of the array can * be 2 or more. - * - * @param {(eslint-scope.Reference|null)[]} nodes - + * @param {(eslint-scope.Reference|null)[]} nodes * References which are grouped by destructuring to report. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js index dec93d51f2d214..eff37294a9b6ef 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -103,6 +103,7 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- + // eslint-disable-next-line jsdoc/require-description /** * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" * @param {string} destructuringType "array" or "object" @@ -119,7 +120,6 @@ module.exports = { * * This is used to differentiate array index access from object property * access. - * * @param {ASTNode} node the node to evaluate * @returns {boolean} whether or not the node is an integer */ @@ -129,7 +129,6 @@ module.exports = { /** * Report that the given node should use destructuring - * * @param {ASTNode} reportNode the node to report * @param {string} type the type of destructuring that should have been done * @param {Function|null} fix the fix function or null to pass to context.report @@ -153,7 +152,6 @@ module.exports = { * Assignment expression is not fixed. * Array destructuring is not fixed. * Renamed property is not fixed. - * * @param {ASTNode} node the the node to evaluate * @returns {boolean} whether or not the node should be fixed */ @@ -168,7 +166,6 @@ module.exports = { * Fix a node into object destructuring. * This function only handles the simplest case of object destructuring, * see {@link shouldFix}. - * * @param {SourceCodeFixer} fixer the fixer object * @param {ASTNode} node the node to be fixed. * @returns {Object} a fix for the node @@ -189,7 +186,6 @@ module.exports = { * * Pulled out into a separate method so that VariableDeclarators and * AssignmentExpressions can share the same verification logic. - * * @param {ASTNode} leftNode the left-hand side of the assignment * @param {ASTNode} rightNode the right-hand side of the assignment * @param {ASTNode} reportNode the node to report the error on @@ -231,7 +227,6 @@ module.exports = { /** * Check if a given variable declarator is coming from an property access * that should be using destructuring instead - * * @param {ASTNode} node the variable declarator to check * @returns {void} */ @@ -252,7 +247,6 @@ module.exports = { /** * Run the `prefer-destructuring` check on an AssignmentExpression - * * @param {ASTNode} node the AssignmentExpression node * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js index 7f4a9c3c8e34a1..c8af043c1b5268 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js +++ b/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -49,7 +49,6 @@ module.exports = { /** * Function to check regular expression. - * * @param {string} pattern The regular expression pattern to be check. * @param {ASTNode} node AST node which contains regular expression. * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. diff --git a/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js index b4113a3b327542..672d9bcaa0c508 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js +++ b/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -94,13 +100,13 @@ module.exports = { functionName: sourceCode.getText(node.callee) }, fix(fixer) { - const newPrefix = prefixMap[node.arguments[1].value]; - if (sourceCode.getCommentsInside(node).length) { return null; } - if (+(newPrefix + node.arguments[0].value) !== parseInt(node.arguments[0].value, node.arguments[1].value)) { + const replacement = `${prefixMap[node.arguments[1].value]}${node.arguments[0].value}`; + + if (+replacement !== parseInt(node.arguments[0].value, node.arguments[1].value)) { /* * If the newly-produced literal would be invalid, (e.g. 0b1234), @@ -108,7 +114,29 @@ module.exports = { */ return null; } - return fixer.replaceText(node, prefixMap[node.arguments[1].value] + node.arguments[0].value); + + const tokenBefore = sourceCode.getTokenBefore(node), + tokenAfter = sourceCode.getTokenAfter(node); + let prefix = "", + suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(replacement, tokenAfter) + ) { + suffix = " "; + } + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); } }); } diff --git a/tools/node_modules/eslint/lib/rules/prefer-object-spread.js b/tools/node_modules/eslint/lib/rules/prefer-object-spread.js index 214f950c64212e..bbcd88bee3d071 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-object-spread.js +++ b/tools/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -18,7 +18,7 @@ const ANY_SPACE = /\s/u; /** * Helper that checks if the Object.assign call has array spread - * @param {ASTNode} node - The node that the rule warns on + * @param {ASTNode} node The node that the rule warns on * @returns {boolean} - Returns true if the Object.assign call has array spread */ function hasArraySpread(node) { @@ -28,8 +28,8 @@ function hasArraySpread(node) { /** * Helper that checks if the node needs parentheses to be valid JS. * The default is to wrap the node in parentheses to avoid parsing errors. - * @param {ASTNode} node - The node that the rule warns on - * @param {Object} sourceCode - in context sourcecode object + * @param {ASTNode} node The node that the rule warns on + * @param {Object} sourceCode in context sourcecode object * @returns {boolean} - Returns true if the node needs parentheses */ function needsParens(node, sourceCode) { @@ -51,8 +51,8 @@ function needsParens(node, sourceCode) { /** * Determines if an argument needs parentheses. The default is to not add parens. - * @param {ASTNode} node - The node to be checked. - * @param {Object} sourceCode - in context sourcecode object + * @param {ASTNode} node The node to be checked. + * @param {Object} sourceCode in context sourcecode object * @returns {boolean} True if the node needs parentheses */ function argNeedsParens(node, sourceCode) { @@ -142,8 +142,8 @@ function getEndWithSpaces(token, sourceCode) { /** * Autofixes the Object.assign call to use an object spread instead. - * @param {ASTNode|null} node - The node that the rule warns on, i.e. the Object.assign call - * @param {string} sourceCode - sourceCode of the Object.assign call + * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call + * @param {string} sourceCode sourceCode of the Object.assign call * @returns {Function} autofixer - replaces the Object.assign with a spread object. */ function defineFixer(node, sourceCode) { diff --git a/tools/node_modules/eslint/lib/rules/prefer-rest-params.js b/tools/node_modules/eslint/lib/rules/prefer-rest-params.js index 95a562c4a2f4de..3a28584f6bc126 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-rest-params.js +++ b/tools/node_modules/eslint/lib/rules/prefer-rest-params.js @@ -11,7 +11,7 @@ /** * Gets the variable object of `arguments` which is defined implicitly. - * @param {eslint-scope.Scope} scope - A scope to get. + * @param {eslint-scope.Scope} scope A scope to get. * @returns {eslint-scope.Variable} The found variable object. */ function getVariableOfArguments(scope) { @@ -41,8 +41,7 @@ function getVariableOfArguments(scope) { * - arguments[i] .... true // computed member access * - arguments[0] .... true // computed member access * - arguments.length .... false // normal member access - * - * @param {eslint-scope.Reference} reference - The reference to check. + * @param {eslint-scope.Reference} reference The reference to check. * @returns {boolean} `true` if the reference is not normal member access. */ function isNotNormalMemberAccess(reference) { @@ -78,8 +77,7 @@ module.exports = { /** * Reports a given reference. - * - * @param {eslint-scope.Reference} reference - A reference to report. + * @param {eslint-scope.Reference} reference A reference to report. * @returns {void} */ function report(reference) { @@ -92,7 +90,6 @@ module.exports = { /** * Reports references of the implicit `arguments` variable if exist. - * * @returns {void} */ function checkForArguments() { diff --git a/tools/node_modules/eslint/lib/rules/prefer-spread.js b/tools/node_modules/eslint/lib/rules/prefer-spread.js index 9368c972c086ba..14c05bd97103de 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-spread.js +++ b/tools/node_modules/eslint/lib/rules/prefer-spread.js @@ -13,7 +13,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a node is a `.apply()` for variadic. - * @param {ASTNode} node - A CallExpression node to check. + * @param {ASTNode} node A CallExpression node to check. * @returns {boolean} Whether or not the node is a `.apply()` for variadic. */ function isVariadicApplyCalling(node) { @@ -31,9 +31,9 @@ function isVariadicApplyCalling(node) { /** * Checks whether or not `thisArg` is not changed by `.apply()`. - * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. - * @param {ASTNode} thisArg - The node that is given to the first argument of the `.apply()`. - * @param {RuleContext} context - The ESLint rule context object. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`. + * @param {RuleContext} context The ESLint rule context object. * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. */ function isValidThisArg(expectedThis, thisArg, context) { diff --git a/tools/node_modules/eslint/lib/rules/prefer-template.js b/tools/node_modules/eslint/lib/rules/prefer-template.js index a2507d452c68eb..fa6e58d9721e12 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-template.js +++ b/tools/node_modules/eslint/lib/rules/prefer-template.js @@ -17,7 +17,7 @@ const astUtils = require("./utils/ast-utils"); /** * Checks whether or not a given node is a concatenation. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a concatenation. */ function isConcatenation(node) { @@ -26,7 +26,7 @@ function isConcatenation(node) { /** * Gets the top binary expression node for concatenation in parents of a given node. - * @param {ASTNode} node - A node to get. + * @param {ASTNode} node A node to get. * @returns {ASTNode} the top binary expression node in parents of a given node. */ function getTopConcatBinaryExpression(node) { @@ -70,7 +70,7 @@ function hasOctalEscapeSequence(node) { /** * Checks whether or not a given binary expression has string literals. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node has string literals. */ function hasStringLiteral(node) { @@ -84,7 +84,7 @@ function hasStringLiteral(node) { /** * Checks whether or not a given binary expression has non string literals. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node has non string literals. */ function hasNonStringLiteral(node) { @@ -242,8 +242,7 @@ module.exports = { /** * Reports if a given node is string concatenation with non string literals. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {void} */ function checkForStringConcat(node) { diff --git a/tools/node_modules/eslint/lib/rules/quote-props.js b/tools/node_modules/eslint/lib/rules/quote-props.js index 79493b2499eb31..ab09b8fa938e63 100644 --- a/tools/node_modules/eslint/lib/rules/quote-props.js +++ b/tools/node_modules/eslint/lib/rules/quote-props.js @@ -85,7 +85,7 @@ module.exports = { /** * Checks whether a certain string constitutes an ES3 token - * @param {string} tokenStr - The string to be checked. + * @param {string} tokenStr The string to be checked. * @returns {boolean} `true` if it is an ES3 token. */ function isKeyword(tokenStr) { diff --git a/tools/node_modules/eslint/lib/rules/quotes.js b/tools/node_modules/eslint/lib/rules/quotes.js index 5f260e55f0a501..f78d1129425633 100644 --- a/tools/node_modules/eslint/lib/rules/quotes.js +++ b/tools/node_modules/eslint/lib/rules/quotes.js @@ -41,7 +41,7 @@ const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Arr * escaping and unescaping as necessary. * Only escaping of the minimal set of characters is changed. * Note: escaping of newlines when switching from backtick to other quotes is not handled. - * @param {string} str - A string to convert. + * @param {string} str A string to convert. * @returns {string} The string with changed quotes. * @private */ @@ -143,7 +143,6 @@ module.exports = { * * In both cases, inside of the braces is handled as normal JavaScript. * The braces are `JSXExpressionContainer` nodes. - * * @param {ASTNode} node The Literal node to check. * @returns {boolean} True if the node is a part of JSX, false if not. * @private @@ -155,7 +154,7 @@ module.exports = { /** * Checks whether or not a given node is a directive. * The directive is a `ExpressionStatement` which has only a string literal. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a directive. * @private */ @@ -170,7 +169,7 @@ module.exports = { /** * Checks whether or not a given node is a part of directive prologues. * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a part of directive prologues. * @private */ @@ -198,7 +197,7 @@ module.exports = { /** * Checks whether or not a given node is allowed as non backtick. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is allowed as non backtick. * @private */ @@ -230,7 +229,7 @@ module.exports = { /** * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. - * @param {ASTNode} node - A TemplateLiteral node to check. + * @param {ASTNode} node A TemplateLiteral node to check. * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. * @private */ diff --git a/tools/node_modules/eslint/lib/rules/radix.js b/tools/node_modules/eslint/lib/rules/radix.js index b7b296f45155ff..ed3c5cb66b8cdc 100644 --- a/tools/node_modules/eslint/lib/rules/radix.js +++ b/tools/node_modules/eslint/lib/rules/radix.js @@ -20,8 +20,7 @@ const MODE_ALWAYS = "always", /** * Checks whether a given variable is shadowed or not. - * - * @param {eslint-scope.Variable} variable - A variable to check. + * @param {eslint-scope.Variable} variable A variable to check. * @returns {boolean} `true` if the variable is shadowed. */ function isShadowed(variable) { @@ -30,8 +29,7 @@ function isShadowed(variable) { /** * Checks whether a given node is a MemberExpression of `parseInt` method or not. - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` * method. */ @@ -51,8 +49,7 @@ function isParseIntMethod(node) { * * - A literal except numbers. * - undefined. - * - * @param {ASTNode} radix - A node of radix to check. + * @param {ASTNode} radix A node of radix to check. * @returns {boolean} `true` if the node is valid. */ function isValidRadix(radix) { @@ -64,8 +61,7 @@ function isValidRadix(radix) { /** * Checks whether a given node is a default value of radix or not. - * - * @param {ASTNode} radix - A node of radix to check. + * @param {ASTNode} radix A node of radix to check. * @returns {boolean} `true` if the node is the literal node of `10`. */ function isDefaultRadix(radix) { @@ -100,8 +96,7 @@ module.exports = { /** * Checks the arguments of a given CallExpression node and reports it if it * offends this rule. - * - * @param {ASTNode} node - A CallExpression node to check. + * @param {ASTNode} node A CallExpression node to check. * @returns {void} */ function checkArguments(node) { diff --git a/tools/node_modules/eslint/lib/rules/require-await.js b/tools/node_modules/eslint/lib/rules/require-await.js index 298cb951de3b39..0aa6fce7e19859 100644 --- a/tools/node_modules/eslint/lib/rules/require-await.js +++ b/tools/node_modules/eslint/lib/rules/require-await.js @@ -17,8 +17,7 @@ const astUtils = require("./utils/ast-utils"); /** * Capitalize the 1st letter of the given text. - * - * @param {string} text - The text to capitalize. + * @param {string} text The text to capitalize. * @returns {string} The text that the 1st letter was capitalized. */ function capitalizeFirstLetter(text) { @@ -49,7 +48,6 @@ module.exports = { /** * Push the scope info object to the stack. - * * @returns {void} */ function enterFunction() { @@ -62,8 +60,7 @@ module.exports = { /** * Pop the top scope info object from the stack. * Also, it reports the function if needed. - * - * @param {ASTNode} node - The node to report. + * @param {ASTNode} node The node to report. * @returns {void} */ function exitFunction(node) { diff --git a/tools/node_modules/eslint/lib/rules/require-yield.js b/tools/node_modules/eslint/lib/rules/require-yield.js index 7bb7cf9a872bd8..dbfd759948af78 100644 --- a/tools/node_modules/eslint/lib/rules/require-yield.js +++ b/tools/node_modules/eslint/lib/rules/require-yield.js @@ -28,7 +28,7 @@ module.exports = { /** * If the node is a generator function, start counting `yield` keywords. - * @param {Node} node - A function node to check. + * @param {Node} node A function node to check. * @returns {void} */ function beginChecking(node) { @@ -40,7 +40,7 @@ module.exports = { /** * If the node is a generator function, end counting `yield` keywords, then * reports result. - * @param {Node} node - A function node to check. + * @param {Node} node A function node to check. * @returns {void} */ function endChecking(node) { diff --git a/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js b/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js index 04539395ef4ec1..cd740fd3a99057 100644 --- a/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js +++ b/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -39,7 +39,7 @@ module.exports = { /** * Checks whitespace between rest/spread operators and their expressions - * @param {ASTNode} node - The node to check + * @param {ASTNode} node The node to check * @returns {void} */ function checkWhiteSpace(node) { diff --git a/tools/node_modules/eslint/lib/rules/sort-imports.js b/tools/node_modules/eslint/lib/rules/sort-imports.js index 05e643ca0611d5..3b7f1d010348ad 100644 --- a/tools/node_modules/eslint/lib/rules/sort-imports.js +++ b/tools/node_modules/eslint/lib/rules/sort-imports.js @@ -70,8 +70,7 @@ module.exports = { * import * as myModule from "my-module.js" --> all * import {myMember} from "my-module.js" --> single * import {foo, bar} from "my-module.js" --> multiple - * - * @param {ASTNode} node - the ImportDeclaration node. + * @param {ASTNode} node the ImportDeclaration node. * @returns {string} used member parameter style, ["all", "multiple", "single"] */ function usedMemberSyntax(node) { @@ -90,7 +89,7 @@ module.exports = { /** * Gets the group by member parameter index for given declaration. - * @param {ASTNode} node - the ImportDeclaration node. + * @param {ASTNode} node the ImportDeclaration node. * @returns {number} the declaration group by member index. */ function getMemberParameterGroupIndex(node) { @@ -99,7 +98,7 @@ module.exports = { /** * Gets the local name of the first imported module. - * @param {ASTNode} node - the ImportDeclaration node. + * @param {ASTNode} node the ImportDeclaration node. * @returns {?string} the local name of the first imported module. */ function getFirstLocalMemberName(node) { diff --git a/tools/node_modules/eslint/lib/rules/sort-keys.js b/tools/node_modules/eslint/lib/rules/sort-keys.js index c314d4a63611b6..a5ce445f71ae93 100644 --- a/tools/node_modules/eslint/lib/rules/sort-keys.js +++ b/tools/node_modules/eslint/lib/rules/sort-keys.js @@ -23,8 +23,7 @@ const astUtils = require("./utils/ast-utils"), * whether it's a computed property or not. * - If the property has a static name, this returns the static name. * - Otherwise, this returns null. - * - * @param {ASTNode} node - The `Property` node to get. + * @param {ASTNode} node The `Property` node to get. * @returns {string|null} The property name or null. * @private */ @@ -43,7 +42,6 @@ function getPropertyName(node) { * * Postfix `I` is meant insensitive. * Postfix `N` is meant natual. - * * @private */ const isValidOrders = { diff --git a/tools/node_modules/eslint/lib/rules/space-before-blocks.js b/tools/node_modules/eslint/lib/rules/space-before-blocks.js index 527366aaccf089..038e88db5215f5 100644 --- a/tools/node_modules/eslint/lib/rules/space-before-blocks.js +++ b/tools/node_modules/eslint/lib/rules/space-before-blocks.js @@ -79,8 +79,7 @@ module.exports = { /** * Checks whether or not a given token is an arrow operator (=>) or a keyword * in order to avoid to conflict with `arrow-spacing` and `keyword-spacing`. - * - * @param {Token} token - A token to check. + * @param {Token} token A token to check. * @returns {boolean} `true` if the token is an arrow operator. */ function isConflicted(token) { diff --git a/tools/node_modules/eslint/lib/rules/space-in-parens.js b/tools/node_modules/eslint/lib/rules/space-in-parens.js index 35ded5e7863114..85ee74210d6007 100644 --- a/tools/node_modules/eslint/lib/rules/space-in-parens.js +++ b/tools/node_modules/eslint/lib/rules/space-in-parens.js @@ -232,7 +232,7 @@ module.exports = { if (token.value === "(" && openerMissingSpace(token, nextToken)) { context.report({ node, - loc: token.loc.start, + loc: token.loc, messageId: "missingOpeningSpace", fix(fixer) { return fixer.insertTextAfter(token, " "); @@ -244,7 +244,7 @@ module.exports = { if (token.value === "(" && openerRejectsSpace(token, nextToken)) { context.report({ node, - loc: token.loc.start, + loc: { start: token.loc.end, end: nextToken.loc.start }, messageId: "rejectedOpeningSpace", fix(fixer) { return fixer.removeRange([token.range[1], nextToken.range[0]]); @@ -256,7 +256,7 @@ module.exports = { if (token.value === ")" && closerMissingSpace(prevToken, token)) { context.report({ node, - loc: token.loc.start, + loc: token.loc, messageId: "missingClosingSpace", fix(fixer) { return fixer.insertTextBefore(token, " "); @@ -268,7 +268,7 @@ module.exports = { if (token.value === ")" && closerRejectsSpace(prevToken, token)) { context.report({ node, - loc: token.loc.start, + loc: { start: prevToken.loc.end, end: token.loc.start }, messageId: "rejectedClosingSpace", fix(fixer) { return fixer.removeRange([prevToken.range[1], token.range[0]]); diff --git a/tools/node_modules/eslint/lib/rules/space-infix-ops.js b/tools/node_modules/eslint/lib/rules/space-infix-ops.js index 8d1d172c6697b6..b2fbe47b4765e6 100644 --- a/tools/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-infix-ops.js @@ -41,9 +41,9 @@ module.exports = { /** * Returns the first token which violates the rule - * @param {ASTNode} left - The left node of the main node - * @param {ASTNode} right - The right node of the main node - * @param {string} op - The operator of the main node + * @param {ASTNode} left The left node of the main node + * @param {ASTNode} right The right node of the main node + * @param {string} op The operator of the main node * @returns {Object} The violator token or null * @private */ @@ -61,8 +61,8 @@ module.exports = { /** * Reports an AST node as a rule violation - * @param {ASTNode} mainNode - The node to report - * @param {Object} culpritToken - The token which has a problem + * @param {ASTNode} mainNode The node to report + * @param {Object} culpritToken The token which has a problem * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/spaced-comment.js b/tools/node_modules/eslint/lib/rules/spaced-comment.js index 731bd212e3e786..958bb2c6444080 100644 --- a/tools/node_modules/eslint/lib/rules/spaced-comment.js +++ b/tools/node_modules/eslint/lib/rules/spaced-comment.js @@ -13,7 +13,7 @@ const astUtils = require("./utils/ast-utils"); /** * Escapes the control characters of a given string. - * @param {string} s - A string to escape. + * @param {string} s A string to escape. * @returns {string} An escaped string. */ function escape(s) { @@ -23,7 +23,7 @@ function escape(s) { /** * Escapes the control characters of a given string. * And adds a repeat flag. - * @param {string} s - A string to escape. + * @param {string} s A string to escape. * @returns {string} An escaped string. */ function escapeAndRepeat(s) { @@ -33,7 +33,7 @@ function escapeAndRepeat(s) { /** * Parses `markers` option. * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. - * @param {string[]} [markers] - A marker list. + * @param {string[]} [markers] A marker list. * @returns {string[]} A marker list. */ function parseMarkersOption(markers) { @@ -51,8 +51,7 @@ function parseMarkersOption(markers) { * Generated pattern: * * 1. A space or an exception pattern sequence. - * - * @param {string[]} exceptions - An exception pattern list. + * @param {string[]} exceptions An exception pattern list. * @returns {string} A regular expression string for exceptions. */ function createExceptionsPattern(exceptions) { @@ -97,9 +96,8 @@ function createExceptionsPattern(exceptions) { * * 1. First, a marker or nothing. * 2. Next, a space or an exception pattern sequence. - * - * @param {string[]} markers - A marker list. - * @param {string[]} exceptions - An exception pattern list. + * @param {string[]} markers A marker list. + * @param {string[]} exceptions An exception pattern list. * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode. */ function createAlwaysStylePattern(markers, exceptions) { @@ -135,8 +133,7 @@ function createAlwaysStylePattern(markers, exceptions) { * * 1. First, a marker or nothing (captured). * 2. Next, a space or a tab. - * - * @param {string[]} markers - A marker list. + * @param {string[]} markers A marker list. * @returns {RegExp} A RegExp object for `never` mode. */ function createNeverStylePattern(markers) { @@ -260,10 +257,10 @@ module.exports = { /** * Reports a beginning spacing error with an appropriate message. - * @param {ASTNode} node - A comment node to check. - * @param {string} message - An error message to report. - * @param {Array} match - An array of match results for markers. - * @param {string} refChar - Character used for reference in the error message. + * @param {ASTNode} node A comment node to check. + * @param {string} message An error message to report. + * @param {Array} match An array of match results for markers. + * @param {string} refChar Character used for reference in the error message. * @returns {void} */ function reportBegin(node, message, match, refChar) { @@ -293,9 +290,9 @@ module.exports = { /** * Reports an ending spacing error with an appropriate message. - * @param {ASTNode} node - A comment node to check. - * @param {string} message - An error message to report. - * @param {string} match - An array of the matched whitespace characters. + * @param {ASTNode} node A comment node to check. + * @param {string} message An error message to report. + * @param {string} match An array of the matched whitespace characters. * @returns {void} */ function reportEnd(node, message, match) { @@ -317,7 +314,7 @@ module.exports = { /** * Reports a given comment if it's invalid. - * @param {ASTNode} node - a comment node to check. + * @param {ASTNode} node a comment node to check. * @returns {void} */ function checkCommentForSpace(node) { diff --git a/tools/node_modules/eslint/lib/rules/strict.js b/tools/node_modules/eslint/lib/rules/strict.js index b93a6a1a17adb5..b0d6cf9172a74b 100644 --- a/tools/node_modules/eslint/lib/rules/strict.js +++ b/tools/node_modules/eslint/lib/rules/strict.js @@ -43,8 +43,7 @@ function getUseStrictDirectives(statements) { /** * Checks whether a given parameter is a simple parameter. - * - * @param {ASTNode} node - A pattern node to check. + * @param {ASTNode} node A pattern node to check. * @returns {boolean} `true` if the node is an Identifier node. */ function isSimpleParameter(node) { @@ -53,8 +52,7 @@ function isSimpleParameter(node) { /** * Checks whether a given parameter list is a simple parameter list. - * - * @param {ASTNode[]} params - A parameter list to check. + * @param {ASTNode[]} params A parameter list to check. * @returns {boolean} `true` if the every parameter is an Identifier node. */ function isSimpleParameterList(params) { diff --git a/tools/node_modules/eslint/lib/rules/symbol-description.js b/tools/node_modules/eslint/lib/rules/symbol-description.js index 3fd5a359671f6a..155cea4dc0bceb 100644 --- a/tools/node_modules/eslint/lib/rules/symbol-description.js +++ b/tools/node_modules/eslint/lib/rules/symbol-description.js @@ -38,8 +38,7 @@ module.exports = { /** * Reports if node does not conform the rule in case rule is set to * report missing description - * - * @param {ASTNode} node - A CallExpression node to check. + * @param {ASTNode} node A CallExpression node to check. * @returns {void} */ function checkArgument(node) { diff --git a/tools/node_modules/eslint/lib/rules/template-curly-spacing.js b/tools/node_modules/eslint/lib/rules/template-curly-spacing.js index 2794b45cf78548..07da6a39b0e9bb 100644 --- a/tools/node_modules/eslint/lib/rules/template-curly-spacing.js +++ b/tools/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -53,7 +53,7 @@ module.exports = { /** * Checks spacing before `}` of a given token. - * @param {Token} token - A token to check. This is a Template token. + * @param {Token} token A token to check. This is a Template token. * @returns {void} */ function checkSpacingBefore(token) { @@ -82,7 +82,7 @@ module.exports = { /** * Checks spacing after `${` of a given token. - * @param {Token} token - A token to check. This is a Template token. + * @param {Token} token A token to check. This is a Template token. * @returns {void} */ function checkSpacingAfter(token) { diff --git a/tools/node_modules/eslint/lib/rules/use-isnan.js b/tools/node_modules/eslint/lib/rules/use-isnan.js index b2eb84b7b37f60..cd9ccdbaf898ee 100644 --- a/tools/node_modules/eslint/lib/rules/use-isnan.js +++ b/tools/node_modules/eslint/lib/rules/use-isnan.js @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -40,6 +46,10 @@ module.exports = { enforceForSwitchCase: { type: "boolean", default: false + }, + enforceForIndexOf: { + type: "boolean", + default: false } }, additionalProperties: false @@ -49,16 +59,18 @@ module.exports = { messages: { comparisonWithNaN: "Use the isNaN function to compare with NaN.", switchNaN: "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", - caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch." + caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch.", + indexOfNaN: "Array prototype method '{{ methodName }}' cannot find NaN." } }, create(context) { const enforceForSwitchCase = context.options[0] && context.options[0].enforceForSwitchCase; + const enforceForIndexOf = context.options[0] && context.options[0].enforceForIndexOf; /** - * Checks the given `BinaryExpression` node. + * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons. * @param {ASTNode} node The node to check. * @returns {void} */ @@ -72,7 +84,7 @@ module.exports = { } /** - * Checks the discriminant and all case clauses of the given `SwitchStatement` node. + * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:` * @param {ASTNode} node The node to check. * @returns {void} */ @@ -88,6 +100,27 @@ module.exports = { } } + /** + * Checks the the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkCallExpression(node) { + const callee = node.callee; + + if (callee.type === "MemberExpression") { + const methodName = astUtils.getStaticPropertyName(callee); + + if ( + (methodName === "indexOf" || methodName === "lastIndexOf") && + node.arguments.length === 1 && + isNaNIdentifier(node.arguments[0]) + ) { + context.report({ node, messageId: "indexOfNaN", data: { methodName } }); + } + } + } + const listeners = { BinaryExpression: checkBinaryExpression }; @@ -96,6 +129,10 @@ module.exports = { listeners.SwitchStatement = checkSwitchStatement; } + if (enforceForIndexOf) { + listeners.CallExpression = checkCallExpression; + } + return listeners; } }; diff --git a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js index f0b926e3298f86..17e056c240c13d 100644 --- a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -42,9 +42,9 @@ const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9] /** * Checks reference if is non initializer and writable. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. * @returns {boolean} Success/Failure * @private */ @@ -68,8 +68,7 @@ function isModifyingReference(reference, index, references) { /** * Checks whether the given string starts with uppercase or not. - * - * @param {string} s - The string to check. + * @param {string} s The string to check. * @returns {boolean} `true` if the string starts with uppercase. */ function startsWithUpperCase(s) { @@ -78,7 +77,7 @@ function startsWithUpperCase(s) { /** * Checks whether or not a node is a constructor. - * @param {ASTNode} node - A function node to check. + * @param {ASTNode} node A function node to check. * @returns {boolean} Wehether or not a node is a constructor. */ function isES5Constructor(node) { @@ -87,7 +86,7 @@ function isES5Constructor(node) { /** * Finds a function node from ancestors of a node. - * @param {ASTNode} node - A start node to find. + * @param {ASTNode} node A start node to find. * @returns {Node|null} A found function node. */ function getUpperFunction(node) { @@ -106,8 +105,7 @@ function getUpperFunction(node) { * - ArrowFunctionExpression * - FunctionDeclaration * - FunctionExpression - * - * @param {ASTNode|null} node - A node to check. + * @param {ASTNode|null} node A node to check. * @returns {boolean} `true` if the node is a function node. */ function isFunction(node) { @@ -123,8 +121,7 @@ function isFunction(node) { * - ForOfStatement * - ForStatement * - WhileStatement - * - * @param {ASTNode|null} node - A node to check. + * @param {ASTNode|null} node A node to check. * @returns {boolean} `true` if the node is a loop node. */ function isLoop(node) { @@ -133,8 +130,7 @@ function isLoop(node) { /** * Checks whether the given node is in a loop or not. - * - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is in a loop. */ function isInLoop(node) { @@ -149,7 +145,7 @@ function isInLoop(node) { /** * Checks whether or not a node is `null` or `undefined`. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a `null` or `undefined`. * @public */ @@ -163,7 +159,7 @@ function isNullOrUndefined(node) { /** * Checks whether or not a node is callee. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is callee. */ function isCallee(node) { @@ -172,7 +168,7 @@ function isCallee(node) { /** * Checks whether or not a node is `Reflect.apply`. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a `Reflect.apply`. */ function isReflectApply(node) { @@ -188,7 +184,7 @@ function isReflectApply(node) { /** * Checks whether or not a node is `Array.from`. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a `Array.from`. */ function isArrayFromMethod(node) { @@ -204,7 +200,7 @@ function isArrayFromMethod(node) { /** * Checks whether or not a node is a method which has `thisArg`. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a method which has `thisArg`. */ function isMethodWhichHasThisArg(node) { @@ -223,7 +219,7 @@ function isMethodWhichHasThisArg(node) { /** * Creates the negate function of the given function. - * @param {Function} f - The function to negate. + * @param {Function} f The function to negate. * @returns {Function} Negated function. */ function negate(f) { @@ -232,8 +228,8 @@ function negate(f) { /** * Checks whether or not a node has a `@this` tag in its comments. - * @param {ASTNode} node - A node to check. - * @param {SourceCode} sourceCode - A SourceCode instance to get comments. + * @param {ASTNode} node A node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. * @returns {boolean} Whether or not the node has a `@this` tag in its comments. */ function hasJSDocThisTag(node, sourceCode) { @@ -268,8 +264,7 @@ function isParenthesised(sourceCode, node) { /** * Checks if the given token is an arrow token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is an arrow token. */ function isArrowToken(token) { @@ -278,8 +273,7 @@ function isArrowToken(token) { /** * Checks if the given token is a comma token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a comma token. */ function isCommaToken(token) { @@ -288,8 +282,7 @@ function isCommaToken(token) { /** * Checks if the given token is a dot token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a dot token. */ function isDotToken(token) { @@ -298,8 +291,7 @@ function isDotToken(token) { /** * Checks if the given token is a semicolon token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a semicolon token. */ function isSemicolonToken(token) { @@ -308,8 +300,7 @@ function isSemicolonToken(token) { /** * Checks if the given token is a colon token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a colon token. */ function isColonToken(token) { @@ -318,8 +309,7 @@ function isColonToken(token) { /** * Checks if the given token is an opening parenthesis token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is an opening parenthesis token. */ function isOpeningParenToken(token) { @@ -328,8 +318,7 @@ function isOpeningParenToken(token) { /** * Checks if the given token is a closing parenthesis token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a closing parenthesis token. */ function isClosingParenToken(token) { @@ -338,8 +327,7 @@ function isClosingParenToken(token) { /** * Checks if the given token is an opening square bracket token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is an opening square bracket token. */ function isOpeningBracketToken(token) { @@ -348,8 +336,7 @@ function isOpeningBracketToken(token) { /** * Checks if the given token is a closing square bracket token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a closing square bracket token. */ function isClosingBracketToken(token) { @@ -358,8 +345,7 @@ function isClosingBracketToken(token) { /** * Checks if the given token is an opening brace token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is an opening brace token. */ function isOpeningBraceToken(token) { @@ -368,8 +354,7 @@ function isOpeningBraceToken(token) { /** * Checks if the given token is a closing brace token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a closing brace token. */ function isClosingBraceToken(token) { @@ -378,8 +363,7 @@ function isClosingBraceToken(token) { /** * Checks if the given token is a comment token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a comment token. */ function isCommentToken(token) { @@ -388,8 +372,7 @@ function isCommentToken(token) { /** * Checks if the given token is a keyword token or not. - * - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a keyword token. */ function isKeywordToken(token) { @@ -398,9 +381,8 @@ function isKeywordToken(token) { /** * Gets the `(` token of the given function node. - * - * @param {ASTNode} node - The function node to get. - * @param {SourceCode} sourceCode - The source code object to get tokens. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. * @returns {Token} `(` token. */ function getOpeningParenOfParams(node, sourceCode) { @@ -411,9 +393,9 @@ function getOpeningParenOfParams(node, sourceCode) { /** * Checks whether or not the tokens of two given nodes are same. - * @param {ASTNode} left - A node 1 to compare. - * @param {ASTNode} right - A node 2 to compare. - * @param {SourceCode} sourceCode - The ESLint source code object. + * @param {ASTNode} left A node 1 to compare. + * @param {ASTNode} right A node 2 to compare. + * @param {SourceCode} sourceCode The ESLint source code object. * @returns {boolean} the source code for the given node. */ function equalTokens(left, right, sourceCode) { @@ -447,8 +429,8 @@ module.exports = { /** * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. + * @param {Object} left The left token object. + * @param {Object} right The right token object. * @returns {boolean} Whether or not the tokens are on the same line. * @public */ @@ -494,7 +476,7 @@ module.exports = { /** * Checks whether or not a given node is a string literal. - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is a string literal. */ isStringLiteral(node) { @@ -514,8 +496,7 @@ module.exports = { * - ForStatement * - SwitchStatement * - WhileStatement - * - * @param {ASTNode} node - A node to check. + * @param {ASTNode} node A node to check. * @returns {boolean} `true` if the node is breakable. */ isBreakableStatement(node) { @@ -524,7 +505,7 @@ module.exports = { /** * Gets references which are non initializer and writable. - * @param {Reference[]} references - An array of references. + * @param {Reference[]} references An array of references. * @returns {Reference[]} An array of only references which are non initializer and writable. * @public */ @@ -568,7 +549,6 @@ module.exports = { * consequent; * * When taking this `IfStatement`, returns `consequent;` statement. - * * @param {ASTNode} A node to get. * @returns {ASTNode|null} The trailing statement's node. */ @@ -576,9 +556,8 @@ module.exports = { /** * Finds the variable by a given name in a given scope and its upper scopes. - * - * @param {eslint-scope.Scope} initScope - A scope to start find. - * @param {string} name - A variable name to find. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @param {string} name A variable name to find. * @returns {eslint-scope.Variable|null} A found variable or `null`. */ getVariableByName(initScope, name) { @@ -613,9 +592,8 @@ module.exports = { * - The location is not on an ES2015 class. * - Its `bind`/`call`/`apply` method is not called directly. * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. - * - * @param {ASTNode} node - A function node to check. - * @param {SourceCode} sourceCode - A SourceCode instance to get comments. + * @param {ASTNode} node A function node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. * @returns {boolean} The function node is the default `this` binding. */ isDefaultThisBinding(node, sourceCode) { @@ -861,8 +839,7 @@ module.exports = { /** * Checks whether the given node is an empty block node or not. - * - * @param {ASTNode|null} node - The node to check. + * @param {ASTNode|null} node The node to check. * @returns {boolean} `true` if the node is an empty block. */ isEmptyBlock(node) { @@ -871,8 +848,7 @@ module.exports = { /** * Checks whether the given node is an empty function node or not. - * - * @param {ASTNode|null} node - The node to check. + * @param {ASTNode|null} node The node to check. * @returns {boolean} `true` if the node is an empty function. */ isEmptyFunction(node) { @@ -906,8 +882,7 @@ module.exports = { * let a = {["a" + "b"]: 1} // => null * let a = {[tag`b`]: 1} // => null * let a = {[`${b}`]: 1} // => null - * - * @param {ASTNode} node - The node to get. + * @param {ASTNode} node The node to get. * @returns {string|null} The property name if static. Otherwise, null. */ getStaticPropertyName(node) { @@ -950,7 +925,7 @@ module.exports = { /** * Get directives from directive prologue of a Program or Function node. - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {ASTNode[]} The directives found in the directive prologue. */ getDirectivePrologue(node) { @@ -989,7 +964,7 @@ module.exports = { /** * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added * after the node will be parsed as a decimal point, rather than a property-access dot. - * @param {ASTNode} node - The node to check. + * @param {ASTNode} node The node to check. * @returns {boolean} `true` if this node is a decimal integer. * @example * @@ -1011,7 +986,7 @@ module.exports = { /** * Determines whether this token is a decimal integer numeric token. * This is similar to isDecimalInteger(), but for tokens. - * @param {Token} token - The token to check. + * @param {Token} token The token to check. * @returns {boolean} `true` if this token is a decimal integer. */ isDecimalIntegerNumericToken(token) { @@ -1063,8 +1038,7 @@ module.exports = { * - `class A { static async foo() {} }` .... `static async method 'foo'` * - `class A { static get foo() {} }` ...... `static getter 'foo'` * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` - * - * @param {ASTNode} node - The function node to get. + * @param {ASTNode} node The function node to get. * @returns {string} The name and kind of the function node. */ getFunctionNameWithKind(node) { @@ -1198,9 +1172,8 @@ module.exports = { * ^^^^^^^^^^^^^^ * - `class A { static set foo(a) {} }` * ^^^^^^^^^^^^^^ - * - * @param {ASTNode} node - The function node to get. - * @param {SourceCode} sourceCode - The source code object to get tokens. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. * @returns {string} The location of the function node for reporting. */ getFunctionHeadLoc(node, sourceCode) { @@ -1384,7 +1357,6 @@ module.exports = { * "\00", "\01" ... "\09" * * "\0", when not followed by a digit, is not an octal escape sequence. - * * @param {string} rawString A string in its raw representation. * @returns {boolean} `true` if the string contains at least one octal escape sequence. */ diff --git a/tools/node_modules/eslint/lib/rules/utils/fix-tracker.js b/tools/node_modules/eslint/lib/rules/utils/fix-tracker.js index c987a28ca6cb49..589870b39b5215 100644 --- a/tools/node_modules/eslint/lib/rules/utils/fix-tracker.js +++ b/tools/node_modules/eslint/lib/rules/utils/fix-tracker.js @@ -23,7 +23,6 @@ class FixTracker { /** * Create a new FixTracker. - * * @param {ruleFixer} fixer A ruleFixer instance. * @param {SourceCode} sourceCode A SourceCode object for the current code. */ @@ -36,7 +35,6 @@ class FixTracker { /** * Mark the given range as "retained", meaning that other fixes may not * may not modify this region in the same pass. - * * @param {int[]} range The range to retain. * @returns {FixTracker} The same RuleFixer, for chained calls. */ @@ -50,7 +48,6 @@ class FixTracker { * mark it as retained, meaning that other fixes may not modify it in this * pass. This is useful for avoiding conflicts in fixes that modify control * flow. - * * @param {ASTNode} node The node to use as a starting point. * @returns {FixTracker} The same RuleFixer, for chained calls. */ @@ -65,7 +62,6 @@ class FixTracker { * range as retained, meaning that other fixes may not modify it in this * pass. This is useful for avoiding conflicts in fixes that make a small * change to the code where the AST should not be changed. - * * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting * point. The token to the left and right are use in the range. * @returns {FixTracker} The same RuleFixer, for chained calls. @@ -80,7 +76,6 @@ class FixTracker { /** * Create a fix command that replaces the given range with the given text, * accounting for any retained ranges. - * * @param {int[]} range The range to remove in the fix. * @param {string} text The text to insert in place of the range. * @returns {Object} The fix command. @@ -108,7 +103,6 @@ class FixTracker { /** * Create a fix command that removes the given node or token, accounting for * any retained ranges. - * * @param {ASTNode|Token} nodeOrToken The node or token to remove. * @returns {Object} The fix command. */ diff --git a/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js index e0caddb9b2821c..d426d85c59a7b3 100644 --- a/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +++ b/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -10,7 +10,6 @@ const debug = require("debug")("eslint:rules"); /** * The `Map` object that loads each rule when it's accessed. - * * @example * const rules = new LazyLoadingRuleMap([ * ["eqeqeq", () => require("eqeqeq")], diff --git a/tools/node_modules/eslint/lib/rules/vars-on-top.js b/tools/node_modules/eslint/lib/rules/vars-on-top.js index e919d02da00a84..28ddae442b517a 100644 --- a/tools/node_modules/eslint/lib/rules/vars-on-top.js +++ b/tools/node_modules/eslint/lib/rules/vars-on-top.js @@ -32,8 +32,9 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- + // eslint-disable-next-line jsdoc/require-description /** - * @param {ASTNode} node - any node + * @param {ASTNode} node any node * @returns {boolean} whether the given node structurally represents a directive */ function looksLikeDirective(node) { @@ -43,7 +44,7 @@ module.exports = { /** * Check to see if its a ES6 import declaration - * @param {ASTNode} node - any node + * @param {ASTNode} node any node * @returns {boolean} whether the given node represents a import declaration */ function looksLikeImport(node) { @@ -53,8 +54,7 @@ module.exports = { /** * Checks whether a given node is a variable declaration or not. - * - * @param {ASTNode} node - any node + * @param {ASTNode} node any node * @returns {boolean} `true` if the node is a variable declaration. */ function isVariableDeclaration(node) { @@ -70,8 +70,8 @@ module.exports = { /** * Checks whether this variable is on top of the block body - * @param {ASTNode} node - The node to check - * @param {ASTNode[]} statements - collection of ASTNodes for the parent node block + * @param {ASTNode} node The node to check + * @param {ASTNode[]} statements collection of ASTNodes for the parent node block * @returns {boolean} True if var is on top otherwise false */ function isVarOnTop(node, statements) { @@ -99,8 +99,8 @@ module.exports = { /** * Checks whether variable is on top at the global level - * @param {ASTNode} node - The node to check - * @param {ASTNode} parent - Parent of the node + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node * @returns {void} */ function globalVarCheck(node, parent) { @@ -111,9 +111,9 @@ module.exports = { /** * Checks whether variable is on top at functional block scope level - * @param {ASTNode} node - The node to check - * @param {ASTNode} parent - Parent of the node - * @param {ASTNode} grandParent - Parent of the node's parent + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @param {ASTNode} grandParent Parent of the node's parent * @returns {void} */ function blockScopeVarCheck(node, parent, grandParent) { diff --git a/tools/node_modules/eslint/lib/shared/config-ops.js b/tools/node_modules/eslint/lib/shared/config-ops.js index d2ffda4b5ffe8a..3b4d5699d86928 100644 --- a/tools/node_modules/eslint/lib/shared/config-ops.js +++ b/tools/node_modules/eslint/lib/shared/config-ops.js @@ -77,7 +77,7 @@ module.exports = { /** * Checks whether a given config has valid severity or not. - * @param {number|string|Array} ruleConfig - The configuration for an individual rule. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. * @returns {boolean} `true` if the configuration has valid severity. */ isValidSeverity(ruleConfig) { @@ -91,7 +91,7 @@ module.exports = { /** * Checks whether every rule of a given config has valid severity or not. - * @param {Object} config - The configuration for rules. + * @param {Object} config The configuration for rules. * @returns {boolean} `true` if the configuration has valid severity. */ isEverySeverityValid(config) { diff --git a/tools/node_modules/eslint/lib/shared/runtime-info.js b/tools/node_modules/eslint/lib/shared/runtime-info.js index 169bbc58f13c16..feed005330e622 100644 --- a/tools/node_modules/eslint/lib/shared/runtime-info.js +++ b/tools/node_modules/eslint/lib/shared/runtime-info.js @@ -28,8 +28,8 @@ function environment() { /** * Checks if a path is a child of a directory. - * @param {string} parentPath - The parent path to check. - * @param {string} childPath - The path to check. + * @param {string} parentPath The parent path to check. + * @param {string} childPath The path to check. * @returns {boolean} Whether or not the given path is a child of a directory. */ function isChildOfDirectory(parentPath, childPath) { @@ -38,8 +38,8 @@ function environment() { /** * Synchronously executes a shell command and formats the result. - * @param {string} cmd - The command to execute. - * @param {Array} args - The arguments to be executed with the command. + * @param {string} cmd The command to execute. + * @param {Array} args The arguments to be executed with the command. * @returns {string} The version returned by the command. */ function execCommand(cmd, args) { @@ -63,7 +63,7 @@ function environment() { /** * Normalizes a version number. - * @param {string} versionStr - The string to normalize. + * @param {string} versionStr The string to normalize. * @returns {string} The normalized version number. */ function normalizeVersionStr(versionStr) { @@ -72,7 +72,7 @@ function environment() { /** * Gets bin version. - * @param {string} bin - The bin to check. + * @param {string} bin The bin to check. * @returns {string} The normalized version returned by the command. */ function getBinVersion(bin) { @@ -88,8 +88,8 @@ function environment() { /** * Gets installed npm package version. - * @param {string} pkg - The package to check. - * @param {boolean} global - Whether to check globally or not. + * @param {string} pkg The package to check. + * @param {boolean} global Whether to check globally or not. * @returns {string} The normalized version returned by the command. */ function getNpmPackageVersion(pkg, { global = false } = {}) { diff --git a/tools/node_modules/eslint/lib/shared/traverser.js b/tools/node_modules/eslint/lib/shared/traverser.js index 79fb32faf95cff..32f76779507c5a 100644 --- a/tools/node_modules/eslint/lib/shared/traverser.js +++ b/tools/node_modules/eslint/lib/shared/traverser.js @@ -65,6 +65,7 @@ class Traverser { this._leave = null; } + // eslint-disable-next-line jsdoc/require-description /** * @returns {ASTNode} The current node. */ @@ -72,6 +73,7 @@ class Traverser { return this._current; } + // eslint-disable-next-line jsdoc/require-description /** * @returns {ASTNode[]} The ancestor nodes. */ diff --git a/tools/node_modules/eslint/lib/source-code/source-code.js b/tools/node_modules/eslint/lib/source-code/source-code.js index 42e7b0c2f475e4..86a56803ed76c3 100644 --- a/tools/node_modules/eslint/lib/source-code/source-code.js +++ b/tools/node_modules/eslint/lib/source-code/source-code.js @@ -86,13 +86,13 @@ class SourceCode extends TokenStore { /** * Represents parsed source code. - * @param {string|Object} textOrConfig - The source code text or config object. - * @param {string} textOrConfig.text - The source code text. - * @param {ASTNode} textOrConfig.ast - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. - * @param {Object|null} textOrConfig.parserServices - The parser services. - * @param {ScopeManager|null} textOrConfig.scopeManager - The scope of this source code. - * @param {Object|null} textOrConfig.visitorKeys - The visitor keys to traverse AST. - * @param {ASTNode} [astIfNoConfig] - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {string|Object} textOrConfig The source code text or config object. + * @param {string} textOrConfig.text The source code text. + * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {Object|null} textOrConfig.parserServices The parser services. + * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code. + * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST. + * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. */ constructor(textOrConfig, astIfNoConfig) { let text, ast, parserServices, scopeManager, visitorKeys; @@ -423,7 +423,7 @@ class SourceCode extends TokenStore { isSpaceBetweenTokens(first, second) { const text = this.text.slice(first.range[1], second.range[0]); - return /\s/u.test(text.replace(/\/\*.*?\*\//gu, "")); + return /\s/u.test(text.replace(/\/\*.*?\*\//gus, "")); } /** diff --git a/tools/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js index 7c2137a176ff21..7255a62260b29a 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js @@ -22,11 +22,11 @@ module.exports = class BackwardTokenCommentCursor extends Cursor { /** * Initializes this cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. */ constructor(tokens, comments, indexMap, startLoc, endLoc) { super(); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js index 93973bce443df7..454a2449701cf1 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js @@ -22,11 +22,11 @@ module.exports = class BackwardTokenCursor extends Cursor { /** * Initializes this cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. */ constructor(tokens, comments, indexMap, startLoc, endLoc) { super(); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/cursors.js b/tools/node_modules/eslint/lib/source-code/token-store/cursors.js index b315c7e65e1a7c..30c72b69b8f962 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/cursors.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/cursors.js @@ -28,8 +28,8 @@ class CursorFactory { /** * Initializes this cursor. - * @param {Function} TokenCursor - The class of the cursor which iterates tokens only. - * @param {Function} TokenCommentCursor - The class of the cursor which iterates the mix of tokens and comments. + * @param {Function} TokenCursor The class of the cursor which iterates tokens only. + * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments. */ constructor(TokenCursor, TokenCommentCursor) { this.TokenCursor = TokenCursor; @@ -38,13 +38,12 @@ class CursorFactory { /** * Creates a base cursor instance that can be decorated by createCursor. - * - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {boolean} includeComments - The flag to iterate comments as well. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. * @returns {Cursor} The created base cursor. */ createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) { @@ -55,16 +54,15 @@ class CursorFactory { /** * Creates a cursor that iterates tokens with normalized options. - * - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {boolean} includeComments - The flag to iterate comments as well. - * @param {Function|null} filter - The predicate function to choose tokens. - * @param {number} skip - The count of tokens the cursor skips. - * @param {number} count - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @param {Function|null} filter The predicate function to choose tokens. + * @param {number} skip The count of tokens the cursor skips. + * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. * @returns {Cursor} The created cursor. */ createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) { diff --git a/tools/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js index f0bff9c51dba76..3ee7b0b39755e1 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js @@ -21,7 +21,7 @@ module.exports = class DecorativeCursor extends Cursor { /** * Initializes this cursor. - * @param {Cursor} cursor - The cursor to be decorated. + * @param {Cursor} cursor The cursor to be decorated. */ constructor(cursor) { super(); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/filter-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/filter-cursor.js index 7133627bd395a1..08c4f22031af86 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/filter-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/filter-cursor.js @@ -21,8 +21,8 @@ module.exports = class FilterCursor extends DecorativeCursor { /** * Initializes this cursor. - * @param {Cursor} cursor - The cursor to be decorated. - * @param {Function} predicate - The predicate function to decide tokens this cursor iterates. + * @param {Cursor} cursor The cursor to be decorated. + * @param {Function} predicate The predicate function to decide tokens this cursor iterates. */ constructor(cursor, predicate) { super(cursor); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js index be08552970fcd1..50c7a394f38476 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js @@ -22,11 +22,11 @@ module.exports = class ForwardTokenCommentCursor extends Cursor { /** * Initializes this cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. */ constructor(tokens, comments, indexMap, startLoc, endLoc) { super(); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js index 523ed398fa3d9e..e8c18609621fba 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js @@ -22,11 +22,11 @@ module.exports = class ForwardTokenCursor extends Cursor { /** * Initializes this cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. */ constructor(tokens, comments, indexMap, startLoc, endLoc) { super(); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/index.js b/tools/node_modules/eslint/lib/source-code/token-store/index.js index 8f9b09e95efe86..25db8a4f4dbe59 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/index.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/index.js @@ -28,9 +28,8 @@ const INDEX_MAP = Symbol("indexMap"); * * The first/last location of tokens is mapped to the index of the token. * The first/last location of comments is mapped to the index of the next token of each comment. - * - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. * @returns {Object} The map from locations to indices in `tokens`. * @private */ @@ -62,17 +61,16 @@ function createIndexMap(tokens, comments) { /** * Creates the cursor iterates tokens with options. - * - * @param {CursorFactory} factory - The cursor factory to initialize cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {number|Function|Object} [opts=0] - The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. - * @param {boolean} [opts.includeComments=false] - The flag to iterate comments as well. - * @param {Function|null} [opts.filter=null] - The predicate function to choose tokens. - * @param {number} [opts.skip=0] - The count of tokens the cursor skips. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.skip=0] The count of tokens the cursor skips. * @returns {Cursor} The created cursor. * @private */ @@ -98,17 +96,16 @@ function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, end /** * Creates the cursor iterates tokens with options. - * - * @param {CursorFactory} factory - The cursor factory to initialize cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {number|Function|Object} [opts=0] - The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. - * @param {boolean} [opts.includeComments] - The flag to iterate comments as well. - * @param {Function|null} [opts.filter=null] - The predicate function to choose tokens. - * @param {number} [opts.count=0] - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. * @returns {Cursor} The created cursor. * @private */ @@ -138,29 +135,27 @@ function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, en /** * Creates the cursor iterates tokens with options. * This is overload function of the below. - * - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {Function|Object} opts - The option object. If this is a function then it's `opts.filter`. - * @param {boolean} [opts.includeComments] - The flag to iterate comments as well. - * @param {Function|null} [opts.filter=null] - The predicate function to choose tokens. - * @param {number} [opts.count=0] - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. * @returns {Cursor} The created cursor. * @private */ /** * Creates the cursor iterates tokens with options. - * - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {number} [beforeCount=0] - The number of tokens before the node to retrieve. - * @param {boolean} [afterCount=0] - The number of tokens after the node to retrieve. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve. * @returns {Cursor} The created cursor. * @private */ @@ -176,7 +171,7 @@ function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, b /** * Gets comment tokens that are adjacent to the current cursor position. - * @param {Cursor} cursor - A cursor instance. + * @param {Cursor} cursor A cursor instance. * @returns {Array} An array of comment tokens adjacent to the current cursor position. * @private */ @@ -211,8 +206,8 @@ module.exports = class TokenStore { /** * Initializes this token store. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. */ constructor(tokens, comments) { this[TOKENS] = tokens; @@ -226,9 +221,9 @@ module.exports = class TokenStore { /** * Gets the token starting at the specified index. - * @param {number} offset - Index of the start of the token's range. - * @param {Object} [options=0] - The option object. - * @param {boolean} [options.includeComments=false] - The flag to iterate comments as well. + * @param {number} offset Index of the start of the token's range. + * @param {Object} [options=0] The option object. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. * @returns {Token|null} The token starting at index, or null if no such token. */ getTokenByRangeStart(offset, options) { @@ -250,11 +245,11 @@ module.exports = class TokenStore { /** * Gets the first token of the given node. - * @param {ASTNode} node - The AST node. - * @param {number|Function|Object} [options=0] - The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. - * @param {boolean} [options.includeComments=false] - The flag to iterate comments as well. - * @param {Function|null} [options.filter=null] - The predicate function to choose tokens. - * @param {number} [options.skip=0] - The count of tokens the cursor skips. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.skip=0] The count of tokens the cursor skips. * @returns {Token|null} An object representing the token. */ getFirstToken(node, options) { @@ -271,8 +266,8 @@ module.exports = class TokenStore { /** * Gets the last token of the given node. - * @param {ASTNode} node - The AST node. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstToken() + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() * @returns {Token|null} An object representing the token. */ getLastToken(node, options) { @@ -289,8 +284,8 @@ module.exports = class TokenStore { /** * Gets the token that precedes a given node or token. - * @param {ASTNode|Token|Comment} node - The AST node or token. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstToken() + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() * @returns {Token|null} An object representing the token. */ getTokenBefore(node, options) { @@ -307,8 +302,8 @@ module.exports = class TokenStore { /** * Gets the token that follows a given node or token. - * @param {ASTNode|Token|Comment} node - The AST node or token. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstToken() + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() * @returns {Token|null} An object representing the token. */ getTokenAfter(node, options) { @@ -325,9 +320,9 @@ module.exports = class TokenStore { /** * Gets the first token between two non-overlapping nodes. - * @param {ASTNode|Token|Comment} left - Node before the desired token range. - * @param {ASTNode|Token|Comment} right - Node after the desired token range. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstToken() + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() * @returns {Token|null} An object representing the token. */ getFirstTokenBetween(left, right, options) { @@ -346,7 +341,7 @@ module.exports = class TokenStore { * Gets the last token between two non-overlapping nodes. * @param {ASTNode|Token|Comment} left Node before the desired token range. * @param {ASTNode|Token|Comment} right Node after the desired token range. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstToken() + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() * @returns {Token|null} An object representing the token. */ getLastTokenBetween(left, right, options) { @@ -393,11 +388,11 @@ module.exports = class TokenStore { /** * Gets the first `count` tokens of the given node. - * @param {ASTNode} node - The AST node. - * @param {number|Function|Object} [options=0] - The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. - * @param {boolean} [options.includeComments=false] - The flag to iterate comments as well. - * @param {Function|null} [options.filter=null] - The predicate function to choose tokens. - * @param {number} [options.count=0] - The maximum count of tokens the cursor iterates. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. * @returns {Token[]} Tokens. */ getFirstTokens(node, options) { @@ -414,8 +409,8 @@ module.exports = class TokenStore { /** * Gets the last `count` tokens of the given node. - * @param {ASTNode} node - The AST node. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstTokens() + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() * @returns {Token[]} Tokens. */ getLastTokens(node, options) { @@ -432,8 +427,8 @@ module.exports = class TokenStore { /** * Gets the `count` tokens that precedes a given node or token. - * @param {ASTNode|Token|Comment} node - The AST node or token. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstTokens() + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() * @returns {Token[]} Tokens. */ getTokensBefore(node, options) { @@ -450,8 +445,8 @@ module.exports = class TokenStore { /** * Gets the `count` tokens that follows a given node or token. - * @param {ASTNode|Token|Comment} node - The AST node or token. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstTokens() + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() * @returns {Token[]} Tokens. */ getTokensAfter(node, options) { @@ -468,9 +463,9 @@ module.exports = class TokenStore { /** * Gets the first `count` tokens between two non-overlapping nodes. - * @param {ASTNode|Token|Comment} left - Node before the desired token range. - * @param {ASTNode|Token|Comment} right - Node after the desired token range. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstTokens() + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() * @returns {Token[]} Tokens between left and right. */ getFirstTokensBetween(left, right, options) { @@ -489,7 +484,7 @@ module.exports = class TokenStore { * Gets the last `count` tokens between two non-overlapping nodes. * @param {ASTNode|Token|Comment} left Node before the desired token range. * @param {ASTNode|Token|Comment} right Node after the desired token range. - * @param {number|Function|Object} [options=0] - The option object. Same options as getFirstTokens() + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() * @returns {Token[]} Tokens between left and right. */ getLastTokensBetween(left, right, options) { @@ -506,18 +501,18 @@ module.exports = class TokenStore { /** * Gets all tokens that are related to the given node. - * @param {ASTNode} node - The AST node. + * @param {ASTNode} node The AST node. * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. - * @param {boolean} [options.includeComments=false] - The flag to iterate comments as well. - * @param {Function|null} [options.filter=null] - The predicate function to choose tokens. - * @param {number} [options.count=0] - The maximum count of tokens the cursor iterates. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. * @returns {Token[]} Array of objects representing tokens. */ /** * Gets all tokens that are related to the given node. - * @param {ASTNode} node - The AST node. - * @param {int} [beforeCount=0] - The number of tokens before the node to retrieve. - * @param {int} [afterCount=0] - The number of tokens after the node to retrieve. + * @param {ASTNode} node The AST node. + * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {int} [afterCount=0] The number of tokens after the node to retrieve. * @returns {Token[]} Array of objects representing tokens. */ getTokens(node, beforeCount, afterCount) { @@ -537,9 +532,9 @@ module.exports = class TokenStore { * @param {ASTNode|Token|Comment} left Node before the desired token range. * @param {ASTNode|Token|Comment} right Node after the desired token range. * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. - * @param {boolean} [options.includeComments=false] - The flag to iterate comments as well. - * @param {Function|null} [options.filter=null] - The predicate function to choose tokens. - * @param {number} [options.count=0] - The maximum count of tokens the cursor iterates. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. * @returns {Token[]} Tokens between left and right. */ /** @@ -567,9 +562,8 @@ module.exports = class TokenStore { /** * Checks whether any comments exist or not between the given 2 nodes. - * - * @param {ASTNode} left - The node to check. - * @param {ASTNode} right - The node to check. + * @param {ASTNode} left The node to check. + * @param {ASTNode} right The node to check. * @returns {boolean} `true` if one or more comments exist. */ commentsExistBetween(left, right) { diff --git a/tools/node_modules/eslint/lib/source-code/token-store/limit-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/limit-cursor.js index efb46cf0e3f40d..0fd92a77657ab3 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/limit-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/limit-cursor.js @@ -21,8 +21,8 @@ module.exports = class LimitCursor extends DecorativeCursor { /** * Initializes this cursor. - * @param {Cursor} cursor - The cursor to be decorated. - * @param {number} count - The count of tokens this cursor iterates. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor iterates. */ constructor(cursor, count) { super(cursor); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js index c083aed1e9bab9..89349fa1c69526 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js @@ -22,13 +22,13 @@ module.exports = class PaddedTokenCursor extends ForwardTokenCursor { /** * Initializes this cursor. - * @param {Token[]} tokens - The array of tokens. - * @param {Comment[]} comments - The array of comments. - * @param {Object} indexMap - The map from locations to indices in `tokens`. - * @param {number} startLoc - The start location of the iteration range. - * @param {number} endLoc - The end location of the iteration range. - * @param {number} beforeCount - The number of tokens this cursor iterates before start. - * @param {number} afterCount - The number of tokens this cursor iterates after end. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} beforeCount The number of tokens this cursor iterates before start. + * @param {number} afterCount The number of tokens this cursor iterates after end. */ constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { super(tokens, comments, indexMap, startLoc, endLoc); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/skip-cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/skip-cursor.js index ab34dfab0db3c6..f068f531c1e3df 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/skip-cursor.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/skip-cursor.js @@ -21,8 +21,8 @@ module.exports = class SkipCursor extends DecorativeCursor { /** * Initializes this cursor. - * @param {Cursor} cursor - The cursor to be decorated. - * @param {number} count - The count of tokens this cursor skips. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor skips. */ constructor(cursor, count) { super(cursor); diff --git a/tools/node_modules/eslint/lib/source-code/token-store/utils.js b/tools/node_modules/eslint/lib/source-code/token-store/utils.js index 34b0a9af6da68d..444684b52f1bb0 100644 --- a/tools/node_modules/eslint/lib/source-code/token-store/utils.js +++ b/tools/node_modules/eslint/lib/source-code/token-store/utils.js @@ -16,8 +16,7 @@ const lodash = require("lodash"); /** * Gets `token.range[0]` from the given token. - * - * @param {Node|Token|Comment} token - The token to get. + * @param {Node|Token|Comment} token The token to get. * @returns {number} The start location. * @private */ @@ -32,9 +31,8 @@ function getStartLocation(token) { /** * Binary-searches the index of the first token which is after the given location. * If it was not found, this returns `tokens.length`. - * - * @param {(Token|Comment)[]} tokens - It searches the token in this list. - * @param {number} location - The location to search. + * @param {(Token|Comment)[]} tokens It searches the token in this list. + * @param {number} location The location to search. * @returns {number} The found index or `tokens.length`. */ exports.search = function search(tokens, location) { @@ -48,10 +46,9 @@ exports.search = function search(tokens, location) { /** * Gets the index of the `startLoc` in `tokens`. * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well. - * - * @param {(Token|Comment)[]} tokens - The tokens to find an index. - * @param {Object} indexMap - The map from locations to indices. - * @param {number} startLoc - The location to get an index. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} startLoc The location to get an index. * @returns {number} The index. */ exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { @@ -77,10 +74,9 @@ exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { /** * Gets the index of the `endLoc` in `tokens`. * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well. - * - * @param {(Token|Comment)[]} tokens - The tokens to find an index. - * @param {Object} indexMap - The map from locations to indices. - * @param {number} endLoc - The location to get an index. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} endLoc The location to get an index. * @returns {number} The index. */ exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md b/tools/node_modules/eslint/node_modules/acorn-jsx/README.md index 2bbb1d99fd8cfa..317c3ac4a5534e 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/README.md +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/README.md @@ -1,19 +1,15 @@ # Acorn-JSX -[![Build Status](https://travis-ci.org/RReverser/acorn-jsx.svg?branch=master)](https://travis-ci.org/RReverser/acorn-jsx) +[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx) [![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. -It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. - -According to [benchmarks](https://github.com/RReverser/acorn-jsx/blob/master/test/bench.html), Acorn-JSX is 2x faster than official [Esprima-based parser](https://github.com/facebook/esprima) when location tracking is turned on in both (call it "source maps enabled mode"). At the same time, it consumes all the ES6+JSX syntax that can be consumed by Esprima-FB (this is proved by [official tests](https://github.com/RReverser/acorn-jsx/blob/master/test/tests-jsx.js)). - -**UPDATE [14-Apr-2015]**: Facebook implementation started [deprecation process](https://github.com/facebook/esprima/issues/111) in favor of Acorn + Acorn-JSX + Babel for parsing and transpiling JSX syntax. +It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools. ## Transpiler -Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out the [babel transpiler](https://babeljs.io/) which uses `acorn-jsx` under the hood. +Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood. ## Usage diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js index 460e7933992122..6df802bee9185e 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js @@ -5,40 +5,53 @@ const XHTMLEntities = require('./xhtml'); const hexNumber = /^[\da-fA-F]+$/; const decimalNumber = /^\d+$/; -const acorn = require("acorn"); -const tt = acorn.tokTypes; -const TokContext = acorn.TokContext; -const tokContexts = acorn.tokContexts; -const TokenType = acorn.TokenType; -const isNewLine = acorn.isNewLine; -const isIdentifierStart = acorn.isIdentifierStart; -const isIdentifierChar = acorn.isIdentifierChar; - -const tc_oTag = new TokContext('...', true, true); - -const tok = { - jsxName: new TokenType('jsxName'), - jsxText: new TokenType('jsxText', {beforeExpr: true}), - jsxTagStart: new TokenType('jsxTagStart'), - jsxTagEnd: new TokenType('jsxTagEnd') -} +// The map to `acorn-jsx` tokens from `acorn` namespace objects. +const acornJsxMap = new WeakMap(); + +// Get the original tokens for the given `acorn` namespace object. +function getJsxTokens(acorn) { + acorn = acorn.Parser.acorn || acorn; + let acornJsx = acornJsxMap.get(acorn); + if (!acornJsx) { + const tt = acorn.tokTypes; + const TokContext = acorn.TokContext; + const TokenType = acorn.TokenType; + const tc_oTag = new TokContext('...', true, true); + const tokContexts = { + tc_oTag: tc_oTag, + tc_cTag: tc_cTag, + tc_expr: tc_expr + }; + const tokTypes = { + jsxName: new TokenType('jsxName'), + jsxText: new TokenType('jsxText', {beforeExpr: true}), + jsxTagStart: new TokenType('jsxTagStart'), + jsxTagEnd: new TokenType('jsxTagEnd') + }; + + tokTypes.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); // treat as beginning of JSX expression + this.context.push(tc_oTag); // start opening tag context + this.exprAllowed = false; + }; + tokTypes.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } + }; -tok.jsxTagStart.updateContext = function() { - this.context.push(tc_expr); // treat as beginning of JSX expression - this.context.push(tc_oTag); // start opening tag context - this.exprAllowed = false; -}; -tok.jsxTagEnd.updateContext = function(prevType) { - let out = this.context.pop(); - if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { - this.context.pop(); - this.exprAllowed = this.curContext() === tc_expr; - } else { - this.exprAllowed = true; + acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes }; + acornJsxMap.set(acorn, acornJsx); } -}; + + return acornJsx; +} // Transforms JSX element name to string. @@ -64,12 +77,38 @@ module.exports = function(options) { allowNamespaces: options.allowNamespaces !== false, allowNamespacedObjects: !!options.allowNamespacedObjects }, Parser); - } + }; }; -module.exports.tokTypes = tok; + +// This is `tokTypes` of the peer dep. +// This can be different instances from the actual `tokTypes` this plugin uses. +Object.defineProperty(module.exports, "tokTypes", { + get: function get_tokTypes() { + return getJsxTokens(require("acorn")).tokTypes; + }, + configurable: true, + enumerable: true +}); function plugin(options, Parser) { + const acorn = Parser.acorn || require("acorn"); + const acornJsx = getJsxTokens(acorn); + const tt = acorn.tokTypes; + const tok = acornJsx.tokTypes; + const tokContexts = acorn.tokContexts; + const tc_oTag = acornJsx.tokContexts.tc_oTag; + const tc_cTag = acornJsx.tokContexts.tc_cTag; + const tc_expr = acornJsx.tokContexts.tc_expr; + const isNewLine = acorn.isNewLine; + const isIdentifierStart = acorn.isIdentifierStart; + const isIdentifierChar = acorn.isIdentifierChar; + return class extends Parser { + // Expose actual `tokTypes` and `tokContexts` to other plugins. + static get acornJsx() { + return acornJsx; + } + // Reads inline JSX contents token. jsx_readToken() { let out = '', chunkStart = this.pos; @@ -419,7 +458,7 @@ function plugin(options, Parser) { ++this.pos; return this.finishToken(tok.jsxTagStart); } - return super.readToken(code) + return super.readToken(code); } updateContext(prevType) { @@ -427,7 +466,7 @@ function plugin(options, Parser) { var curContext = this.curContext(); if (curContext == tc_oTag) this.context.push(tokContexts.b_expr); else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl); - else super.updateContext(prevType) + else super.updateContext(prevType); this.exprAllowed = true; } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json index a8f903e4aacede..55b6aadbcedb08 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -1,14 +1,14 @@ { "bugs": { - "url": "https://github.com/RReverser/acorn-jsx/issues" + "url": "https://github.com/acornjs/acorn-jsx/issues" }, "bundleDependencies": false, "deprecated": false, - "description": "Alternative, faster React.js JSX parser", + "description": "Modern, fast React.js JSX parser", "devDependencies": { "acorn": "^7.0.0" }, - "homepage": "https://github.com/RReverser/acorn-jsx", + "homepage": "https://github.com/acornjs/acorn-jsx", "license": "MIT", "maintainers": [ { @@ -23,10 +23,10 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/RReverser/acorn-jsx.git" + "url": "git+https://github.com/acornjs/acorn-jsx.git" }, "scripts": { "test": "node test/run.js" }, - "version": "5.0.2" + "version": "5.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-escapes/index.js b/tools/node_modules/eslint/node_modules/ansi-escapes/index.js index f201915dee9290..4638bbc3d62b29 100644 --- a/tools/node_modules/eslint/node_modules/ansi-escapes/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-escapes/index.js @@ -1,12 +1,15 @@ 'use strict'; -const x = module.exports; +const ansiEscapes = module.exports; +// TODO: remove this in the next major version +module.exports.default = ansiEscapes; + const ESC = '\u001B['; const OSC = '\u001B]'; const BEL = '\u0007'; const SEP = ';'; const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal'; -x.cursorTo = (x, y) => { +ansiEscapes.cursorTo = (x, y) => { if (typeof x !== 'number') { throw new TypeError('The `x` argument is required'); } @@ -18,7 +21,7 @@ x.cursorTo = (x, y) => { return ESC + (y + 1) + ';' + (x + 1) + 'H'; }; -x.cursorMove = (x, y) => { +ansiEscapes.cursorMove = (x, y) => { if (typeof x !== 'number') { throw new TypeError('The `x` argument is required'); } @@ -40,56 +43,56 @@ x.cursorMove = (x, y) => { return ret; }; -x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A'; -x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B'; -x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C'; -x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D'; - -x.cursorLeft = ESC + 'G'; -x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's'); -x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u'); -x.cursorGetPosition = ESC + '6n'; -x.cursorNextLine = ESC + 'E'; -x.cursorPrevLine = ESC + 'F'; -x.cursorHide = ESC + '?25l'; -x.cursorShow = ESC + '?25h'; - -x.eraseLines = count => { +ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A'; +ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B'; +ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C'; +ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D'; + +ansiEscapes.cursorLeft = ESC + 'G'; +ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's'; +ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u'; +ansiEscapes.cursorGetPosition = ESC + '6n'; +ansiEscapes.cursorNextLine = ESC + 'E'; +ansiEscapes.cursorPrevLine = ESC + 'F'; +ansiEscapes.cursorHide = ESC + '?25l'; +ansiEscapes.cursorShow = ESC + '?25h'; + +ansiEscapes.eraseLines = count => { let clear = ''; for (let i = 0; i < count; i++) { - clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : ''); + clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : ''); } if (count) { - clear += x.cursorLeft; + clear += ansiEscapes.cursorLeft; } return clear; }; -x.eraseEndLine = ESC + 'K'; -x.eraseStartLine = ESC + '1K'; -x.eraseLine = ESC + '2K'; -x.eraseDown = ESC + 'J'; -x.eraseUp = ESC + '1J'; -x.eraseScreen = ESC + '2J'; -x.scrollUp = ESC + 'S'; -x.scrollDown = ESC + 'T'; +ansiEscapes.eraseEndLine = ESC + 'K'; +ansiEscapes.eraseStartLine = ESC + '1K'; +ansiEscapes.eraseLine = ESC + '2K'; +ansiEscapes.eraseDown = ESC + 'J'; +ansiEscapes.eraseUp = ESC + '1J'; +ansiEscapes.eraseScreen = ESC + '2J'; +ansiEscapes.scrollUp = ESC + 'S'; +ansiEscapes.scrollDown = ESC + 'T'; -x.clearScreen = '\u001Bc'; +ansiEscapes.clearScreen = '\u001Bc'; -x.clearTerminal = process.platform === 'win32' ? - `${x.eraseScreen}${ESC}0f` : +ansiEscapes.clearTerminal = process.platform === 'win32' ? + `${ansiEscapes.eraseScreen}${ESC}0f` : // 1. Erases the screen (Only done in case `2` is not supported) // 2. Erases the whole screen including scrollback buffer // 3. Moves cursor to the top-left position // More info: https://www.real-world-systems.com/docs/ANSIcode.html - `${x.eraseScreen}${ESC}3J${ESC}H`; + `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`; -x.beep = BEL; +ansiEscapes.beep = BEL; -x.link = (text, url) => { +ansiEscapes.link = (text, url) => { return [ OSC, '8', @@ -106,26 +109,24 @@ x.link = (text, url) => { ].join(''); }; -x.image = (buf, opts) => { - opts = opts || {}; - - let ret = OSC + '1337;File=inline=1'; +ansiEscapes.image = (buffer, options = {}) => { + let ret = `${OSC}1337;File=inline=1`; - if (opts.width) { - ret += `;width=${opts.width}`; + if (options.width) { + ret += `;width=${options.width}`; } - if (opts.height) { - ret += `;height=${opts.height}`; + if (options.height) { + ret += `;height=${options.height}`; } - if (opts.preserveAspectRatio === false) { + if (options.preserveAspectRatio === false) { ret += ';preserveAspectRatio=0'; } - return ret + ':' + buf.toString('base64') + BEL; + return ret + ':' + buffer.toString('base64') + BEL; }; -x.iTerm = {}; - -x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; +ansiEscapes.iTerm = { + setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}` +}; diff --git a/tools/node_modules/eslint/node_modules/ansi-escapes/package.json b/tools/node_modules/eslint/node_modules/ansi-escapes/package.json index d1ba760b8b5dd9..a58ed743a59171 100644 --- a/tools/node_modules/eslint/node_modules/ansi-escapes/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-escapes/package.json @@ -8,17 +8,23 @@ "url": "https://github.com/sindresorhus/ansi-escapes/issues" }, "bundleDependencies": false, + "dependencies": { + "type-fest": "^0.5.2" + }, "deprecated": false, "description": "ANSI escape codes for manipulating the terminal", "devDependencies": { - "ava": "*", - "xo": "*" + "@types/node": "^12.0.7", + "ava": "^2.1.0", + "tsd": "^0.7.1", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/ansi-escapes#readme", "keywords": [ @@ -53,7 +59,7 @@ "url": "git+https://github.com/sindresorhus/ansi-escapes.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "3.2.0" + "version": "4.2.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-escapes/readme.md b/tools/node_modules/eslint/node_modules/ansi-escapes/readme.md index 513ef6082614cd..b290753094d948 100644 --- a/tools/node_modules/eslint/node_modules/ansi-escapes/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-escapes/readme.md @@ -23,11 +23,11 @@ process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft); ## API -### cursorTo(x, [y]) +### cursorTo(x, y?) Set the absolute position of the cursor. `x0` `y0` is the top left of the screen. -### cursorMove(x, [y]) +### cursorMove(x, y?) Set the position of the cursor relative to its current position. @@ -41,11 +41,11 @@ Move cursor down a specific amount of rows. Default is `1`. ### cursorForward(count) -Move cursor forward a specific amount of rows. Default is `1`. +Move cursor forward a specific amount of columns. Default is `1`. ### cursorBackward(count) -Move cursor backward a specific amount of rows. Default is `1`. +Move cursor backward a specific amount of columns. Default is `1`. ### cursorLeft @@ -133,7 +133,7 @@ Create a clickable link. [Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support. -### image(input, [options]) +### image(filePath, options?) Display an image. @@ -149,10 +149,12 @@ Buffer of an image. Usually read in with `fs.readFile()`. #### options +Type: `object` + ##### width ##### height -Type: `string` `number` +Type: `string | number` The width and height are given as a number followed by a unit, or the word "auto". @@ -166,7 +168,7 @@ The width and height are given as a number followed by a unit, or the word "auto Type: `boolean`
Default: `true` -### iTerm.setCwd([path]) +### iTerm.setCwd(path?) Type: `string`
Default: `process.cwd()` @@ -179,6 +181,14 @@ Default: `process.cwd()` - [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal -## License +--- -MIT © [Sindre Sorhus](https://sindresorhus.com) +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/index.js b/tools/node_modules/eslint/node_modules/ansi-regex/index.js index c4aaecf5050639..c25448009f304d 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-regex/index.js @@ -1,10 +1,14 @@ 'use strict'; -module.exports = () => { +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); - return new RegExp(pattern, 'g'); + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); }; diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/ansi-regex/package.json index d4df7d97af4f3f..db8f3cc8c7d14e 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-regex/package.json @@ -11,11 +11,11 @@ "deprecated": false, "description": "Regular expression for matching ANSI escape codes", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^0.25.0", + "xo": "^0.23.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -58,5 +58,5 @@ "test": "xo && ava", "view-supported": "node fixtures/view-codes.js" }, - "version": "3.0.0" + "version": "4.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md index 22db1c34055556..d19c44667e704b 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md @@ -2,6 +2,20 @@ > Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + ## Install @@ -23,9 +37,31 @@ ansiRegex().test('cake'); '\u001B[4mcake\u001B[0m'.match(ansiRegex()); //=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] ``` +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + ## FAQ ### Why do you test for codes not in the ECMA 48 standard? @@ -35,6 +71,11 @@ Some of the codes we run as a test are codes that we acquired finding various li On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/index.js b/tools/node_modules/eslint/node_modules/cli-cursor/index.js index 6284a8289642e6..710c4051742f52 100644 --- a/tools/node_modules/eslint/node_modules/cli-cursor/index.js +++ b/tools/node_modules/eslint/node_modules/cli-cursor/index.js @@ -1,39 +1,35 @@ 'use strict'; const restoreCursor = require('restore-cursor'); -let hidden = false; +let isHidden = false; -exports.show = stream => { - const s = stream || process.stderr; - - if (!s.isTTY) { +exports.show = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { return; } - hidden = false; - s.write('\u001b[?25h'); + isHidden = false; + writableStream.write('\u001B[?25h'); }; -exports.hide = stream => { - const s = stream || process.stderr; - - if (!s.isTTY) { +exports.hide = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { return; } restoreCursor(); - hidden = true; - s.write('\u001b[?25l'); + isHidden = true; + writableStream.write('\u001B[?25l'); }; -exports.toggle = (force, stream) => { +exports.toggle = (force, writableStream) => { if (force !== undefined) { - hidden = force; + isHidden = force; } - if (hidden) { - exports.show(stream); + if (isHidden) { + exports.show(writableStream); } else { - exports.hide(stream); + exports.hide(writableStream); } }; diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/license b/tools/node_modules/eslint/node_modules/cli-cursor/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/cli-cursor/license +++ b/tools/node_modules/eslint/node_modules/cli-cursor/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/package.json b/tools/node_modules/eslint/node_modules/cli-cursor/package.json index 44efffe03b4e66..f67104cccbd246 100644 --- a/tools/node_modules/eslint/node_modules/cli-cursor/package.json +++ b/tools/node_modules/eslint/node_modules/cli-cursor/package.json @@ -9,19 +9,22 @@ }, "bundleDependencies": false, "dependencies": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" }, "deprecated": false, "description": "Toggle the CLI cursor", "devDependencies": { - "ava": "*", - "xo": "*" + "@types/node": "^12.0.7", + "ava": "^2.1.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/cli-cursor#readme", "keywords": [ @@ -46,10 +49,7 @@ "url": "git+https://github.com/sindresorhus/cli-cursor.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "2.1.0", - "xo": { - "esnext": true - } + "version": "3.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/readme.md b/tools/node_modules/eslint/node_modules/cli-cursor/readme.md index 75c18e5fea8108..3478ac80e54fce 100644 --- a/tools/node_modules/eslint/node_modules/cli-cursor/readme.md +++ b/tools/node_modules/eslint/node_modules/cli-cursor/readme.md @@ -8,7 +8,7 @@ The cursor is [gracefully restored](https://github.com/sindresorhus/restore-curs ## Install ``` -$ npm install --save cli-cursor +$ npm install cli-cursor ``` @@ -26,20 +26,30 @@ cliCursor.toggle(unicornsAreAwesome); ## API -### .show([stream]) +### .show(stream?) -### .hide([stream]) +### .hide(stream?) -### .toggle(force, [stream]) +### .toggle(force?, stream?) -`force` is useful to show or hide the cursor based on a boolean. +#### force + +Useful for showing or hiding the cursor based on a boolean. #### stream -Type: `Stream`
+Type: `stream.Writable`
Default: `process.stderr` -## License +--- -MIT © [Sindre Sorhus](https://sindresorhus.com) +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/README.md b/tools/node_modules/eslint/node_modules/emoji-regex/README.md index 37cf14e01f72a5..f10e1733350471 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/README.md +++ b/tools/node_modules/eslint/node_modules/emoji-regex/README.md @@ -2,7 +2,7 @@ _emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. -This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. ## Installation diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js index 0216db95876da0..b4cf3dcd389935 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js +++ b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js @@ -2,5 +2,5 @@ module.exports = () => { // https://mths.be/emoji - return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; }; diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js index d0a771d36e487f..780309df58f1a2 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js +++ b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js @@ -2,5 +2,5 @@ module.exports = () => { // https://mths.be/emoji - return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; }; diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/index.js b/tools/node_modules/eslint/node_modules/emoji-regex/index.js index e2237a4e805327..d993a3a99cb95a 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/index.js +++ b/tools/node_modules/eslint/node_modules/emoji-regex/index.js @@ -2,5 +2,5 @@ module.exports = function () { // https://mths.be/emoji - return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/package.json b/tools/node_modules/eslint/node_modules/emoji-regex/package.json index 439b65e4354d5c..eecc5eb318cd0a 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/package.json +++ b/tools/node_modules/eslint/node_modules/emoji-regex/package.json @@ -10,14 +10,13 @@ "deprecated": false, "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "mocha": "^5.2.0", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", "regexgen": "^1.3.0", - "unicode-11.0.0": "^0.7.7", - "unicode-tr51": "^9.0.1" + "unicode-12.0.0": "^0.7.9" }, "files": [ "LICENSE-MIT.txt", @@ -51,5 +50,5 @@ "test:watch": "npm run test -- --watch" }, "types": "index.d.ts", - "version": "7.0.3" + "version": "8.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/text.js b/tools/node_modules/eslint/node_modules/emoji-regex/text.js index 199ae3be35b418..0a55ce2f2308ad 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/text.js +++ b/tools/node_modules/eslint/node_modules/emoji-regex/text.js @@ -2,5 +2,5 @@ module.exports = function () { // https://mths.be/emoji - return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md index aa5e2b8ff7bac6..22f5099b65cccd 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md @@ -32,42 +32,46 @@ eslint --ext md . It will lint `js`, `javascript`, `jsx`, or `node` [fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks) in your Markdown documents: - ```js - // This gets linted - var answer = 6 * 7; - console.log(answer); - ``` +````markdown +```js +// This gets linted +var answer = 6 * 7; +console.log(answer); +``` - ```JavaScript - // This also gets linted +```JavaScript +// This also gets linted - /* eslint quotes: [2, "double"] */ +/* eslint quotes: [2, "double"] */ - function hello() { - console.log("Hello, world!"); - } - hello(); - ``` +function hello() { + console.log("Hello, world!"); +} +hello(); +``` - ```jsx - // This gets linted too - var div =
; - ``` +```jsx +// This gets linted too +var div =
; +``` - ```node - // And this - console.log(process.version); - ``` +```node +// And this +console.log(process.version); +``` +```` Blocks that don't specify either `js`, `javascript`, `jsx`, or `node` syntax are ignored: - ``` - This is plain text and doesn't get linted. - ``` +````markdown +``` +This is plain text and doesn't get linted. +``` - ```python - print("This doesn't get linted either.") - ``` +```python +print("This doesn't get linted either.") +``` +```` ## Configuration Comments @@ -75,52 +79,58 @@ The processor will convert HTML comments immediately preceding a code block into This example enables the `browser` environment, disables the `no-alert` rule, and configures the `quotes` rule to prefer single quotes: - - - +````markdown + + + - ```js - alert('Hello, world!'); - ``` +```js +alert('Hello, world!'); +``` +```` Each code block in a file is linted separately, so configuration comments apply only to the code block that immediately follows. - Assuming `no-alert` is enabled in `.eslintrc`, the first code block will have no error from `no-alert`: +````markdown +Assuming `no-alert` is enabled in `.eslintrc`, the first code block will have no error from `no-alert`: - - + + - ```js - alert("Hello, world!"); - ``` +```js +alert("Hello, world!"); +``` - But the next code block will have an error from `no-alert`: +But the next code block will have an error from `no-alert`: - + - ```js - alert("Hello, world!"); - ``` +```js +alert("Hello, world!"); +``` +```` ## Skipping Blocks Sometimes it can be useful to have code blocks marked with `js` even though they don't contain valid JavaScript syntax, such as commented JSON blobs that need `js` syntax highlighting. Standard `eslint-disable` comments only silence rule reporting, but ESLint still reports any syntax errors it finds. In cases where a code block should not even be parsed, insert a non-standard `` comment before the block, and this plugin will hide the following block from ESLint. Neither rule nor syntax errors will be reported. - There are comments in this JSON, so we use `js` syntax for better - highlighting. Skip the block to prevent warnings about invalid syntax. +````markdown +There are comments in this JSON, so we use `js` syntax for better +highlighting. Skip the block to prevent warnings about invalid syntax. - + - ```js - { - // This code block is hidden from ESLint. - "hello": "world" - } - ``` +```js +{ + // This code block is hidden from ESLint. + "hello": "world" +} +``` - ```js - console.log("This code block is linted normally."); - ``` +```js +console.log("This code block is linted normally."); +``` +```` ## Fix issues automatically diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js index 890425ff8aefa0..e27aa162f98cb0 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js @@ -5,10 +5,10 @@ "use strict"; -var processor = require("./processor"); +const processor = require("./processor"); module.exports = { - "processors": { + processors: { ".markdown": processor, ".mdown": processor, ".mkdn": processor, diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js index a3c9e06da2852e..8efcc55b9a698a 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js @@ -5,37 +5,35 @@ "use strict"; -var assign = require("object-assign"); -var unified = require("unified"); -var remarkParse = require("remark-parse"); +const assign = require("object-assign"); +const unified = require("unified"); +const remarkParse = require("remark-parse"); -var SUPPORTED_SYNTAXES = ["js", "javascript", "node", "jsx"]; -var UNSATISFIABLE_RULES = [ +const SUPPORTED_SYNTAXES = ["js", "javascript", "node", "jsx"]; +const UNSATISFIABLE_RULES = [ "eol-last", // The Markdown parser strips trailing newlines in code fences "unicode-bom" // Code blocks will begin in the middle of Markdown files ]; -var SUPPORTS_AUTOFIX = true; +const SUPPORTS_AUTOFIX = true; -var markdown = unified().use(remarkParse); +const markdown = unified().use(remarkParse); -var blocks = []; +let blocks = []; /** * Performs a depth-first traversal of the Markdown AST. * @param {ASTNode} node A Markdown AST node. - * @param {object} callbacks A map of node types to callbacks. - * @param {object} [parent] The node's parent AST node. + * @param {Object} callbacks A map of node types to callbacks. + * @param {Object} [parent] The node's parent AST node. * @returns {void} */ function traverse(node, callbacks, parent) { - var i; - if (callbacks[node.type]) { callbacks[node.type](node, parent); } if (typeof node.children !== "undefined") { - for (i = 0; i < node.children.length; i++) { + for (let i = 0; i < node.children.length; i++) { traverse(node.children[i], callbacks, node); } } @@ -47,9 +45,9 @@ function traverse(node, callbacks, parent) { * @returns {string[]} An array of JS block comments. */ function getComment(html) { - var commentStart = ""; - var regex = /^(eslint\b|global\s)/; + const commentStart = ""; + const regex = /^(eslint\b|global\s)/; if ( html.slice(0, commentStart.length) !== commentStart || @@ -58,16 +56,42 @@ function getComment(html) { return ""; } - html = html.slice(commentStart.length, -commentEnd.length); + const comment = html.slice(commentStart.length, -commentEnd.length); - if (!regex.test(html.trim())) { + if (!regex.test(comment.trim())) { return ""; } - return html; + return comment; } -var leadingWhitespaceRegex = /^\s*/; +// Before a code block, blockquote characters (`>`) are also considered +// "whitespace". +const leadingWhitespaceRegex = /^[>\s]*/; + +/** + * Gets the offset for the first column of the node's first line in the + * original source text. + * @param {ASTNode} node A Markdown code block AST node. + * @returns {number} The offset for the first column of the node's first line. + */ +function getBeginningOfLineOffset(node) { + return node.position.start.offset - node.position.start.column + 1; +} + +/** + * Gets the leading text, typically whitespace with possible blockquote chars, + * used to indent a code block. + * @param {string} text The text of the file. + * @param {ASTNode} node A Markdown code block AST node. + * @returns {string} The text from the start of the first line to the opening + * fence of the code block. + */ +function getIndentText(text, node) { + return leadingWhitespaceRegex.exec( + text.slice(getBeginningOfLineOffset(node)) + )[0]; +} /** * When applying fixes, the postprocess step needs to know how to map fix ranges @@ -97,24 +121,12 @@ var leadingWhitespaceRegex = /^\s*/; * @param {ASTNode} node A Markdown code block AST node. * @param {comments} comments List of configuration comment strings that will be * inserted at the beginning of the code block. - * @returns {object[]} A list of offset-based adjustments, where lookups are + * @returns {Object[]} A list of offset-based adjustments, where lookups are * done based on the `js` key, which represents the range in the linted JS, * and the `md` key is the offset delta that, when added to the JS range, * returns the corresponding location in the original Markdown source. */ function getBlockRangeMap(text, node, comments) { - var baseIndent, - code, - commentLength, - i, - jsOffset, - leadingWhitespaceLength, - line, - lines, - mdOffset, - rangeMap, - startOffset, - trimLength; /* * The parser sets the fenced code block's start offset to wherever content @@ -124,14 +136,14 @@ function getBlockRangeMap(text, node, comments) { * additional indenting, the opening fence's first backtick may be up to * three whitespace characters after the start offset. */ - startOffset = node.position.start.offset; + const startOffset = getBeginningOfLineOffset(node); /* * Extract the Markdown source to determine the leading whitespace for each * line. */ - code = text.slice(startOffset, node.position.end.offset); - lines = code.split("\n"); + const code = text.slice(startOffset, node.position.end.offset); + const lines = code.split("\n"); /* * The parser trims leading whitespace from each line of code within the @@ -139,16 +151,13 @@ function getBlockRangeMap(text, node, comments) { * backtick's column is the AST node's starting column plus any additional * indentation. */ - baseIndent = node.position.start.column - 1 - + leadingWhitespaceRegex.exec(lines[0])[0].length; + const baseIndent = getIndentText(text, node).length; /* * Track the length of any inserted configuration comments at the beginning * of the linted JS and start the JS offset lookup keys at this index. */ - commentLength = comments.reduce(function(len, comment) { - return len + comment.length + 1; - }, 0); + const commentLength = comments.reduce((len, comment) => len + comment.length + 1, 0); /* * In case there are configuration comments, initialize the map so that the @@ -156,35 +165,37 @@ function getBlockRangeMap(text, node, comments) { * the lookup index will also be 0, and the lookup should always go to the * last range that matches, skipping this initialization entry. */ - rangeMap = [{ + const rangeMap = [{ js: 0, md: 0 }]; // Start the JS offset after any configuration comments. - jsOffset = commentLength; + let jsOffset = commentLength; /* * Start the Markdown offset at the beginning of the block's first line of * actual code. The first line of the block is always the opening fence, so * the code begins on the second line. */ - mdOffset = startOffset + lines[0].length + 1; + let mdOffset = startOffset + lines[0].length + 1; /* * For each line, determine how much leading whitespace was trimmed due to * indentation. Increase the JS lookup offset by the length of the line * post-trimming and the Markdown offset by the total line length. */ - for (i = 0; i + 1 < lines.length; i++) { - line = lines[i + 1]; - leadingWhitespaceLength = leadingWhitespaceRegex.exec(line)[0].length; + for (let i = 0; i + 1 < lines.length; i++) { + const line = lines[i + 1]; + const leadingWhitespaceLength = leadingWhitespaceRegex.exec(line)[0].length; + // The parser trims leading whitespace up to the level of the opening // fence, so keep any additional indentation beyond that. - trimLength = Math.min(baseIndent, leadingWhitespaceLength); + const trimLength = Math.min(baseIndent, leadingWhitespaceLength); rangeMap.push({ js: jsOffset, + // Advance `trimLength` character from the beginning of the Markdown // line to the beginning of the equivalent JS line, then compute the // delta. @@ -196,6 +207,7 @@ function getBlockRangeMap(text, node, comments) { mdOffset += line.length + 1; jsOffset += line.length - trimLength + 1; } + return rangeMap; } @@ -205,19 +217,19 @@ function getBlockRangeMap(text, node, comments) { * @returns {string[]} Source code strings to lint. */ function preprocess(text) { - var ast = markdown.parse(text); + const ast = markdown.parse(text); blocks = []; traverse(ast, { - "code": function(node, parent) { - var comments = []; - var index, previousNode, comment; + code(node, parent) { + const comments = []; if (node.lang && SUPPORTED_SYNTAXES.indexOf(node.lang.split(" ")[0].toLowerCase()) >= 0) { - index = parent.children.indexOf(node) - 1; - previousNode = parent.children[index]; + let index = parent.children.indexOf(node) - 1; + let previousNode = parent.children[index]; + while (previousNode && previousNode.type === "html") { - comment = getComment(previousNode.value); + const comment = getComment(previousNode.value); if (!comment) { break; @@ -227,35 +239,36 @@ function preprocess(text) { return; } - comments.unshift("/*" + comment + "*/"); + comments.unshift(`/*${comment}*/`); index--; previousNode = parent.children[index]; } blocks.push(assign({}, node, { - comments: comments, + baseIndentText: getIndentText(text, node), + comments, rangeMap: getBlockRangeMap(text, node, comments) })); } } }); - return blocks.map(function(block) { - return block.comments.concat(block.value).concat("").join("\n"); - }); + return blocks.map(block => [ + ...block.comments, + block.value, + "" + ].join("\n")); } /** * Creates a map function that adjusts messages in a code block. * @param {Block} block A code block. - * @returns {function} A function that adjusts messages in a code block. + * @returns {Function} A function that adjusts messages in a code block. */ function adjustBlock(block) { - var leadingCommentLines = block.comments.reduce(function(count, comment) { - return count + comment.split("\n").length; - }, 0); + const leadingCommentLines = block.comments.reduce((count, comment) => count + comment.split("\n").length, 0); - var blockStart = block.position.start.line; + const blockStart = block.position.start.line; /** * Adjusts ESLint messages to point to the correct location in the Markdown. @@ -264,34 +277,38 @@ function adjustBlock(block) { */ return function adjustMessage(message) { - var lineInCode = message.line - leadingCommentLines; - var endLine = message.endLine - leadingCommentLines; + const lineInCode = message.line - leadingCommentLines; + const endLine = message.endLine - leadingCommentLines; + if (lineInCode < 1) { return null; } - var out = { + const out = { line: lineInCode + blockStart, endLine: endLine ? endLine + blockStart : endLine, column: message.column + block.position.indent[lineInCode - 1] - 1 }; - var adjustedFix = {}; + const adjustedFix = {}; + if (message.fix) { adjustedFix.fix = { - range: message.fix.range.map(function(range) { + range: message.fix.range.map(range => { + // Advance through the block's range map to find the last // matching range by finding the first range too far and // then going back one. - var i = 1; - while (i < block.rangeMap.length && block.rangeMap[i].js < range) { + let i = 1; + + while (i < block.rangeMap.length && block.rangeMap[i].js <= range) { i++; } // Apply the mapping delta for this range. return range + block.rangeMap[i - 1].md; }), - text: message.fix.text + text: message.fix.text.replace("\n", `\n${block.baseIndentText}`) }; } @@ -315,14 +332,15 @@ function excludeUnsatisfiableRules(message) { * @returns {Message[]} A flattened array of messages with mapped locations. */ function postprocess(messages) { - return [].concat.apply([], messages.map(function(group, i) { - var adjust = adjustBlock(blocks[i]); + return [].concat(...messages.map((group, i) => { + const adjust = adjustBlock(blocks[i]); + return group.map(adjust).filter(excludeUnsatisfiableRules); })); } module.exports = { - preprocess: preprocess, - postprocess: postprocess, + preprocess, + postprocess, supportsAutofix: SUPPORTS_AUTOFIX }; diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json index 2fb0406aa2e89d..93aa90513db2a8 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json @@ -17,7 +17,8 @@ "devDependencies": { "chai": "^3.0.0", "eslint": "^4.19.1", - "eslint-config-eslint": "^3.0.0", + "eslint-config-eslint": "^5.0.1", + "eslint-plugin-node": "^6.0.1", "eslint-release": "^1.0.0", "istanbul": "^0.4.5", "mocha": "^2.2.5" @@ -55,5 +56,5 @@ "test": "npm run lint && npm run test-cov", "test-cov": "istanbul cover _mocha -- -c tests/lib/**/*.js" }, - "version": "1.0.0" + "version": "1.0.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/README.md b/tools/node_modules/eslint/node_modules/eslint-utils/README.md index 7069f04f7392a9..03583806246467 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/README.md +++ b/tools/node_modules/eslint/node_modules/eslint-utils/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) [![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) -[![Build Status](https://travis-ci.org/mysticatea/eslint-utils.svg?branch=master)](https://travis-ci.org/mysticatea/eslint-utils) +[![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) [![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) [![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) @@ -12,13 +12,13 @@ This package provides utility functions and classes for make ESLint custom rules For examples: -- [getStaticValue](https://mysticatea.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST. -- [PatternMatcher](https://mysticatea.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class) finds a regular expression pattern as handling escape sequences. -- [ReferenceTracker](https://mysticatea.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. +- [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [PatternMatcher](https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class) finds a regular expression pattern as handling escape sequences. +- [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. ## 📖 Usage -See [documentation](https://mysticatea.github.io/eslint-utils/). +See [documentation](https://eslint-utils.mysticatea.dev/). ## 📰 Changelog diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/index.js b/tools/node_modules/eslint/node_modules/eslint-utils/index.js index 7805b05ef36290..f5d3f3e6097d2f 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/index.js +++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.js @@ -240,7 +240,18 @@ function getFunctionHeadLocation(node, sourceCode) { } } -/* globals BigInt */ +/* globals BigInt, globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; const builtinNames = Object.freeze( new Set([ @@ -316,13 +327,13 @@ const callAllowed = new Set( Number.parseFloat, Number.parseInt, Object, - Object.entries, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.entries, Object.is, Object.isExtensible, Object.isFrozen, Object.isSealed, Object.keys, - Object.values, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.values, parseFloat, parseInt, RegExp, @@ -534,9 +545,9 @@ const operations = Object.freeze({ variable != null && variable.defs.length === 0 && builtinNames.has(variable.name) && - variable.name in global + variable.name in globalObject ) { - return { value: global[variable.name] } + return { value: globalObject[variable.name] } } // Constants. @@ -1287,7 +1298,6 @@ class PatternMatcher { } } -const SENTINEL_TYPE = /^(?:.+?Statement|.+?Declaration|(?:Array|ArrowFunction|Assignment|Call|Class|Function|Member|New|Object)Expression|AssignmentPattern|Program|VariableDeclarator)$/u; const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; const has = Function.call.bind(Object.hasOwnProperty); @@ -1311,6 +1321,28 @@ function isModifiedGlobal(variable) { ) } +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + + default: + return false + } +} + /** * The reference tracker. */ @@ -1447,11 +1479,11 @@ class ReferenceTracker { esm ? nextTraceMap : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } + ? Object.assign( + { default: nextTraceMap }, + nextTraceMap + ) + : { default: nextTraceMap } ); if (esm) { @@ -1512,7 +1544,7 @@ class ReferenceTracker { //eslint-disable-next-line complexity *_iteratePropertyReferences(rootNode, path, traceMap) { let node = rootNode; - while (!SENTINEL_TYPE.test(node.parent.type)) { + while (isPassThrough(node)) { node = node.parent; } diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs b/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs index 2e6391e9b321e0..4b2a20edf5f077 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs +++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs @@ -234,7 +234,18 @@ function getFunctionHeadLocation(node, sourceCode) { } } -/* globals BigInt */ +/* globals BigInt, globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; const builtinNames = Object.freeze( new Set([ @@ -310,13 +321,13 @@ const callAllowed = new Set( Number.parseFloat, Number.parseInt, Object, - Object.entries, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.entries, Object.is, Object.isExtensible, Object.isFrozen, Object.isSealed, Object.keys, - Object.values, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.values, parseFloat, parseInt, RegExp, @@ -528,9 +539,9 @@ const operations = Object.freeze({ variable != null && variable.defs.length === 0 && builtinNames.has(variable.name) && - variable.name in global + variable.name in globalObject ) { - return { value: global[variable.name] } + return { value: globalObject[variable.name] } } // Constants. @@ -1281,7 +1292,6 @@ class PatternMatcher { } } -const SENTINEL_TYPE = /^(?:.+?Statement|.+?Declaration|(?:Array|ArrowFunction|Assignment|Call|Class|Function|Member|New|Object)Expression|AssignmentPattern|Program|VariableDeclarator)$/u; const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; const has = Function.call.bind(Object.hasOwnProperty); @@ -1305,6 +1315,28 @@ function isModifiedGlobal(variable) { ) } +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + + default: + return false + } +} + /** * The reference tracker. */ @@ -1441,11 +1473,11 @@ class ReferenceTracker { esm ? nextTraceMap : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } + ? Object.assign( + { default: nextTraceMap }, + nextTraceMap + ) + : { default: nextTraceMap } ); if (esm) { @@ -1506,7 +1538,7 @@ class ReferenceTracker { //eslint-disable-next-line complexity *_iteratePropertyReferences(rootNode, path, traceMap) { let node = rootNode; - while (!SENTINEL_TYPE.test(node.parent.type)) { + while (isPassThrough(node)) { node = node.parent; } diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/package.json index bbade790ea5f1a..5b9b668f293690 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/package.json @@ -7,24 +7,25 @@ }, "bundleDependencies": false, "dependencies": { - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.1.0" }, "deprecated": false, "description": "Utilities for ESLint plugins.", "devDependencies": { - "@mysticatea/eslint-plugin": "^10.0.3", - "codecov": "^3.0.2", + "@mysticatea/eslint-plugin": "^12.0.0", + "codecov": "^3.6.1", "dot-prop": "^4.2.0", - "eslint": "^5.16.0", - "esm": "^3.0.55", - "espree": "^5.0.1", - "mocha": "^5.2.0", - "nyc": "^13.0.1", - "opener": "^1.4.3", - "rimraf": "^2.6.2", - "rollup": "^1.16.7", + "eslint": "^6.5.1", + "esm": "^3.2.25", + "espree": "^6.1.1", + "mocha": "^6.2.2", + "npm-run-all": "^4.1.5", + "nyc": "^14.1.1", + "opener": "^1.5.1", + "rimraf": "^3.0.0", + "rollup": "^1.25.0", "rollup-plugin-sourcemaps": "^0.4.2", - "vuepress": "^0.14.4", + "vuepress": "^1.2.0", "warun": "^1.0.0" }, "engines": { @@ -49,18 +50,18 @@ "build": "rollup -c", "clean": "rimraf .nyc_output coverage index.*", "codecov": "nyc report -r lcovonly && codecov", - "coverage": "nyc report -r lcov && opener ./coverage/lcov-report/index.html", + "coverage": "opener ./coverage/lcov-report/index.html", "docs:build": "vuepress build docs", "docs:watch": "vuepress dev docs", "lint": "eslint src test", "postversion": "git push && git push --tags", "prebuild": "npm run -s clean", - "pretest": "npm run -s lint && npm run -s build", "preversion": "npm test && npm run -s build", "prewatch": "npm run -s clean", - "test": "nyc mocha --reporter dot \"test/*.js\"", - "watch": "warun \"{src,test}/**/*.js\" -- nyc --reporter lcov mocha --reporter dot \"test/*.js\"" + "test": "run-s lint build test:mocha", + "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", + "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" }, "sideEffects": false, - "version": "1.4.2" + "version": "1.4.3" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/espree/lib/espree.js b/tools/node_modules/eslint/node_modules/espree/lib/espree.js index cd362e71a04a5d..9fd035ebe8f968 100644 --- a/tools/node_modules/eslint/node_modules/espree/lib/espree.js +++ b/tools/node_modules/eslint/node_modules/espree/lib/espree.js @@ -1,15 +1,11 @@ "use strict"; /* eslint-disable no-param-reassign*/ -const acorn = require("acorn"); -const jsx = require("acorn-jsx"); const TokenTranslator = require("./token-translator"); const DEFAULT_ECMA_VERSION = 5; const STATE = Symbol("espree's internal state"); const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); -const tokTypes = Object.assign({}, acorn.tokTypes, jsx.tokTypes); - /** * Normalize ECMAScript version from the initial config @@ -111,238 +107,246 @@ function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, return comment; } -module.exports = () => Parser => class Espree extends Parser { - constructor(opts, code) { - if (typeof opts !== "object" || opts === null) { - opts = {}; - } - if (typeof code !== "string" && !(code instanceof String)) { - code = String(code); - } - - const options = normalizeOptions(opts); - const ecmaFeatures = options.ecmaFeatures || {}; - const tokenTranslator = - options.tokens === true - ? new TokenTranslator(tokTypes, code) - : null; +module.exports = () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); - // Initialize acorn parser. - super({ - - // TODO: use {...options} when spread is supported(Node.js >= 8.3.0). - ecmaVersion: options.ecmaVersion, - sourceType: options.sourceType, - ranges: options.ranges, - locations: options.locations, - - // Truthy value is true for backward compatibility. - allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } - // Collect tokens - onToken: token => { - if (tokenTranslator) { + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } - // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. - tokenTranslator.onToken(token, this[STATE]); + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + // Initialize acorn parser. + super({ + + // TODO: use {...options} when spread is supported(Node.js >= 8.3.0). + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), + + // Collect tokens + onToken: token => { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, this[STATE]); + } + if (token.type !== tokTypes.eof) { + this[STATE].lastToken = token; + } + }, + + // Collect comments + onComment: (block, text, start, end, startLoc, endLoc) => { + if (this[STATE].comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); + + this[STATE].comments.push(comment); + } } - if (token.type !== tokTypes.eof) { - this[STATE].lastToken = token; - } - }, + }, code); + + // Initialize internal state. + this[STATE] = { + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, + ecmaVersion: this.options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null + }; + } - // Collect comments - onComment: (block, text, start, end, startLoc, endLoc) => { - if (this[STATE].comments) { - const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); - this[STATE].comments.push(comment); - } - } - }, code); - - // Initialize internal state. - this[STATE] = { - tokens: tokenTranslator ? [] : null, - comments: options.comment === true ? [] : null, - impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, - ecmaVersion: this.options.ecmaVersion, - jsxAttrValueToken: false, - lastToken: null - }; - } - - tokenize() { - do { + // Consume the final eof token this.next(); - } while (this.type !== tokTypes.eof); - // Consume the final eof token - this.next(); + const extra = this[STATE]; + const tokens = extra.tokens; - const extra = this[STATE]; - const tokens = extra.tokens; + if (extra.comments) { + tokens.comments = extra.comments; + } - if (extra.comments) { - tokens.comments = extra.comments; + return tokens; } - return tokens; - } + finishNode(...args) { + const result = super.finishNode(...args); - finishNode(...args) { - const result = super.finishNode(...args); + return this[ESPRIMA_FINISH_NODE](result); + } - return this[ESPRIMA_FINISH_NODE](result); - } + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); - finishNodeAt(...args) { - const result = super.finishNodeAt(...args); + return this[ESPRIMA_FINISH_NODE](result); + } - return this[ESPRIMA_FINISH_NODE](result); - } + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = this.options.sourceType; - parse() { - const extra = this[STATE]; - const program = super.parse(); + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } - program.sourceType = this.options.sourceType; + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.range) { + program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; + program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1]; + } + if (program.loc) { + program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; + program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end; + } - if (extra.comments) { - program.comments = extra.comments; + return program; } - if (extra.tokens) { - program.tokens = extra.tokens; + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); } - /* - * Adjust opening and closing position of program to match Esprima. - * Acorn always starts programs at range 0 whereas Esprima starts at the - * first AST node's start (the only real difference is when there's leading - * whitespace or leading comments). Acorn also counts trailing whitespace - * as part of the program whereas Esprima only counts up to the last token. + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} */ - if (program.range) { - program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; - program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1]; - } - if (program.loc) { - program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; - program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end; + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; } - return program; - } - - parseTopLevel(node) { - if (this[STATE].impliedStrict) { - this.strict = true; + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); } - return super.parseTopLevel(node); - } - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raise(pos, message) { - const loc = acorn.getLineInfo(this.input, pos); - const err = new SyntaxError(message); - - err.index = pos; - err.lineNumber = loc.line; - err.column = loc.column + 1; // acorn uses 0-based columns - throw err; - } + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; - /** - * Overwrites the default raise method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @param {string} message The error message. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - raiseRecoverable(pos, message) { - this.raise(pos, message); - } + if (pos !== null && pos !== void 0) { + this.pos = pos; - /** - * Overwrites the default unexpected method to throw Esprima-style errors. - * @param {int} pos The position of the error. - * @throws {SyntaxError} A syntax error. - * @returns {void} - */ - unexpected(pos) { - let message = "Unexpected token"; - - if (pos !== null && pos !== void 0) { - this.pos = pos; - - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } } + + this.nextToken(); } - this.nextToken(); - } + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } - if (this.end > this.start) { - message += ` ${this.input.slice(this.start, this.end)}`; + this.raise(this.start, message); } - this.raise(this.start, message); - } - - /* - * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX - * uses regular tt.string without any distinction between this and regular JS - * strings. As such, we intercept an attempt to read a JSX string and set a flag - * on extra so that when tokens are converted, the next token will be switched - * to JSXText via onToken. - */ - jsx_readString(quote) { // eslint-disable-line camelcase - const result = super.jsx_readString(quote); - - if (this.type === tokTypes.string) { - this[STATE].jsxAttrValueToken = true; + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; } - return result; - } - /** - * Performs last-minute Esprima-specific compatibility checks and fixes. - * @param {ASTNode} result The node to check. - * @returns {ASTNode} The finished node. - */ - [ESPRIMA_FINISH_NODE](result) { + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { - // Acorn doesn't count the opening and closing backticks as part of templates - // so we have to adjust ranges/locations appropriately. - if (result.type === "TemplateElement") { + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { - // additional adjustment needed if ${ is the last token - const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; + // additional adjustment needed if ${ is the last token + const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; - if (result.range) { - result.range[0]--; - result.range[1] += (terminalDollarBraceL ? 2 : 1); + if (result.range) { + result.range[0]--; + result.range[1] += (terminalDollarBraceL ? 2 : 1); + } + + if (result.loc) { + result.loc.start.column--; + result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + } } - if (result.loc) { - result.loc.start.column--; - result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + if (result.type.indexOf("Function") > -1 && !result.generator) { + result.generator = false; } - } - if (result.type.indexOf("Function") > -1 && !result.generator) { - result.generator = false; + return result; } - - return result; - } + }; }; diff --git a/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json index 0a3460432a26b6..17d49f6e22af56 100644 --- a/tools/node_modules/eslint/node_modules/espree/package.json +++ b/tools/node_modules/eslint/node_modules/espree/package.json @@ -8,8 +8,8 @@ }, "bundleDependencies": false, "dependencies": { - "acorn": "^7.0.0", - "acorn-jsx": "^5.0.2", + "acorn": "^7.1.0", + "acorn-jsx": "^5.1.0", "eslint-visitor-keys": "^1.1.0" }, "deprecated": false, @@ -66,5 +66,5 @@ "publish-release": "eslint-publish-release", "test": "npm run-script lint && node Makefile.js test" }, - "version": "6.1.1" + "version": "6.1.2" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/figures/index.js b/tools/node_modules/eslint/node_modules/figures/index.js index c01148ccb1507a..10bd6edba0693f 100644 --- a/tools/node_modules/eslint/node_modules/figures/index.js +++ b/tools/node_modules/eslint/node_modules/figures/index.js @@ -1,7 +1,7 @@ 'use strict'; const escapeStringRegexp = require('escape-string-regexp'); -const platform = process.platform; +const {platform} = process; const main = { tick: '✔', @@ -31,6 +31,7 @@ const main = { smiley: '㋡', mustache: '෴', heart: '♥', + nodejs: '⬢', arrowUp: '↑', arrowDown: '↓', arrowLeft: '←', @@ -62,7 +63,7 @@ const main = { sevenEighths: '⅞' }; -const win = { +const windows = { tick: '√', cross: '×', star: '*', @@ -90,6 +91,7 @@ const win = { smiley: '☺', mustache: '┌─┐', heart: main.heart, + nodejs: '♦', arrowUp: main.arrowUp, arrowDown: main.arrowDown, arrowLeft: main.arrowLeft, @@ -122,26 +124,26 @@ const win = { }; if (platform === 'linux') { - // the main one doesn't look that good on Ubuntu + // The main one doesn't look that good on Ubuntu main.questionMarkPrefix = '?'; } -const figures = platform === 'win32' ? win : main; +const figures = platform === 'win32' ? windows : main; -const fn = str => { +const fn = string => { if (figures === main) { - return str; + return string; } - Object.keys(main).forEach(key => { - if (main[key] === figures[key]) { - return; + for (const [key, value] of Object.entries(main)) { + if (value === figures[key]) { + continue; } - str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]); - }); + string = string.replace(new RegExp(escapeStringRegexp(value), 'g'), figures[key]); + } - return str; + return string; }; module.exports = Object.assign(fn, figures); diff --git a/tools/node_modules/eslint/node_modules/figures/license b/tools/node_modules/eslint/node_modules/figures/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/figures/license +++ b/tools/node_modules/eslint/node_modules/figures/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/figures/package.json b/tools/node_modules/eslint/node_modules/figures/package.json index 65f9a9fd5c0efc..b84bc46481a942 100644 --- a/tools/node_modules/eslint/node_modules/figures/package.json +++ b/tools/node_modules/eslint/node_modules/figures/package.json @@ -14,16 +14,18 @@ "deprecated": false, "description": "Unicode symbols with Windows CMD fallbacks", "devDependencies": { - "ava": "*", - "markdown-table": "^1.0.0", - "require-uncached": "^1.0.2", - "xo": "*" + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "markdown-table": "^1.1.2", + "tsd": "^0.7.2", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/figures#readme", "keywords": [ @@ -32,7 +34,6 @@ "cmd", "command-line", "characters", - "char", "symbol", "symbols", "figure", @@ -47,10 +48,7 @@ }, "scripts": { "make": "./makefile.js", - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "2.0.0", - "xo": { - "esnext": true - } + "version": "3.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/figures/readme.md b/tools/node_modules/eslint/node_modules/figures/readme.md index 628703a0a7e110..cf537009acb0e1 100644 --- a/tools/node_modules/eslint/node_modules/figures/readme.md +++ b/tools/node_modules/eslint/node_modules/figures/readme.md @@ -1,4 +1,4 @@ -# figures [![Build Status: Linux](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/mb743hl70269be3r/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/figures/branch/master) +# figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) > Unicode symbols with Windows CMD fallbacks @@ -12,7 +12,7 @@ Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki ## Install ``` -$ npm install --save figures +$ npm install figures ``` @@ -35,17 +35,17 @@ console.log(figures.tick); ## API -### figures(input) +### figures(string) -Returns the input with replaced fallback unicode symbols on Windows. +Returns the input with replaced fallback Unicode symbols on Windows. All the below [figures](#figures) are attached to the main export as shown in the example above. -#### input +#### string Type: `string` -String where the unicode symbols will be replaced with fallback symbols depending on the OS. +String where the Unicode symbols will be replaced with fallback symbols depending on the OS. ## Figures @@ -79,6 +79,7 @@ String where the unicode symbols will be replaced with fallback symbols dependin | smiley | ㋡ | ☺ | | mustache | ෴ | ┌─┐ | | heart | ♥ | ♥ | +| nodejs | ⬢ | ♦ | | arrowUp | ↑ | ↑ | | arrowDown | ↓ | ↓ | | arrowLeft | ← | ← | @@ -115,6 +116,14 @@ String where the unicode symbols will be replaced with fallback symbols dependin - [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels -## License +--- -MIT © [Sindre Sorhus](https://sindresorhus.com) +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/node_modules/eslint/node_modules/glob/README.md b/tools/node_modules/eslint/node_modules/glob/README.md index e71b967ea28809..0916a48255cd6f 100644 --- a/tools/node_modules/eslint/node_modules/glob/README.md +++ b/tools/node_modules/eslint/node_modules/glob/README.md @@ -371,3 +371,5 @@ npm run bench # to profile javascript npm run prof ``` + +![](oh-my-glob.gif) diff --git a/tools/node_modules/eslint/node_modules/glob/package.json b/tools/node_modules/eslint/node_modules/glob/package.json index fca34f2f998d21..cf2be43974e853 100644 --- a/tools/node_modules/eslint/node_modules/glob/package.json +++ b/tools/node_modules/eslint/node_modules/glob/package.json @@ -49,5 +49,5 @@ "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "version": "7.1.4" + "version": "7.1.5" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/inquirer/README.md b/tools/node_modules/eslint/node_modules/inquirer/README.md index 00183582c48455..fe3326fd7448fb 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/README.md +++ b/tools/node_modules/eslint/node_modules/inquirer/README.md @@ -1,11 +1,5 @@ Inquirer Logo -# Compat Version # - -This version is branched from Inquirer master branch to maintain support for Node 6. - -See latest version release line at https://github.com/SBoudrias/Inquirer.js - # Inquirer.js [![npm](https://badge.fury.io/js/inquirer.svg)](http://badge.fury.io/js/inquirer) [![tests](https://travis-ci.org/SBoudrias/Inquirer.js.svg?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) [![Coverage Status](https://codecov.io/gh/SBoudrias/Inquirer.js/branch/master/graph/badge.svg)](https://codecov.io/gh/SBoudrias/Inquirer.js) [![dependencies](https://david-dm.org/SBoudrias/Inquirer.js.svg?theme=shields.io)](https://david-dm.org/SBoudrias/Inquirer.js) @@ -364,7 +358,7 @@ look at issues found on other command line - feel free to report any! -Please refer to the [Github releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases) +Please refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases) ## Contributing diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js index 3d6c7d81130032..1fee1d2f305965 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js @@ -122,7 +122,7 @@ class CheckboxPrompt extends Base { onEnd(state) { this.status = 'answered'; - + this.spaceKeyPressed = true; // Rerender prompt (and clean subline error) this.render(); diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/utils/events.js b/tools/node_modules/eslint/node_modules/inquirer/lib/utils/events.js index 2a0734b5afed32..966d146cff91b5 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/utils/events.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/utils/events.js @@ -1,6 +1,6 @@ 'use strict'; var { fromEvent } = require('rxjs'); -var { filter, map, share } = require('rxjs/operators'); +var { filter, map, share, takeUntil } = require('rxjs/operators'); function normalizeKeypressEvents(value, key) { return { value: value, key: key || {} }; @@ -8,6 +8,7 @@ function normalizeKeypressEvents(value, key) { module.exports = function(rl) { var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents) + .pipe(takeUntil(fromEvent(rl, 'close'))) // Ignore `enter` key. On the readline, we only care about the `line` event. .pipe(filter(({ key }) => key.name !== 'enter' && key.name !== 'return')); diff --git a/tools/node_modules/eslint/node_modules/inquirer/package.json b/tools/node_modules/eslint/node_modules/inquirer/package.json index 9c1a62d2773fe9..a3efb9cb4b2d35 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/package.json +++ b/tools/node_modules/eslint/node_modules/inquirer/package.json @@ -8,17 +8,17 @@ }, "bundleDependencies": false, "dependencies": { - "ansi-escapes": "^3.2.0", + "ansi-escapes": "^4.2.1", "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", "run-async": "^2.2.0", "rxjs": "^6.4.0", - "string-width": "^2.1.0", + "string-width": "^4.1.0", "strip-ansi": "^5.1.0", "through": "^2.3.6" }, @@ -28,10 +28,10 @@ "chai": "^4.2.0", "chalk-pipe": "^2.0.0", "cmdify": "^0.0.4", - "mocha": "^5.0.0", + "mocha": "^6.2.0", "mockery": "^2.1.0", - "nyc": "^13.1.0", - "sinon": "^7.1.1" + "nyc": "^14.1.1", + "sinon": "^7.4.1" }, "engines": { "node": ">=6.0.0" @@ -40,7 +40,7 @@ "lib", "README.md" ], - "gitHead": "7d87f666042c67638d2e89bd4586d22f61e90130", + "gitHead": "be4558e0314afcd3852361929397588744a745d8", "homepage": "https://github.com/SBoudrias/Inquirer.js#readme", "keywords": [ "command", @@ -63,5 +63,5 @@ "prepublishOnly": "cp ../../README.md .", "test": "nyc mocha test/**/* -r ./test/before" }, - "version": "6.5.2" + "version": "7.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js index d506327c3e5576..671f97f7607790 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js @@ -1,42 +1,43 @@ -'use strict'; /* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { +'use strict'; + +const isFullwidthCodePoint = codePoint => { + if (Number.isNaN(codePoint)) { return false; } - // code points are derived from: + // Code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + codePoint >= 0x1100 && ( + codePoint <= 0x115F || // Hangul Jamo + codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET + codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || + (0x3250 <= codePoint && codePoint <= 0x4DBF) || // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || + (0x4E00 <= codePoint && codePoint <= 0xA4C6) || // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || + (0xA960 <= codePoint && codePoint <= 0xA97C) || // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || + (0xF900 <= codePoint && codePoint <= 0xFAFF) || // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || + (0xFE10 <= codePoint && codePoint <= 0xFE19) || // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || + (0xFE30 <= codePoint && codePoint <= 0xFE6B) || // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || + (0x1B000 <= codePoint && codePoint <= 0x1B001) || // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || + (0x1F200 <= codePoint && codePoint <= 0x1F251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) + (0x20000 <= codePoint && codePoint <= 0x3FFFD) ) ) { return true; @@ -44,3 +45,6 @@ module.exports = x => { return false; }; + +module.exports = isFullwidthCodePoint; +module.exports.default = isFullwidthCodePoint; diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json index 5db53104f21a75..c556c1c78dd459 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json @@ -11,14 +11,16 @@ "deprecated": false, "description": "Check if the character represented by a given Unicode code point is fullwidth", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", "keywords": [ @@ -28,9 +30,7 @@ "width", "unicode", "character", - "char", "string", - "str", "codepoint", "code", "point", @@ -45,10 +45,7 @@ "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd-check" }, - "version": "2.0.0", - "xo": { - "esnext": true - } + "version": "3.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md index 093b0281b2c46b..4236bba980d8fe 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md @@ -6,7 +6,7 @@ ## Install ``` -$ npm install --save is-fullwidth-code-point +$ npm install is-fullwidth-code-point ``` @@ -15,23 +15,23 @@ $ npm install --save is-fullwidth-code-point ```js const isFullwidthCodePoint = require('is-fullwidth-code-point'); -isFullwidthCodePoint('谢'.codePointAt()); +isFullwidthCodePoint('谢'.codePointAt(0)); //=> true -isFullwidthCodePoint('a'.codePointAt()); +isFullwidthCodePoint('a'.codePointAt(0)); //=> false ``` ## API -### isFullwidthCodePoint(input) +### isFullwidthCodePoint(codePoint) -#### input +#### codePoint Type: `number` -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. +The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. ## License diff --git a/tools/node_modules/eslint/node_modules/mimic-fn/index.js b/tools/node_modules/eslint/node_modules/mimic-fn/index.js index 08e69d3d88f020..1a597051750da2 100644 --- a/tools/node_modules/eslint/node_modules/mimic-fn/index.js +++ b/tools/node_modules/eslint/node_modules/mimic-fn/index.js @@ -1,9 +1,13 @@ 'use strict'; -module.exports = (to, from) => { - // TODO: use `Reflect.ownKeys()` when targeting Node.js 6 - for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) { + +const mimicFn = (to, from) => { + for (const prop of Reflect.ownKeys(from)) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } return to; }; + +module.exports = mimicFn; +// TODO: Remove this for the next major release +module.exports.default = mimicFn; diff --git a/tools/node_modules/eslint/node_modules/mimic-fn/package.json b/tools/node_modules/eslint/node_modules/mimic-fn/package.json index 28e9bebe29b3f6..cc764d1d2ee7b6 100644 --- a/tools/node_modules/eslint/node_modules/mimic-fn/package.json +++ b/tools/node_modules/eslint/node_modules/mimic-fn/package.json @@ -11,14 +11,16 @@ "deprecated": false, "description": "Make a function mimic another one", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/mimic-fn#readme", "keywords": [ @@ -43,7 +45,7 @@ "url": "git+https://github.com/sindresorhus/mimic-fn.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "1.2.0" + "version": "2.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/mimic-fn/readme.md b/tools/node_modules/eslint/node_modules/mimic-fn/readme.md index e57573438997b1..0ef8a13d7e0d95 100644 --- a/tools/node_modules/eslint/node_modules/mimic-fn/readme.md +++ b/tools/node_modules/eslint/node_modules/mimic-fn/readme.md @@ -21,7 +21,7 @@ function foo() {} foo.unicorn = '🦄'; function wrapper() { - return foo() {}; + return foo(); } console.log(wrapper.name); @@ -43,7 +43,7 @@ It will copy over the properties `name`, `length`, `displayName`, and any custom ### mimicFn(to, from) -It will modify `to` and return it. +Modifies the `to` function and returns it. #### to @@ -61,6 +61,7 @@ Function to mimic. ## Related - [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function +- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties ## License diff --git a/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33508.json b/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33508.json deleted file mode 100644 index 9e26dfeeb6e641..00000000000000 --- a/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33508.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33510.json b/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33510.json deleted file mode 100644 index 1d04442328beff..00000000000000 --- a/tools/node_modules/eslint/node_modules/mute-stream/.nyc_output/33510.json +++ /dev/null @@ -1 +0,0 @@ -{"./mute.js":{"path":"./mute.js","s":{"1":1,"2":1,"3":1,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":7,"12":1,"13":1,"14":1,"15":10,"16":1,"17":6,"18":1,"19":1,"20":5,"21":1,"22":1,"23":8,"24":1,"25":2,"26":1,"27":5,"28":1,"29":5,"30":1,"31":2,"32":2,"33":1,"34":2,"35":2,"36":1,"37":2,"38":2,"39":1,"40":25,"41":13,"42":5,"43":8,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":8,"51":0,"52":0,"53":0,"54":8,"55":20,"56":1,"57":2,"58":2,"59":0,"60":2,"61":2,"62":0,"63":2,"64":1,"65":3,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":1,"73":1,"74":1},"b":{"1":[7,5],"2":[7,7],"3":[3,5],"4":[3,2],"5":[4,1],"6":[0,1],"7":[4,1],"8":[0,1],"9":[2,0],"10":[2,0],"11":[13,12],"12":[5,8],"13":[0,8],"14":[0,0],"15":[0,8],"16":[8,0,0],"17":[2,0],"18":[0,2],"19":[2,1],"20":[0,2],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0]},"f":{"1":7,"2":10,"3":6,"4":5,"5":8,"6":2,"7":5,"8":5,"9":2,"10":2,"11":2,"12":25,"13":2,"14":3,"15":0},"fnMap":{"1":{"name":"MuteStream","line":7,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}}},"2":{"name":"(anonymous_2)","line":29,"loc":{"start":{"line":29,"column":28},"end":{"line":29,"column":40}}},"3":{"name":"(anonymous_3)","line":33,"loc":{"start":{"line":33,"column":30},"end":{"line":33,"column":42}}},"4":{"name":"onPipe","line":44,"loc":{"start":{"line":44,"column":0},"end":{"line":44,"column":22}}},"5":{"name":"getIsTTY","line":55,"loc":{"start":{"line":55,"column":0},"end":{"line":55,"column":21}}},"6":{"name":"setIsTTY","line":63,"loc":{"start":{"line":63,"column":0},"end":{"line":63,"column":26}}},"7":{"name":"(anonymous_7)","line":73,"loc":{"start":{"line":73,"column":7},"end":{"line":73,"column":19}}},"8":{"name":"(anonymous_8)","line":80,"loc":{"start":{"line":80,"column":7},"end":{"line":80,"column":19}}},"9":{"name":"(anonymous_9)","line":87,"loc":{"start":{"line":87,"column":28},"end":{"line":87,"column":53}}},"10":{"name":"(anonymous_10)","line":92,"loc":{"start":{"line":92,"column":29},"end":{"line":92,"column":41}}},"11":{"name":"(anonymous_11)","line":96,"loc":{"start":{"line":96,"column":30},"end":{"line":96,"column":42}}},"12":{"name":"(anonymous_12)","line":100,"loc":{"start":{"line":100,"column":29},"end":{"line":100,"column":42}}},"13":{"name":"(anonymous_13)","line":124,"loc":{"start":{"line":124,"column":27},"end":{"line":124,"column":40}}},"14":{"name":"proxy","line":136,"loc":{"start":{"line":136,"column":0},"end":{"line":136,"column":20}}},"15":{"name":"(anonymous_15)","line":136,"loc":{"start":{"line":136,"column":29},"end":{"line":136,"column":41}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}},"3":{"start":{"line":7,"column":0},"end":{"line":20,"column":1}},"4":{"start":{"line":8,"column":2},"end":{"line":8,"column":20}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":19}},"6":{"start":{"line":10,"column":2},"end":{"line":10,"column":38}},"7":{"start":{"line":11,"column":2},"end":{"line":11,"column":20}},"8":{"start":{"line":12,"column":2},"end":{"line":12,"column":31}},"9":{"start":{"line":13,"column":2},"end":{"line":13,"column":29}},"10":{"start":{"line":18,"column":2},"end":{"line":18,"column":36}},"11":{"start":{"line":19,"column":2},"end":{"line":19,"column":26}},"12":{"start":{"line":22,"column":0},"end":{"line":22,"column":54}},"13":{"start":{"line":24,"column":0},"end":{"line":27,"column":2}},"14":{"start":{"line":29,"column":0},"end":{"line":31,"column":1}},"15":{"start":{"line":30,"column":2},"end":{"line":30,"column":19}},"16":{"start":{"line":33,"column":0},"end":{"line":35,"column":1}},"17":{"start":{"line":34,"column":2},"end":{"line":34,"column":20}},"18":{"start":{"line":37,"column":0},"end":{"line":42,"column":2}},"19":{"start":{"line":44,"column":0},"end":{"line":46,"column":1}},"20":{"start":{"line":45,"column":2},"end":{"line":45,"column":17}},"21":{"start":{"line":48,"column":0},"end":{"line":53,"column":2}},"22":{"start":{"line":55,"column":0},"end":{"line":60,"column":1}},"23":{"start":{"line":56,"column":2},"end":{"line":59,"column":9}},"24":{"start":{"line":63,"column":0},"end":{"line":70,"column":1}},"25":{"start":{"line":64,"column":2},"end":{"line":69,"column":4}},"26":{"start":{"line":72,"column":0},"end":{"line":77,"column":44}},"27":{"start":{"line":74,"column":4},"end":{"line":76,"column":23}},"28":{"start":{"line":79,"column":0},"end":{"line":84,"column":44}},"29":{"start":{"line":81,"column":4},"end":{"line":83,"column":23}},"30":{"start":{"line":87,"column":0},"end":{"line":90,"column":1}},"31":{"start":{"line":88,"column":2},"end":{"line":88,"column":19}},"32":{"start":{"line":89,"column":2},"end":{"line":89,"column":56}},"33":{"start":{"line":92,"column":0},"end":{"line":94,"column":1}},"34":{"start":{"line":93,"column":2},"end":{"line":93,"column":41}},"35":{"start":{"line":93,"column":17},"end":{"line":93,"column":41}},"36":{"start":{"line":96,"column":0},"end":{"line":98,"column":1}},"37":{"start":{"line":97,"column":2},"end":{"line":97,"column":42}},"38":{"start":{"line":97,"column":17},"end":{"line":97,"column":42}},"39":{"start":{"line":100,"column":0},"end":{"line":122,"column":1}},"40":{"start":{"line":101,"column":2},"end":{"line":120,"column":3}},"41":{"start":{"line":102,"column":4},"end":{"line":102,"column":34}},"42":{"start":{"line":102,"column":23},"end":{"line":102,"column":34}},"43":{"start":{"line":103,"column":4},"end":{"line":119,"column":5}},"44":{"start":{"line":104,"column":6},"end":{"line":108,"column":7}},"45":{"start":{"line":105,"column":8},"end":{"line":105,"column":42}},"46":{"start":{"line":106,"column":8},"end":{"line":106,"column":42}},"47":{"start":{"line":107,"column":8},"end":{"line":107,"column":29}},"48":{"start":{"line":109,"column":6},"end":{"line":109,"column":29}},"49":{"start":{"line":110,"column":6},"end":{"line":110,"column":33}},"50":{"start":{"line":112,"column":6},"end":{"line":117,"column":7}},"51":{"start":{"line":114,"column":8},"end":{"line":114,"column":32}},"52":{"start":{"line":115,"column":8},"end":{"line":115,"column":39}},"53":{"start":{"line":116,"column":8},"end":{"line":116,"column":41}},"54":{"start":{"line":118,"column":6},"end":{"line":118,"column":50}},"55":{"start":{"line":121,"column":2},"end":{"line":121,"column":22}},"56":{"start":{"line":124,"column":0},"end":{"line":134,"column":1}},"57":{"start":{"line":125,"column":2},"end":{"line":131,"column":3}},"58":{"start":{"line":126,"column":4},"end":{"line":130,"column":5}},"59":{"start":{"line":127,"column":6},"end":{"line":127,"column":50}},"60":{"start":{"line":129,"column":6},"end":{"line":129,"column":14}},"61":{"start":{"line":132,"column":2},"end":{"line":132,"column":29}},"62":{"start":{"line":132,"column":9},"end":{"line":132,"column":29}},"63":{"start":{"line":133,"column":2},"end":{"line":133,"column":18}},"64":{"start":{"line":136,"column":0},"end":{"line":141,"column":2}},"65":{"start":{"line":136,"column":22},"end":{"line":141,"column":1}},"66":{"start":{"line":137,"column":2},"end":{"line":137,"column":20}},"67":{"start":{"line":138,"column":2},"end":{"line":138,"column":19}},"68":{"start":{"line":139,"column":2},"end":{"line":139,"column":43}},"69":{"start":{"line":139,"column":18},"end":{"line":139,"column":43}},"70":{"start":{"line":140,"column":2},"end":{"line":140,"column":43}},"71":{"start":{"line":140,"column":18},"end":{"line":140,"column":43}},"72":{"start":{"line":143,"column":0},"end":{"line":143,"column":47}},"73":{"start":{"line":144,"column":0},"end":{"line":144,"column":55}},"74":{"start":{"line":145,"column":0},"end":{"line":145,"column":43}}},"branchMap":{"1":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":9},"end":{"line":9,"column":13}},{"start":{"line":9,"column":17},"end":{"line":9,"column":19}}]},"2":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":17},"end":{"line":18,"column":28}},{"start":{"line":18,"column":32},"end":{"line":18,"column":36}}]},"3":{"line":56,"type":"cond-expr","locations":[{"start":{"line":56,"column":25},"end":{"line":56,"column":41}},{"start":{"line":57,"column":10},"end":{"line":58,"column":15}}]},"4":{"line":57,"type":"cond-expr","locations":[{"start":{"line":57,"column":24},"end":{"line":57,"column":39}},{"start":{"line":58,"column":10},"end":{"line":58,"column":15}}]},"5":{"line":74,"type":"cond-expr","locations":[{"start":{"line":74,"column":25},"end":{"line":74,"column":40}},{"start":{"line":75,"column":12},"end":{"line":76,"column":21}}]},"6":{"line":75,"type":"cond-expr","locations":[{"start":{"line":75,"column":24},"end":{"line":75,"column":38}},{"start":{"line":76,"column":12},"end":{"line":76,"column":21}}]},"7":{"line":81,"type":"cond-expr","locations":[{"start":{"line":81,"column":25},"end":{"line":81,"column":43}},{"start":{"line":82,"column":12},"end":{"line":83,"column":21}}]},"8":{"line":82,"type":"cond-expr","locations":[{"start":{"line":82,"column":24},"end":{"line":82,"column":41}},{"start":{"line":83,"column":12},"end":{"line":83,"column":21}}]},"9":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":2},"end":{"line":93,"column":2}},{"start":{"line":93,"column":2},"end":{"line":93,"column":2}}]},"10":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":2},"end":{"line":97,"column":2}},{"start":{"line":97,"column":2},"end":{"line":97,"column":2}}]},"11":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":2},"end":{"line":101,"column":2}},{"start":{"line":101,"column":2},"end":{"line":101,"column":2}}]},"12":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":4},"end":{"line":102,"column":4}},{"start":{"line":102,"column":4},"end":{"line":102,"column":4}}]},"13":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":4},"end":{"line":103,"column":4}},{"start":{"line":103,"column":4},"end":{"line":103,"column":4}}]},"14":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":6},"end":{"line":104,"column":6}},{"start":{"line":104,"column":6},"end":{"line":104,"column":6}}]},"15":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":6},"end":{"line":112,"column":6}},{"start":{"line":112,"column":6},"end":{"line":112,"column":6}}]},"16":{"line":112,"type":"binary-expr","locations":[{"start":{"line":112,"column":10},"end":{"line":112,"column":22}},{"start":{"line":112,"column":26},"end":{"line":112,"column":42}},{"start":{"line":113,"column":10},"end":{"line":113,"column":39}}]},"17":{"line":125,"type":"if","locations":[{"start":{"line":125,"column":2},"end":{"line":125,"column":2}},{"start":{"line":125,"column":2},"end":{"line":125,"column":2}}]},"18":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":4},"end":{"line":126,"column":4}},{"start":{"line":126,"column":4},"end":{"line":126,"column":4}}]},"19":{"line":126,"type":"binary-expr","locations":[{"start":{"line":126,"column":8},"end":{"line":126,"column":9}},{"start":{"line":126,"column":13},"end":{"line":126,"column":25}}]},"20":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":2},"end":{"line":132,"column":2}},{"start":{"line":132,"column":2},"end":{"line":132,"column":2}}]},"21":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":2},"end":{"line":139,"column":2}},{"start":{"line":139,"column":2},"end":{"line":139,"column":2}}]},"22":{"line":139,"type":"binary-expr","locations":[{"start":{"line":139,"column":6},"end":{"line":139,"column":7}},{"start":{"line":139,"column":11},"end":{"line":139,"column":16}}]},"23":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":2},"end":{"line":140,"column":2}},{"start":{"line":140,"column":2},"end":{"line":140,"column":2}}]},"24":{"line":140,"type":"binary-expr","locations":[{"start":{"line":140,"column":6},"end":{"line":140,"column":7}},{"start":{"line":140,"column":11},"end":{"line":140,"column":16}}]}}}} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/mute-stream/package.json b/tools/node_modules/eslint/node_modules/mute-stream/package.json index 8a5981780d27c5..a5839c56bb2567 100644 --- a/tools/node_modules/eslint/node_modules/mute-stream/package.json +++ b/tools/node_modules/eslint/node_modules/mute-stream/package.json @@ -11,11 +11,14 @@ "deprecated": false, "description": "Bytes go in, but they don't come out (when muted).", "devDependencies": { - "tap": "^5.4.4" + "tap": "^12.1.1" }, "directories": { "test": "test" }, + "files": [ + "mute.js" + ], "homepage": "https://github.com/isaacs/mute-stream#readme", "keywords": [ "mute", @@ -32,5 +35,5 @@ "scripts": { "test": "tap test/*.js --cov" }, - "version": "0.0.7" + "version": "0.0.8" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/onetime/index.js b/tools/node_modules/eslint/node_modules/onetime/index.js index 0d76476b0b6307..a3f412af1b4869 100644 --- a/tools/node_modules/eslint/node_modules/onetime/index.js +++ b/tools/node_modules/eslint/node_modules/onetime/index.js @@ -1,39 +1,50 @@ 'use strict'; const mimicFn = require('mimic-fn'); -module.exports = (fn, opts) => { - // TODO: Remove this in v3 - if (opts === true) { - throw new TypeError('The second argument is now an options object'); - } +const calledFunctions = new WeakMap(); +const oneTime = (fn, options = {}) => { if (typeof fn !== 'function') { throw new TypeError('Expected a function'); } - opts = opts || {}; - let ret; - let called = false; - const fnName = fn.displayName || fn.name || ''; + let isCalled = false; + let callCount = 0; + const functionName = fn.displayName || fn.name || ''; - const onetime = function () { - if (called) { - if (opts.throw === true) { - throw new Error(`Function \`${fnName}\` can only be called once`); + const onetime = function (...args) { + calledFunctions.set(onetime, ++callCount); + + if (isCalled) { + if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); } return ret; } - called = true; - ret = fn.apply(this, arguments); + isCalled = true; + ret = fn.apply(this, args); fn = null; return ret; }; mimicFn(onetime, fn); + calledFunctions.set(onetime, callCount); return onetime; }; + +module.exports = oneTime; +// TODO: Remove this for the next major release +module.exports.default = oneTime; + +module.exports.callCount = fn => { + if (!calledFunctions.has(fn)) { + throw new Error(`The given function \`${fn.name}\` is not wrapped by the \`onetime\` package`); + } + + return calledFunctions.get(fn); +}; diff --git a/tools/node_modules/eslint/node_modules/onetime/license b/tools/node_modules/eslint/node_modules/onetime/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/onetime/license +++ b/tools/node_modules/eslint/node_modules/onetime/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/onetime/package.json b/tools/node_modules/eslint/node_modules/onetime/package.json index c448600d33de99..3b9293f2b5884d 100644 --- a/tools/node_modules/eslint/node_modules/onetime/package.json +++ b/tools/node_modules/eslint/node_modules/onetime/package.json @@ -9,19 +9,21 @@ }, "bundleDependencies": false, "dependencies": { - "mimic-fn": "^1.0.0" + "mimic-fn": "^2.1.0" }, "deprecated": false, "description": "Ensure a function is only called once", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/onetime#readme", "keywords": [ @@ -43,7 +45,7 @@ "url": "git+https://github.com/sindresorhus/onetime.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "2.0.1" + "version": "5.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/onetime/readme.md b/tools/node_modules/eslint/node_modules/onetime/readme.md index 95eb3b7c9e1c44..9ecd1b24db12d7 100644 --- a/tools/node_modules/eslint/node_modules/onetime/readme.md +++ b/tools/node_modules/eslint/node_modules/onetime/readme.md @@ -4,29 +4,35 @@ When called multiple times it will return the return value from the first call. -*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty extending `Function.prototype`.* +*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty and extending `Function.prototype`.* ## Install ``` -$ npm install --save onetime +$ npm install onetime ``` ## Usage ```js +const onetime = require('onetime'); + let i = 0; -const foo = onetime(() => i++); +const foo = onetime(() => ++i); foo(); //=> 0 foo(); //=> 0 foo(); //=> 0 + +onetime.callCount(foo); //=> 3 ``` ```js +const onetime = require('onetime'); + const foo = onetime(() => {}, {throw: true}); foo(); @@ -59,6 +65,29 @@ Default: `false` Throw an error when called more than once. +### onetime.callCount(fn) + +Returns a number representing how many times `fn` has been called. + +Note: It throws an error if you pass in a function that is not wrapped by `onetime`. + +```js +const foo = onetime(() => {}); + +foo(); +foo(); +foo(); + +console.log(onetime.callCount(foo)); +//=> 3 +``` + +#### fn + +Type: `Function` + +Function to get call count from. + ## License diff --git a/tools/node_modules/eslint/node_modules/restore-cursor/index.js b/tools/node_modules/eslint/node_modules/restore-cursor/index.js index 2b8e009883cb9b..3e8dd07dc3d661 100644 --- a/tools/node_modules/eslint/node_modules/restore-cursor/index.js +++ b/tools/node_modules/eslint/node_modules/restore-cursor/index.js @@ -4,6 +4,6 @@ const signalExit = require('signal-exit'); module.exports = onetime(() => { signalExit(() => { - process.stderr.write('\u001b[?25h'); + process.stderr.write('\u001B[?25h'); }, {alwaysLast: true}); }); diff --git a/tools/node_modules/eslint/node_modules/restore-cursor/license b/tools/node_modules/eslint/node_modules/restore-cursor/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/restore-cursor/license +++ b/tools/node_modules/eslint/node_modules/restore-cursor/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/restore-cursor/package.json b/tools/node_modules/eslint/node_modules/restore-cursor/package.json index a764f365980e72..5f0ba05592d886 100644 --- a/tools/node_modules/eslint/node_modules/restore-cursor/package.json +++ b/tools/node_modules/eslint/node_modules/restore-cursor/package.json @@ -9,16 +9,21 @@ }, "bundleDependencies": false, "dependencies": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "deprecated": false, "description": "Gracefully restore the CLI cursor on exit", + "devDependencies": { + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/restore-cursor#readme", "keywords": [ @@ -49,5 +54,8 @@ "type": "git", "url": "git+https://github.com/sindresorhus/restore-cursor.git" }, - "version": "2.0.0" + "scripts": { + "test": "xo && tsd" + }, + "version": "3.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/restore-cursor/readme.md b/tools/node_modules/eslint/node_modules/restore-cursor/readme.md index a2f5afbc540bf3..c224a2904cc9bd 100644 --- a/tools/node_modules/eslint/node_modules/restore-cursor/readme.md +++ b/tools/node_modules/eslint/node_modules/restore-cursor/readme.md @@ -1,4 +1,4 @@ -# restore-cursor +# restore-cursor [![Build Status](https://travis-ci.org/sindresorhus/restore-cursor.svg?branch=master)](https://travis-ci.org/sindresorhus/restore-cursor) > Gracefully restore the CLI cursor on exit @@ -8,7 +8,7 @@ Prevent the cursor you've hidden interactively from remaining hidden if the proc ## Install ``` -$ npm install --save restore-cursor +$ npm install restore-cursor ``` @@ -16,6 +16,7 @@ $ npm install --save restore-cursor ```js const restoreCursor = require('restore-cursor'); + restoreCursor(); ``` diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..d506327c3e5576 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/license b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..5db53104f21a75 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,54 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..093b0281b2c46b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/string-width/index.js b/tools/node_modules/eslint/node_modules/string-width/index.js index bbc49d29b156c3..a348067f032dfc 100644 --- a/tools/node_modules/eslint/node_modules/string-width/index.js +++ b/tools/node_modules/eslint/node_modules/string-width/index.js @@ -1,18 +1,21 @@ 'use strict'; const stripAnsi = require('strip-ansi'); const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { +const stringWidth = string => { + string = string.replace(emojiRegex(), ' '); + + if (typeof string !== 'string' || string.length === 0) { return 0; } - str = stripAnsi(str); + string = stripAnsi(string); let width = 0; - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); // Ignore control characters if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { @@ -34,3 +37,7 @@ module.exports = str => { return width; }; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/index.js b/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/index.js deleted file mode 100644 index 96e0292c8e2f64..00000000000000 --- a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/package.json deleted file mode 100644 index 472b3021ed8201..00000000000000 --- a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/readme.md b/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/readme.md deleted file mode 100644 index dc76f0cb1a0595..00000000000000 --- a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/tools/node_modules/eslint/node_modules/string-width/package.json b/tools/node_modules/eslint/node_modules/string-width/package.json index f076208ad38fa1..9ef5253e54d49b 100644 --- a/tools/node_modules/eslint/node_modules/string-width/package.json +++ b/tools/node_modules/eslint/node_modules/string-width/package.json @@ -9,27 +9,28 @@ }, "bundleDependencies": false, "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^5.2.0" }, "deprecated": false, "description": "Get the visual width of a string - the number of columns required to display it", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=8" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/string-width#readme", "keywords": [ "string", - "str", "character", - "char", "unicode", "width", "visual", @@ -58,7 +59,7 @@ "url": "git+https://github.com/sindresorhus/string-width.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "2.1.1" + "version": "4.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/string-width/readme.md b/tools/node_modules/eslint/node_modules/string-width/readme.md index df5b7199f90913..35a0c0377a900d 100644 --- a/tools/node_modules/eslint/node_modules/string-width/readme.md +++ b/tools/node_modules/eslint/node_modules/string-width/readme.md @@ -19,14 +19,14 @@ $ npm install string-width ```js const stringWidth = require('string-width'); +stringWidth('a'); +//=> 1 + stringWidth('古'); //=> 2 -stringWidth('\u001b[1m古\u001b[22m'); +stringWidth('\u001B[1m古\u001B[22m'); //=> 2 - -stringWidth('a'); -//=> 1 ``` diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index c25448009f304d..00000000000000 --- a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = options => { - options = Object.assign({ - onlyFirst: false - }, options); - - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); -}; diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/license b/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index db8f3cc8c7d14e..00000000000000 --- a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "^0.25.0", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "4.1.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index d19c44667e704b..00000000000000 --- a/tools/node_modules/eslint/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex([options]) - -Returns a regex for matching ANSI escape codes. - -#### options - -##### onlyFirst - -Type: `boolean`
-Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 00000000000000..a41e0a7ef970ec --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/README.md new file mode 100644 index 00000000000000..37cf14e01f72a5 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 00000000000000..0216db95876da0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/text.js b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 00000000000000..d0a771d36e487f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/index.js new file mode 100644 index 00000000000000..e2237a4e805327 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/package.json new file mode 100644 index 00000000000000..439b65e4354d5c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/package.json @@ -0,0 +1,55 @@ +{ + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/emoji-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "mocha": "^5.2.0", + "regexgen": "^1.3.0", + "unicode-11.0.0": "^0.7.7", + "unicode-tr51": "^9.0.1" + }, + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "homepage": "https://mths.be/emoji-regex", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "main": "index.js", + "name": "emoji-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/mathiasbynens/emoji-regex.git" + }, + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "types": "index.d.ts", + "version": "7.0.3" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/text.js b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/text.js new file mode 100644 index 00000000000000..199ae3be35b418 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..d506327c3e5576 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/license b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..5db53104f21a75 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,54 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/readme.md b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..093b0281b2c46b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/license b/tools/node_modules/eslint/node_modules/type-fest/license similarity index 100% rename from tools/node_modules/eslint/node_modules/string-width/node_modules/strip-ansi/license rename to tools/node_modules/eslint/node_modules/type-fest/license diff --git a/tools/node_modules/eslint/node_modules/type-fest/package.json b/tools/node_modules/eslint/node_modules/type-fest/package.json new file mode 100644 index 00000000000000..a5a398048dc370 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/type-fest/package.json @@ -0,0 +1,59 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/type-fest/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A collection of essential TypeScript types", + "devDependencies": { + "@sindresorhus/tsconfig": "^0.3.0", + "@typescript-eslint/eslint-plugin": "^1.8.0", + "eslint-config-xo-typescript": "^0.11.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.d.ts", + "source" + ], + "homepage": "https://github.com/sindresorhus/type-fest#readme", + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "license": "(MIT OR CC0-1.0)", + "name": "type-fest", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/type-fest.git" + }, + "scripts": { + "test": "xo && tsd" + }, + "version": "0.5.2", + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/type-fest/readme.md b/tools/node_modules/eslint/node_modules/type-fest/readme.md new file mode 100644 index 00000000000000..3f11c3c1edb6c3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/type-fest/readme.md @@ -0,0 +1,118 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![Build Status](https://travis-ci.com/sindresorhus/type-fest.svg?branch=master)](https://travis-ci.com/sindresorhus/type-fest) +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.2* + + +## Usage + +```ts +import {Omit} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Omit; +//=> {unicorn: string} +``` + + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Omit`](source/omit.d.ts) - Create a type from an object type without certain keys. +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` properties into a mutable object. Inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive properties. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given properties. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of a `object`/`Map`/`Set`/`Array` type. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). + + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. + + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. + +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) + + +## License + +(MIT OR CC0-1.0) diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index b57c88bc36455b..93da0c92fd0cc2 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -17,11 +17,11 @@ "cross-spawn": "^6.0.5", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-plugin-markdown": "^1.0.0", + "eslint-plugin-markdown": "^1.0.1", "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.2", + "eslint-utils": "^1.4.3", "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.1", + "espree": "^6.1.2", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -31,7 +31,7 @@ "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.4.1", + "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", @@ -55,7 +55,7 @@ "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", - "acorn": "^7.0.0", + "acorn": "^7.1.0", "babel-loader": "^8.0.5", "chai": "^4.0.1", "cheerio": "^0.22.0", @@ -149,7 +149,8 @@ "perf": "node Makefile.js perf", "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test", + "test:cli": "mocha", "webpack": "node Makefile.js webpack" }, - "version": "6.5.1" + "version": "6.6.0" } \ No newline at end of file From d05f67caef17342d1cec6f01e81f616ee1935604 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 23 Oct 2019 11:06:57 -0700 Subject: [PATCH 32/65] cli: whitelist new V8 flag in NODE_OPTIONS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly whitelists --disallow-code-generation-from-strings in NODE_OPTIONS as a new V8 flag. This flag prevents strings like eval() from performing code generation. PR-URL: https://github.com/nodejs/node/pull/30094 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Gireesh Punathil Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/cli.md | 10 ++++++++++ doc/node.1 | 5 +++++ src/node_options.cc | 4 ++++ test/parallel/test-cli-node-options.js | 1 + 4 files changed, 20 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 2830f90358370c..d9d7d3ad5e7365 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -127,6 +127,15 @@ added: v12.0.0 Specify the file name of the CPU profile generated by `--cpu-prof`. +### `--disallow-code-generation-from-strings` + + +Make built-in language features like `eval` and `new Function` that generate +code from strings throw an exception instead. This does not affect the Node.js +`vm` module. + ### `--enable-fips` * `--abort-on-uncaught-exception` +* `--disallow-code-generation-from-strings` * `--interpreted-frames-native-stack` * `--max-old-space-size` * `--perf-basic-prof-only-functions` diff --git a/doc/node.1 b/doc/node.1 index 9af077fc96b4dc..e9b7855b9be483 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -100,6 +100,11 @@ The default is File name of the V8 CPU profile generated with .Fl -cpu-prof . +.It Fl -disallow-code-generation-from-strings +Make built-in language features like `eval` and `new Function` that generate +code from strings throw an exception instead. This does not affect the Node.js +`vm` module. +. .It Fl -enable-fips Enable FIPS-compliant crypto at startup. Requires Node.js to be built with diff --git a/src/node_options.cc b/src/node_options.cc index 8ec469d3ac3a99..695d7cee6541cc 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -589,6 +589,10 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( V8Option{}, kAllowedInEnvironment); AddOption("--stack-trace-limit", "", V8Option{}, kAllowedInEnvironment); + AddOption("--disallow-code-generation-from-strings", + "disallow eval and friends", + V8Option{}, + kAllowedInEnvironment); #ifdef NODE_REPORT AddOption("--report-uncaught-exception", diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 7e42139470e964..698f463b627644 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -60,6 +60,7 @@ if (common.hasCrypto) { // V8 options expect('--abort_on-uncaught_exception', 'B\n'); +expect('--disallow-code-generation-from-strings', 'B\n'); expect('--max-old-space-size=0', 'B\n'); expect('--stack-trace-limit=100', /(\s*at f \(\[eval\]:1:\d*\)\r?\n){100}/, From 87f14e13b3973da453f2fb53b6bc6df191a2314b Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 27 Oct 2019 01:09:03 +0200 Subject: [PATCH 33/65] stream: extract Readable.from in its own file See: https://github.com/nodejs/readable-stream/pull/420 PR-URL: https://github.com/nodejs/node/pull/30140 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Gus Caplan Reviewed-By: Beth Griggs --- lib/_stream_readable.js | 39 ++++-------------------------- lib/internal/streams/from.js | 46 ++++++++++++++++++++++++++++++++++++ node.gyp | 1 + 3 files changed, 51 insertions(+), 35 deletions(-) create mode 100644 lib/internal/streams/from.js diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 5d2300cf891bca..91cf2f75b07125 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -47,6 +47,7 @@ const { // Lazy loaded to improve the startup performance. let StringDecoder; let createReadableStreamAsyncIterator; +let from; Object.setPrototypeOf(Readable.prototype, Stream.prototype); Object.setPrototypeOf(Readable, Stream); @@ -1209,40 +1210,8 @@ function endReadableNT(state, stream) { } Readable.from = function(iterable, opts) { - let iterator; - if (iterable && iterable[Symbol.asyncIterator]) - iterator = iterable[Symbol.asyncIterator](); - else if (iterable && iterable[Symbol.iterator]) - iterator = iterable[Symbol.iterator](); - else - throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - - const readable = new Readable({ - objectMode: true, - ...opts - }); - // Reading boolean to protect against _read - // being called before last iteration completion. - let reading = false; - readable._read = function() { - if (!reading) { - reading = true; - next(); - } - }; - async function next() { - try { - const { value, done } = await iterator.next(); - if (done) { - readable.push(null); - } else if (readable.push(await value)) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } + if (from === undefined) { + from = require('internal/streams/from'); } - return readable; + return from(Readable, iterable, opts); }; diff --git a/lib/internal/streams/from.js b/lib/internal/streams/from.js new file mode 100644 index 00000000000000..e809f2658d5a9a --- /dev/null +++ b/lib/internal/streams/from.js @@ -0,0 +1,46 @@ +'use strict'; + +const { + ERR_INVALID_ARG_TYPE +} = require('internal/errors').codes; + +function from(Readable, iterable, opts) { + let iterator; + if (iterable && iterable[Symbol.asyncIterator]) + iterator = iterable[Symbol.asyncIterator](); + else if (iterable && iterable[Symbol.iterator]) + iterator = iterable[Symbol.iterator](); + else + throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); + + const readable = new Readable({ + objectMode: true, + ...opts + }); + // Reading boolean to protect against _read + // being called before last iteration completion. + let reading = false; + readable._read = function() { + if (!reading) { + reading = true; + next(); + } + }; + async function next() { + try { + const { value, done } = await iterator.next(); + if (done) { + readable.push(null); + } else if (readable.push(await value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + } + return readable; +} + +module.exports = from; diff --git a/node.gyp b/node.gyp index ecdecb05f4da8f..5f8089e617a247 100644 --- a/node.gyp +++ b/node.gyp @@ -205,6 +205,7 @@ 'lib/internal/streams/async_iterator.js', 'lib/internal/streams/buffer_list.js', 'lib/internal/streams/duplexpair.js', + 'lib/internal/streams/from.js', 'lib/internal/streams/legacy.js', 'lib/internal/streams/destroy.js', 'lib/internal/streams/state.js', From 98c8f76dd1abcc51e4e5a57a34575383c102c04e Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 22 Oct 2019 11:11:25 -0700 Subject: [PATCH 34/65] src: split up InitializeContext This splits out code from InitializeContext into a new function InitializeContextForSnapshot and moves the callsite of InitializeContextRuntime from NewContext to InitializeContext - embedders don't necessarily call NewContext and so need to be able to guarantee these functions are called regardless. PR-URL: https://github.com/nodejs/node/pull/30067 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: David Carlier Reviewed-By: James M Snell Reviewed-By: Franziska Hinkelmann Reviewed-By: Colin Ihrig --- src/api/environment.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index 3c5665a2d22623..e6a87d5a93a3b6 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -361,6 +361,9 @@ MaybeLocal GetPerContextExports(Local context) { return handle_scope.Escape(exports); } +// Any initialization logic should be performed in +// InitializeContext, because embedders don't necessarily +// call NewContext and so they will experience breakages. Local NewContext(Isolate* isolate, Local object_template) { auto context = Context::New(isolate, nullptr, object_template); @@ -370,8 +373,6 @@ Local NewContext(Isolate* isolate, return Local(); } - InitializeContextRuntime(context); - return context; } @@ -405,7 +406,7 @@ void InitializeContextRuntime(Local context) { } } -bool InitializeContext(Local context) { +bool InitializeContextForSnapshot(Local context) { Isolate* isolate = context->GetIsolate(); HandleScope handle_scope(isolate); @@ -459,6 +460,15 @@ bool InitializeContext(Local context) { return true; } +bool InitializeContext(Local context) { + if (!InitializeContextForSnapshot(context)) { + return false; + } + + InitializeContextRuntime(context); + return true; +} + uv_loop_t* GetCurrentEventLoop(Isolate* isolate) { HandleScope handle_scope(isolate); Local context = isolate->GetCurrentContext(); From 403a648a16163255638f178e6f93a456290cee40 Mon Sep 17 00:00:00 2001 From: Jan Krems Date: Fri, 25 Oct 2019 08:54:25 -0700 Subject: [PATCH 35/65] doc: fix numbering in require algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/29327 PR-URL: https://github.com/nodejs/node/pull/30117 Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- doc/api/modules.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 3d27244fac4e16..9bf02ff0bbf4b1 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -159,8 +159,8 @@ require(X) from module at path Y 3. If X begins with './' or '/' or '../' a. LOAD_AS_FILE(Y + X) b. LOAD_AS_DIRECTORY(Y + X) -5. LOAD_NODE_MODULES(X, dirname(Y)) -4. LOAD_SELF_REFERENCE(X, dirname(Y)) +4. LOAD_NODE_MODULES(X, dirname(Y)) +5. LOAD_SELF_REFERENCE(X, dirname(Y)) 6. THROW "not found" LOAD_AS_FILE(X) @@ -222,8 +222,8 @@ LOAD_NODE_MODULES(X, START) 1. let DIRS = NODE_MODULES_PATHS(START) 2. for each DIR in DIRS: a. let FILE_PATH = RESOLVE_BARE_SPECIFIER(DIR, X) - a. LOAD_AS_FILE(FILE_PATH) - b. LOAD_AS_DIRECTORY(FILE_PATH) + b. LOAD_AS_FILE(FILE_PATH) + c. LOAD_AS_DIRECTORY(FILE_PATH) RESOLVE_BARE_SPECIFIER(DIR, X) 1. Try to interpret X as a combination of name and subpath where the name From 978946e38b7de7e17c902e066c682b332af611ee Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Oct 2019 05:46:08 -0700 Subject: [PATCH 36/65] doc,meta: prefer aliases and stubs over Runtime Deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid Runtime Deprecations when an alias or a stub/no-op will suffice. An alias or stub will have lower maintenance costs for end users. Refs: https://github.com/nodejs/node/pull/29989#issuecomment-545427805 PR-URL: https://github.com/nodejs/node/pull/30153 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: Franziska Hinkelmann Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Gireesh Punathil Reviewed-By: Michael Dawson --- COLLABORATOR_GUIDE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 43bd683e800287..0315a2dbb83001 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -341,6 +341,9 @@ Runtime Deprecations and End-of-Life APIs (internal or public) are breaking changes (`semver-major`). The TSC may make exceptions, deciding that one of these deprecations is not a breaking change. +Avoid Runtime Deprecations when an alias or a stub/no-op will suffice. An alias +or stub will have lower maintenance costs for end users and Node.js core. + All deprecations receive a unique and immutable identifier. Documentation, warnings, and errors use the identifier when referring to the deprecation. The documentation for the deprecation identifier must always remain in the API From 2505f678efb328392d041f83cb87aa29d33b1192 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 25 Oct 2019 21:17:06 -0400 Subject: [PATCH 37/65] http: support readable hwm in IncomingMessage This commit causes http.IncomingMessage instances to set their readableHighWaterMark value the same value used in the underlying socket. PR-URL: https://github.com/nodejs/node/pull/30135 Fixes: https://github.com/nodejs/node/issues/30107 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat --- doc/api/http.md | 4 ++++ lib/_http_incoming.js | 10 +++++++- .../test-http-incoming-message-options.js | 24 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-http-incoming-message-options.js diff --git a/doc/api/http.md b/doc/api/http.md index 0807cc09d08b58..4d44121e8455f9 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1667,6 +1667,10 @@ the request body should be sent. ## Class: http.IncomingMessage * Extends: {stream.Readable} diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index ad3699cc44dc33..3e8bd69c04f0cf 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -37,7 +37,15 @@ function readStop(socket) { /* Abstract base class for ServerRequest and ClientResponse. */ function IncomingMessage(socket) { - Stream.Readable.call(this); + let streamOptions; + + if (socket) { + streamOptions = { + highWaterMark: socket.readableHighWaterMark + }; + } + + Stream.Readable.call(this, streamOptions); this._readableState.readingMore = true; diff --git a/test/parallel/test-http-incoming-message-options.js b/test/parallel/test-http-incoming-message-options.js new file mode 100644 index 00000000000000..61e178eb47aeda --- /dev/null +++ b/test/parallel/test-http-incoming-message-options.js @@ -0,0 +1,24 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const readableHighWaterMark = 1024; +const server = http.createServer((req, res) => { res.end(); }); + +server.listen(0, common.mustCall(() => { + const req = http.request({ + port: server.address().port, + createConnection(options) { + options.readableHighWaterMark = readableHighWaterMark; + return net.createConnection(options); + } + }, common.mustCall((res) => { + assert.strictEqual(res.socket, req.socket); + assert.strictEqual(res.socket.readableHighWaterMark, readableHighWaterMark); + assert.strictEqual(res.readableHighWaterMark, readableHighWaterMark); + server.close(); + })); + + req.end(); +})); From dfb4a246957c7157bdd635fafc74c4d03e941323 Mon Sep 17 00:00:00 2001 From: Alex Zherdev Date: Fri, 11 Oct 2019 16:01:34 -0700 Subject: [PATCH 38/65] doc: fix an error in resolution algorithm steps As it is, if `X begins with './' or '/' or '../'` (step 3), it reads as if it were possible for the algorithm to do a node_modules lookup (step 4). But that doesn't seem to reflect the actual logic. PR-URL: https://github.com/nodejs/node/pull/29940 Reviewed-By: Ben Noordhuis Reviewed-By: Jan Krems Reviewed-By: Ruben Bridgewater Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- doc/api/modules.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/modules.md b/doc/api/modules.md index 9bf02ff0bbf4b1..8715218b32c8a4 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -159,6 +159,7 @@ require(X) from module at path Y 3. If X begins with './' or '/' or '../' a. LOAD_AS_FILE(Y + X) b. LOAD_AS_DIRECTORY(Y + X) + c. THROW "not found" 4. LOAD_NODE_MODULES(X, dirname(Y)) 5. LOAD_SELF_REFERENCE(X, dirname(Y)) 6. THROW "not found" From a48d17900bbb432b3c425eed06a49c7125e41141 Mon Sep 17 00:00:00 2001 From: dev-313 Date: Mon, 7 Oct 2019 23:46:03 +0530 Subject: [PATCH 39/65] doc: add options description for send APIs Describes the meaning of the boolean return in process.send() (doc/api/process.md) and worker.send() (doc/api/cluster.md) as described in subprocess.send() (doc/api/child_process.md) Fixes: https://github.com/nodejs/node/issues/26995 PR-URL: https://github.com/nodejs/node/pull/29868 Reviewed-By: Gireesh Punathil --- doc/api/cluster.md | 8 +++++++- doc/api/process.md | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 972309a7013690..179a775074a394 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -456,7 +456,7 @@ Workers will call `process.exit(0)` if the `'disconnect'` event occurs on `process` and `.exitedAfterDisconnect` is not `true`. This protects against accidental disconnection. -### worker.send(message\[, sendHandle\]\[, callback\]) +### worker.send(message\[, sendHandle\[, options\]\]\[, callback\]) 0) - mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume () { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` diff --git a/deps/npm/node_modules/minipass/node_modules/yallist/README.md b/deps/npm/node_modules/minipass/node_modules/yallist/README.md deleted file mode 100644 index f5861018696688..00000000000000 --- a/deps/npm/node_modules/minipass/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/deps/npm/node_modules/minipass/node_modules/yallist/iterator.js b/deps/npm/node_modules/minipass/node_modules/yallist/iterator.js deleted file mode 100644 index 9149b364889d1e..00000000000000 --- a/deps/npm/node_modules/minipass/node_modules/yallist/iterator.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var Yallist = require('./yallist.js') - -Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } -} diff --git a/deps/npm/node_modules/minipass/node_modules/yallist/package.json b/deps/npm/node_modules/minipass/node_modules/yallist/package.json deleted file mode 100644 index d7b5f46b9ac0e0..00000000000000 --- a/deps/npm/node_modules/minipass/node_modules/yallist/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "yallist@^3.0.0", - "_id": "yallist@3.0.2", - "_inBundle": false, - "_integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", - "_location": "/minipass/yallist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "yallist@^3.0.0", - "name": "yallist", - "escapedName": "yallist", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/minipass" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "_shasum": "8452b4bb7e83c7c188d8041c1a837c773d6d8bb9", - "_spec": "yallist@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/minipass", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^10.3.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "yallist.js", - "iterator.js" - ], - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "name": "yallist", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" - }, - "version": "3.0.2" -} diff --git a/deps/npm/node_modules/minipass/node_modules/yallist/yallist.js b/deps/npm/node_modules/minipass/node_modules/yallist/yallist.js deleted file mode 100644 index 4805bc69fa760e..00000000000000 --- a/deps/npm/node_modules/minipass/node_modules/yallist/yallist.js +++ /dev/null @@ -1,376 +0,0 @@ -'use strict' -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} - -try { - // add if support or Symbol.iterator is present - require('./iterator.js') -} catch (er) {} diff --git a/deps/npm/node_modules/minizlib/README.md b/deps/npm/node_modules/minizlib/README.md index 2b585545efe14b..4097b85225542f 100644 --- a/deps/npm/node_modules/minizlib/README.md +++ b/deps/npm/node_modules/minizlib/README.md @@ -1,44 +1,53 @@ # minizlib -A tiny fast zlib stream built on [minipass](http://npm.im/minipass) -and Node.js's zlib binding. +A fast zlib stream built on [minipass](http://npm.im/minipass) and +Node.js's zlib binding. This module was created to serve the needs of -[node-tar](http://npm.im/tar) v2. If your needs are different, then -it may not be for you. +[node-tar](http://npm.im/tar) and +[minipass-fetch](http://npm.im/minipass-fetch). + +Brotli is supported in versions of node with a Brotli binding. ## How does this differ from the streams in `require('zlib')`? First, there are no convenience methods to compress or decompress a buffer. If you want those, use the built-in `zlib` module. This is -only streams. +only streams. That being said, Minipass streams to make it fairly easy to +use as one-liners: `new zlib.Deflate().end(data).read()` will return the +deflate compressed result. This module compresses and decompresses the data as fast as you feed it in. It is synchronous, and runs on the main process thread. Zlib -operations can be high CPU, but they're very fast, and doing it this -way means much less bookkeeping and artificial deferral. +and Brotli operations can be high CPU, but they're very fast, and doing it +this way means much less bookkeeping and artificial deferral. Node's built in zlib streams are built on top of `stream.Transform`. They do the maximally safe thing with respect to consistent asynchrony, buffering, and backpressure. -This module _does_ support backpressure, and will buffer output chunks -that are not consumed, but is less of a mediator between the input and -output. There is no high or low watermarks, no state objects, and so -artificial async deferrals. It will not protect you from Zalgo. - -If you write, data will be emitted right away. If you write -everything synchronously in one tick, and you are listening to the -`data` event to consume it, then it'll all be emitted right away in -that same tick. If you want data to be emitted in the next tick, then -write it in the next tick. - -It is thus the responsibility of the reader and writer to manage their -own consumption and process execution flow. - -The goal is to compress and decompress as fast as possible, even for -files that are too large to store all in one buffer. - -The API is very similar to the built-in zlib module. There are -classes that you instantiate with `new` and they are streams that can -be piped together. +See [Minipass](http://npm.im/minipass) for more on the differences between +Node.js core streams and Minipass streams, and the convenience methods +provided by that class. + +## Classes + +- Deflate +- Inflate +- Gzip +- Gunzip +- DeflateRaw +- InflateRaw +- Unzip +- BrotliCompress (Node v10 and higher) +- BrotliDecompress (Node v10 and higher) + +## USAGE + +```js +const zlib = require('minizlib') +const input = sourceOfCompressedData() +const decode = new zlib.BrotliDecompress() +const output = whereToWriteTheDecodedData() +input.pipe(decode).pipe(output) +``` diff --git a/deps/npm/node_modules/minizlib/constants.js b/deps/npm/node_modules/minizlib/constants.js index 4edffde86f8528..641ebc73129bf7 100644 --- a/deps/npm/node_modules/minizlib/constants.js +++ b/deps/npm/node_modules/minizlib/constants.js @@ -1,4 +1,11 @@ -module.exports = Object.freeze({ +// Update with any zlib constants that are added or changed in the future. +// Node v6 didn't export this, so we just hard code the version and rely +// on all the other hard-coded values from zlib v4736. When node v6 +// support drops, we can just export the realZlibConstants object. +const realZlibConstants = require('zlib').constants || + /* istanbul ignore next */ { ZLIB_VERNUM: 4736 } + +module.exports = Object.freeze(Object.assign(Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, @@ -23,7 +30,6 @@ module.exports = Object.freeze({ Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, - ZLIB_VERNUM: 4736, DEFLATE: 1, INFLATE: 2, GZIP: 3, @@ -31,6 +37,8 @@ module.exports = Object.freeze({ DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, @@ -42,5 +50,66 @@ module.exports = Object.freeze({ Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, - Z_DEFAULT_LEVEL: -1 -}) + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31, +}, realZlibConstants)) diff --git a/deps/npm/node_modules/minizlib/index.js b/deps/npm/node_modules/minizlib/index.js index 1385dc2363c02b..295047b9c1447d 100644 --- a/deps/npm/node_modules/minizlib/index.js +++ b/deps/npm/node_modules/minizlib/index.js @@ -5,15 +5,21 @@ const Buffer = require('buffer').Buffer const realZlib = require('zlib') const constants = exports.constants = require('./constants.js') -const MiniPass = require('minipass') +const Minipass = require('minipass') const OriginalBufferConcat = Buffer.concat class ZlibError extends Error { - constructor (msg, errno) { - super('zlib: ' + msg) - this.errno = errno - this.code = codes.get(errno) + constructor (err) { + super('zlib: ' + err.message) + this.code = err.code + this.errno = err.errno + /* istanbul ignore if */ + if (!this.code) + this.code = 'ZLIB_ERROR' + + this.message = 'zlib: ' + err.message + Error.captureStackTrace(this, this.constructor) } get name () { @@ -21,128 +27,51 @@ class ZlibError extends Error { } } -// translation table for return codes. -const codes = new Map([ - [constants.Z_OK, 'Z_OK'], - [constants.Z_STREAM_END, 'Z_STREAM_END'], - [constants.Z_NEED_DICT, 'Z_NEED_DICT'], - [constants.Z_ERRNO, 'Z_ERRNO'], - [constants.Z_STREAM_ERROR, 'Z_STREAM_ERROR'], - [constants.Z_DATA_ERROR, 'Z_DATA_ERROR'], - [constants.Z_MEM_ERROR, 'Z_MEM_ERROR'], - [constants.Z_BUF_ERROR, 'Z_BUF_ERROR'], - [constants.Z_VERSION_ERROR, 'Z_VERSION_ERROR'] -]) - -const validFlushFlags = new Set([ - constants.Z_NO_FLUSH, - constants.Z_PARTIAL_FLUSH, - constants.Z_SYNC_FLUSH, - constants.Z_FULL_FLUSH, - constants.Z_FINISH, - constants.Z_BLOCK -]) - -const strategies = new Set([ - constants.Z_FILTERED, - constants.Z_HUFFMAN_ONLY, - constants.Z_RLE, - constants.Z_FIXED, - constants.Z_DEFAULT_STRATEGY -]) - // the Zlib class they all inherit from // This thing manages the queue of requests, and returns // true or false if there is anything in the queue when // you call the .write() method. const _opts = Symbol('opts') const _flushFlag = Symbol('flushFlag') -const _finishFlush = Symbol('finishFlush') +const _finishFlushFlag = Symbol('finishFlushFlag') +const _fullFlushFlag = Symbol('fullFlushFlag') const _handle = Symbol('handle') const _onError = Symbol('onError') const _sawError = Symbol('sawError') const _level = Symbol('level') const _strategy = Symbol('strategy') const _ended = Symbol('ended') +const _defaultFullFlush = Symbol('_defaultFullFlush') -class Zlib extends MiniPass { +class ZlibBase extends Minipass { constructor (opts, mode) { + if (!opts || typeof opts !== 'object') + throw new TypeError('invalid options for ZlibBase constructor') + super(opts) this[_ended] = false - this[_opts] = opts = opts || {} - if (opts.flush && !validFlushFlags.has(opts.flush)) { - throw new TypeError('Invalid flush flag: ' + opts.flush) - } - if (opts.finishFlush && !validFlushFlags.has(opts.finishFlush)) { - throw new TypeError('Invalid flush flag: ' + opts.finishFlush) - } - - this[_flushFlag] = opts.flush || constants.Z_NO_FLUSH - this[_finishFlush] = typeof opts.finishFlush !== 'undefined' ? - opts.finishFlush : constants.Z_FINISH - - if (opts.chunkSize) { - if (opts.chunkSize < constants.Z_MIN_CHUNK) { - throw new RangeError('Invalid chunk size: ' + opts.chunkSize) - } - } - - if (opts.windowBits) { - if (opts.windowBits < constants.Z_MIN_WINDOWBITS || - opts.windowBits > constants.Z_MAX_WINDOWBITS) { - throw new RangeError('Invalid windowBits: ' + opts.windowBits) - } - } - - if (opts.level) { - if (opts.level < constants.Z_MIN_LEVEL || - opts.level > constants.Z_MAX_LEVEL) { - throw new RangeError('Invalid compression level: ' + opts.level) - } - } + this[_opts] = opts - if (opts.memLevel) { - if (opts.memLevel < constants.Z_MIN_MEMLEVEL || - opts.memLevel > constants.Z_MAX_MEMLEVEL) { - throw new RangeError('Invalid memLevel: ' + opts.memLevel) - } - } - - if (opts.strategy && !(strategies.has(opts.strategy))) - throw new TypeError('Invalid strategy: ' + opts.strategy) - - if (opts.dictionary) { - if (!(opts.dictionary instanceof Buffer)) { - throw new TypeError('Invalid dictionary: it should be a Buffer instance') - } + this[_flushFlag] = opts.flush + this[_finishFlushFlag] = opts.finishFlush + // this will throw if any options are invalid for the class selected + try { + this[_handle] = new realZlib[mode](opts) + } catch (er) { + // make sure that all errors get decorated properly + throw new ZlibError(er) } - this[_handle] = new realZlib[mode](opts) - this[_onError] = (err) => { this[_sawError] = true // there is no way to cleanly recover. // continuing only obscures problems. this.close() - - const error = new ZlibError(err.message, err.errno) - this.emit('error', error) + this.emit('error', err) } - this[_handle].on('error', this[_onError]) - const level = typeof opts.level === 'number' ? opts.level - : constants.Z_DEFAULT_COMPRESSION - - var strategy = typeof opts.strategy === 'number' ? opts.strategy - : constants.Z_DEFAULT_STRATEGY - - // API changed in node v9 - /* istanbul ignore next */ - - this[_level] = level - this[_strategy] = strategy - - this.once('end', this.close) + this[_handle].on('error', er => this[_onError](new ZlibError(er))) + this.once('end', () => this.close) } close () { @@ -153,47 +82,6 @@ class Zlib extends MiniPass { } } - params (level, strategy) { - if (this[_sawError]) - return - - if (!this[_handle]) - throw new Error('cannot switch params when binding is closed') - - // no way to test this without also not supporting params at all - /* istanbul ignore if */ - if (!this[_handle].params) - throw new Error('not supported in this implementation') - - if (level < constants.Z_MIN_LEVEL || - level > constants.Z_MAX_LEVEL) { - throw new RangeError('Invalid compression level: ' + level) - } - - if (!(strategies.has(strategy))) - throw new TypeError('Invalid strategy: ' + strategy) - - if (this[_level] !== level || this[_strategy] !== strategy) { - this.flush(constants.Z_SYNC_FLUSH) - assert(this[_handle], 'zlib binding closed') - // .params() calls .flush(), but the latter is always async in the - // core zlib. We override .flush() temporarily to intercept that and - // flush synchronously. - const origFlush = this[_handle].flush - this[_handle].flush = (flushFlag, cb) => { - this[_handle].flush = origFlush - this.flush(flushFlag) - cb() - } - this[_handle].params(level, strategy) - /* istanbul ignore else */ - if (this[_handle]) { - this[_level] = level - this[_strategy] = strategy - } - } - } - reset () { if (!this[_sawError]) { assert(this[_handle], 'zlib binding closed') @@ -201,23 +89,19 @@ class Zlib extends MiniPass { } } - flush (kind) { - if (kind === undefined) - kind = constants.Z_FULL_FLUSH - + flush (flushFlag) { if (this.ended) return - const flushFlag = this[_flushFlag] - this[_flushFlag] = kind - this.write(Buffer.alloc(0)) - this[_flushFlag] = flushFlag + if (typeof flushFlag !== 'number') + flushFlag = this[_fullFlushFlag] + this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag })) } end (chunk, encoding, cb) { if (chunk) this.write(chunk, encoding) - this.flush(this[_finishFlush]) + this.flush(this[_finishFlushFlag]) this[_ended] = true return super.end(null, null, cb) } @@ -251,11 +135,17 @@ class Zlib extends MiniPass { Buffer.concat = (args) => args let result try { - result = this[_handle]._processChunk(chunk, this[_flushFlag]) + const flushFlag = typeof chunk[_flushFlag] === 'number' + ? chunk[_flushFlag] : this[_flushFlag] + result = this[_handle]._processChunk(chunk, flushFlag) + // if we don't throw, reset it back how it was + Buffer.concat = OriginalBufferConcat } catch (err) { - this[_onError](err) - } finally { + // or if we do, put Buffer.concat() back before we emit error + // Error events call into user code, which may call Buffer.concat() Buffer.concat = OriginalBufferConcat + this[_onError](new ZlibError(err)) + } finally { if (this[_handle]) { // Core zlib resets `_handle` to null after attempting to close the // native handle. Our no-op handler prevented actual closure, but we @@ -289,6 +179,56 @@ class Zlib extends MiniPass { } } +class Zlib extends ZlibBase { + constructor (opts, mode) { + opts = opts || {} + + opts.flush = opts.flush || constants.Z_NO_FLUSH + opts.finishFlush = opts.finishFlush || constants.Z_FINISH + super(opts, mode) + + this[_fullFlushFlag] = constants.Z_FULL_FLUSH + this[_level] = opts.level + this[_strategy] = opts.strategy + } + + params (level, strategy) { + if (this[_sawError]) + return + + if (!this[_handle]) + throw new Error('cannot switch params when binding is closed') + + // no way to test this without also not supporting params at all + /* istanbul ignore if */ + if (!this[_handle].params) + throw new Error('not supported in this implementation') + + if (this[_level] !== level || this[_strategy] !== strategy) { + this.flush(constants.Z_SYNC_FLUSH) + assert(this[_handle], 'zlib binding closed') + // .params() calls .flush(), but the latter is always async in the + // core zlib. We override .flush() temporarily to intercept that and + // flush synchronously. + const origFlush = this[_handle].flush + this[_handle].flush = (flushFlag, cb) => { + this.flush(flushFlag) + cb() + } + try { + this[_handle].params(level, strategy) + } finally { + this[_handle].flush = origFlush + } + /* istanbul ignore else */ + if (this[_handle]) { + this[_level] = level + this[_strategy] = strategy + } + } + } +} + // minimal 2-byte header class Deflate extends Zlib { constructor (opts) { @@ -335,6 +275,31 @@ class Unzip extends Zlib { } } +class Brotli extends ZlibBase { + constructor (opts, mode) { + opts = opts || {} + + opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS + opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH + + super(opts, mode) + + this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH + } +} + +class BrotliCompress extends Brotli { + constructor (opts) { + super(opts, 'BrotliCompress') + } +} + +class BrotliDecompress extends Brotli { + constructor (opts) { + super(opts, 'BrotliDecompress') + } +} + exports.Deflate = Deflate exports.Inflate = Inflate exports.Gzip = Gzip @@ -342,3 +307,14 @@ exports.Gunzip = Gunzip exports.DeflateRaw = DeflateRaw exports.InflateRaw = InflateRaw exports.Unzip = Unzip +/* istanbul ignore else */ +if (typeof realZlib.BrotliCompress === 'function') { + exports.BrotliCompress = BrotliCompress + exports.BrotliDecompress = BrotliDecompress +} else { + exports.BrotliCompress = exports.BrotliDecompress = class { + constructor () { + throw new Error('Brotli is not supported in this version of Node.js') + } + } +} diff --git a/deps/npm/node_modules/minipass/node_modules/yallist/LICENSE b/deps/npm/node_modules/minizlib/node_modules/minipass/LICENSE similarity index 93% rename from deps/npm/node_modules/minipass/node_modules/yallist/LICENSE rename to deps/npm/node_modules/minizlib/node_modules/minipass/LICENSE index 19129e315fe593..20a47625409237 100644 --- a/deps/npm/node_modules/minipass/node_modules/yallist/LICENSE +++ b/deps/npm/node_modules/minizlib/node_modules/minipass/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) npm, Inc. and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/README.md b/deps/npm/node_modules/minizlib/node_modules/minipass/README.md new file mode 100644 index 00000000000000..c989beea0e6d97 --- /dev/null +++ b/deps/npm/node_modules/minizlib/node_modules/minipass/README.md @@ -0,0 +1,606 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) +for objects, strings, and buffers. + +Supports pipe()ing (including multi-pipe() and backpressure +transmission), buffering data until either a `data` event handler or +`pipe()` is added (so you don't lose the first chunk), and most other +cases where PassThrough is a good idea. + +There is a `read()` method, but it's much more efficient to consume +data from this stream via `'data'` events or by calling `pipe()` into +some other stream. Calling `read()` requires the buffer to be +flattened in some cases, which requires copying memory. + +There is also no `unpipe()` method. Once you start piping, there is +no stopping it! + +If you set `objectMode: true` in the options, then whatever is written +will be emitted. Otherwise, it'll do a minimal amount of Buffer +copying to ensure proper Streams semantics when `read(n)` is called. + +`objectMode` can also be set by doing `stream.objectMode = true`, or by +writing any non-string/non-buffer data. `objectMode` cannot be set to +false once it is set. + +This is not a `through` or `through2` stream. It doesn't transform +the data, it just passes it right through. If you want to transform +the data, extend the class, and override the `write()` method. Once +you're done transforming the data however you want, call +`super.write()` with the transform output. + +For some examples of streams that extend Minipass in various ways, check +out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap) +- [treport](http://npm.im/tap) + +## Differences from Node.js Streams + +There are several things that make Minipass streams different from (and in +some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with noode-core streams and +intend to use Minipass streams in your programs. + +### Timing + +Minipass streams are designed to support synchronous use-cases. Thus, data +is emitted as soon as it is available, always. It is buffered until read, +but no longer. Another way to look at it is that Minipass streams are +exactly as synchronous as the logic that writes into them. + +This can be surprising if your code relies on `PassThrough.write()` always +providing data on the next tick rather than the current one, or being able +to call `resume()` and not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no way for +Minipass to achieve the speeds it does, or support the synchronous use +cases that it does. Simply put, waiting takes time. + +This non-deferring approach makes Minipass streams much easier to reason +about, especially in the context of Promises and other flow-control +mechanisms. + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, returning `true` +on all writes until the limit is hit, even if the data has nowhere to go. +Then, they will not attempt to draw more data in until the buffer size dips +below a minimum value. + +Minipass streams are much simpler. The `write()` method will return `true` +if the data has somewhere to go (which is to say, given the timing +guarantees, that the data is already there by the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and the data +sits in a buffer, to be drained out immediately as soon as anyone consumes +it. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written all the way +through the pipeline, and `write()` always returns true/false based on +whether the data was fully flushed, backpressure is communicated +immediately to the upstream caller. This minimizes buffering. + +Consider this case: + +```js +const {PassThrough} = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, and +multiple event deferrals happened, for an unblocked pipeline where it was +perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead someone reading +the code to think an advisory maximum of 1KiB is being set for the +pipeline. However, the actual advisory buffering level is the _sum_ of +`highWaterMark` values, since each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data written, +or _ever_ buffer data that can be flushed all the way through. Neither +node-core streams nor Minipass ever fail to buffer written data, but +node-core streams do a lot of unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less stuff and +waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing any data +into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't want to +potentially happen immediately (for example, closing file descriptors, +moving on to the next entry in an archive parse stream, etc.) then be sure +to call `stream.pause()` on creation, and then `stream.resume()` once you +are ready to respond to the `end` event. + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not yet have had +a chance to add a listener. In order to avoid this hazard, Minipass +streams safely re-emit the `'end'` event if a new listener is added after +`'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream has already +emitted `end`, then it will call the handler right away. (You can think of +this somewhat like attaching a new `.then(fn)` to a previously-resolved +Promise.) + +To prevent calling handlers multiple times who would not expect multiple +ends to occur, all listeners are removed from the `'end'` event whenever it +is emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data through the +pipeline when a new pipe destination is added, this can have surprising +effects, especially when a stream comes in from some other function and may +or may not have data in its buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +The solution is to create a dedicated tee-stream junction that pipes to +both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +stream.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The first one +added will _immediately_ receive all of the data, leaving nothing for the +second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what you want. + +```js +const Minipass = require('minipass') +const mp = new Minipass(options) // optional: { encoding, objectMode } +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +* `encoding` How would you like the data coming _out_ of the stream to be + encoded? Accepts any values that can be passed to `Buffer.toString()`. +* `objectMode` Emit data exactly as it comes in. This will be flipped on + by default if you write() something other than a string or Buffer at any + point. Setting `objectMode: true` will prevent setting any encoding + value. + +### API + +Implements the user-facing portions of Node.js's `Readable` and `Writable` +streams. + +### Methods + +* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the + base Minipass class, the same data will come out.) Returns `false` if + the stream will buffer the next write, or true if it's still in + "flowing" mode. +* `end([chunk, [encoding]], [callback])` - Signal that you have no more + data to write. This will queue an `end` event to be fired when all the + data has been consumed. +* `setEncoding(encoding)` - Set the encoding for data coming of the + stream. This can only be done once. +* `pause()` - No more data for a while, please. This also prevents `end` + from being emitted for empty streams until the stream is resumed. +* `resume()` - Resume the stream. If there's data in the buffer, it is + all discarded. Any buffered events are immediately emitted. +* `pipe(dest)` - Send all output to the stream provided. There is no way + to unpipe. When data is emitted, it is immediately written to any and + all pipe destinations. +* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. + Some events are given special treatment, however. (See below under + "events".) +* `promise()` - Returns a Promise that resolves when the stream emits + `end`, or rejects if the stream emits `error`. +* `collect()` - Return a Promise that resolves on `end` with an array + containing each chunk of data that was emitted, or rejects if the + stream emits `error`. Note that this consumes the stream data. +* `concat()` - Same as `collect()`, but concatenates the data into a + single Buffer object. Will reject the returned promise if the stream is + in objectMode, or if it goes into objectMode by the end of the data. +* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not + provided, then consume all of it. If `n` bytes are not available, then + it returns null. **Note** consuming streams in this way is less + efficient, and can lead to unnecessary Buffer copying. +* `destroy([er])` - Destroy the stream. If an error is provided, then an + `'error'` event is emitted. If the stream has a `close()` method, and + has not emitted a `'close'` event yet, then `stream.close()` will be + called. Any Promises returned by `.promise()`, `.collect()` or + `.concat()` will be rejected. After being destroyed, writing to the + stream will emit an error. No more data will be emitted if the stream is + destroyed, even if it was previously buffered. + +### Properties + +* `bufferLength` Read-only. Total number of bytes buffered, or in the case + of objectMode, the total number of objects. +* `encoding` The encoding that has been set. (Setting this is equivalent + to calling `setEncoding(enc)` and has the same prohibition against + setting multiple times.) +* `flowing` Read-only. Boolean indicating whether a chunk written to the + stream will be immediately emitted. +* `emittedEnd` Read-only. Boolean indicating whether the end-ish events + (ie, `end`, `prefinish`, `finish`) have been emitted. Note that + listening on any end-ish event will immediateyl re-emit it if it has + already been emitted. +* `writable` Whether the stream is writable. Default `true`. Set to + `false` when `end()` +* `readable` Whether the stream is readable. Default `true`. +* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written + to the stream that have not yet been emitted. (It's probably a bad idea + to mess with this.) +* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that + this stream is piping into. (It's probably a bad idea to mess with + this.) +* `destroyed` A getter that indicates whether the stream was destroyed. +* `paused` True if the stream has been explicitly paused, otherwise false. +* `objectMode` Indicates whether the stream is in `objectMode`. Once set + to `true`, it cannot be set to `false`. + +### Events + +* `data` Emitted when there's data to read. Argument is the data to read. + This is never emitted while not flowing. If a listener is attached, that + will resume the stream. +* `end` Emitted when there's no more data to read. This will be emitted + immediately for empty streams when `end()` is called. If a listener is + attached, and `end` was already emitted, then it will be emitted again. + All listeners are removed when `end` is emitted. +* `prefinish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'end'`. +* `finish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'prefinish'`. +* `close` An indication that an underlying resource has been released. + Minipass does not emit this event, but will defer it until after `end` + has been emitted, since it throws off some stream libraries otherwise. +* `drain` Emitted when the internal buffer empties, and it is again + suitable to `write()` into the stream. +* `readable` Emitted when data is buffered and ready to be read by a + consumer. +* `resume` Emitted when stream changes state from buffering to flowing + mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event + listener is added.) + +### Static Methods + +* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, + and false otherwise. To be considered a stream, the object must be + either an instance of Minipass, or an EventEmitter that has either a + `pipe()` method, or both `write()` and `end()` methods. (Pretty much any + stream in node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass streams. + +### simple "are you done yet" promise + +```js +mp.promise().then(() => { + // stream is finished +}, er => { + // stream emitted an error +}) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one chunk for +you, but if you're going to do it yourself anyway, it's convenient this +way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in +platforms that support it. + +Synchronous iteration will end when the currently available data is +consumed, even if the `end` event has not been reached. In string and +buffer mode, the data is concatenated, so unless multiple writes are +occurring in the same tick as the `read()`, sync iteration loops will +generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, with +no flattening, create the stream with the `{ objectMode: true }` +option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i --> 0) + mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume () { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe(new (class extends Minipass { + emit (ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit (ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write (obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end (obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor (options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write (chunk, encoding, cb) { + if (typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8') { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + let parsed + try { + super.write(parsed) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) + cb() + } +} +``` diff --git a/deps/npm/node_modules/minipass/index.js b/deps/npm/node_modules/minizlib/node_modules/minipass/index.js similarity index 59% rename from deps/npm/node_modules/minipass/index.js rename to deps/npm/node_modules/minizlib/node_modules/minipass/index.js index ae2dd906403e42..c072352d448a97 100644 --- a/deps/npm/node_modules/minipass/index.js +++ b/deps/npm/node_modules/minizlib/node_modules/minipass/index.js @@ -1,41 +1,62 @@ 'use strict' const EE = require('events') const Yallist = require('yallist') +const SD = require('string_decoder').StringDecoder + const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') -const doIter = process.env._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented') -const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented') const FLUSHCHUNK = Symbol('flushChunk') -const SD = require('string_decoder').StringDecoder const ENCODING = Symbol('encoding') const DECODER = Symbol('decoder') const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') const RESUME = Symbol('resume') const BUFFERLENGTH = Symbol('bufferLength') const BUFFERPUSH = Symbol('bufferPush') const BUFFERSHIFT = Symbol('bufferShift') const OBJECTMODE = Symbol('objectMode') -const SILENT_END = Symbol('silentEnd') +const DESTROYED = Symbol('destroyed') + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = doIter && Symbol.asyncIterator + || Symbol('asyncIterator not implemented') +const ITERATOR = doIter && Symbol.iterator + || Symbol('iterator not implemented') // Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from // or Buffer.alloc, and Buffer in node 10 deprecated the ctor. // .M, this is fine .\^/M.. -let B = Buffer -/* istanbul ignore next */ -if (!B.alloc) { - B = require('safe-buffer').Buffer -} - -module.exports = class MiniPass extends EE { +const B = Buffer.alloc ? Buffer + : /* istanbul ignore next */ require('safe-buffer').Buffer + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => + ev === 'end' || + ev === 'finish' || + ev === 'prefinish' + +const isArrayBuffer = b => b instanceof ArrayBuffer || + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0 + +const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) + +module.exports = class Minipass extends EE { constructor (options) { super() - this[SILENT_END] = false this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false this.pipes = new Yallist() this.buffer = new Yallist() this[OBJECTMODE] = options && options.objectMode || false @@ -48,10 +69,12 @@ module.exports = class MiniPass extends EE { this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null this[EOF] = false this[EMITTED_END] = false + this[EMITTING_END] = false this[CLOSED] = false this.writable = true this.readable = true this[BUFFERLENGTH] = 0 + this[DESTROYED] = false } get bufferLength () { return this[BUFFERLENGTH] } @@ -78,16 +101,52 @@ module.exports = class MiniPass extends EE { this.encoding = enc } + get objectMode () { return this[OBJECTMODE] } + set objectMode (ॐ ) { this[OBJECTMODE] = this[OBJECTMODE] || !!ॐ } + write (chunk, encoding, cb) { if (this[EOF]) throw new Error('write after end') + if (this[DESTROYED]) { + this.emit('error', Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + )) + return true + } + if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) + chunk = B.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // this ensures at this point that the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!this.objectMode && !chunk.length) { + const ret = this.flowing + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + if (cb) + cb() + return ret + } + // fast-path writing strings of same encoding to a stream with // an empty buffer, skipping the buffer/decoder dance if (typeof chunk === 'string' && !this[OBJECTMODE] && @@ -104,13 +163,17 @@ module.exports = class MiniPass extends EE { ? (this.emit('data', chunk), this.flowing) : (this[BUFFERPUSH](chunk), false) } finally { - this.emit('readable') + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') if (cb) cb() } } read (n) { + if (this[DESTROYED]) + return null + try { if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null @@ -163,12 +226,22 @@ module.exports = class MiniPass extends EE { this.once('end', cb) this[EOF] = true this.writable = false - if (this.flowing) + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() + return this } // don't let the internal resume be overwritten [RESUME] () { + if (this[DESTROYED]) + return + + this[PAUSED] = false this[FLOWING] = true this.emit('resume') if (this.buffer.length) @@ -185,12 +258,21 @@ module.exports = class MiniPass extends EE { pause () { this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed () { + return this[DESTROYED] } get flowing () { return this[FLOWING] } + get paused () { + return this[PAUSED] + } + [BUFFERPUSH] (chunk) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 @@ -221,13 +303,24 @@ module.exports = class MiniPass extends EE { } pipe (dest, opts) { + if (this[DESTROYED]) + return + + const ended = this[EMITTED_END] + opts = opts || {} if (dest === process.stdout || dest === process.stderr) - (opts = opts || {}).end = false + opts.end = false + else + opts.end = opts.end !== false + const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } this.pipes.push(p) dest.on('drain', p.ondrain) this[RESUME]() + // piping an ended stream ends immediately + if (ended && p.opts.end) + p.dest.end() return dest } @@ -241,9 +334,9 @@ module.exports = class MiniPass extends EE { } finally { if (ev === 'data' && !this.pipes.length && !this.flowing) this[RESUME]() - else if (ev === 'end' && this[SILENT_END] && this[EMITTED_END]) { - this[SILENT_END] = false - super.emit('end') + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) } } } @@ -253,23 +346,34 @@ module.exports = class MiniPass extends EE { } [MAYBE_EMIT_END] () { - if (!this[EMITTED_END] && this.buffer.length === 0 && this[EOF]) { + if (!this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this.buffer.length === 0 && + this[EOF]) { + this[EMITTING_END] = true this.emit('end') this.emit('prefinish') this.emit('finish') if (this[CLOSED]) this.emit('close') + this[EMITTING_END] = false } } emit (ev, data) { - if (ev === 'data') { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { if (!data) return if (this.pipes.length) - this.pipes.forEach(p => p.dest.write(data) || this.pause()) + this.pipes.forEach(p => + p.dest.write(data) === false && this.pause()) } else if (ev === 'end') { + // only actual end gets this treatment if (this[EMITTED_END] === true) return @@ -286,16 +390,17 @@ module.exports = class MiniPass extends EE { this.pipes.forEach(p => { p.dest.removeListener('drain', p.ondrain) - if (!p.opts || p.opts.end !== false) + if (p.opts.end) p.dest.end() }) } else if (ev === 'close') { this[CLOSED] = true // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END]) + if (!this[EMITTED_END] && !this[DESTROYED]) return } + // TODO: replace with a spread operator when Node v4 support drops const args = new Array(arguments.length) args[0] = ev args[1] = data @@ -306,23 +411,42 @@ module.exports = class MiniPass extends EE { } try { - const ret = super.emit.apply(this, args) - if (ev === 'end' && ret === false) - this[SILENT_END] = true - return ret + return super.emit.apply(this, args) } finally { - if (ev !== 'end') + if (!isEndish(ev)) this[MAYBE_EMIT_END]() + else + this.removeAllListeners(ev) } } // const all = await stream.collect() collect () { + const buf = [] + buf.dataLength = 0 + this.on('data', c => { + buf.push(c) + buf.dataLength += c.length + }) + return this.promise().then(() => buf) + } + + // const data = await stream.concat() + concat () { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) + } + + // stream.promise().then(() => done, er => emitted error) + promise () { return new Promise((resolve, reject) => { - const buf = [] - this.on('data', c => buf.push(c)) - this.on('end', () => resolve(buf)) - this.on('error', reject) + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('end', () => resolve()) + this.on('error', er => reject(er)) }) } @@ -354,13 +478,14 @@ module.exports = class MiniPass extends EE { this.removeListener('data', ondata) resolve({ done: true }) } + const ondestroy = () => onerr(new Error('stream destroyed')) return new Promise((res, rej) => { reject = rej resolve = res + this.once(DESTROYED, ondestroy) this.once('error', onerr) this.once('end', onend) this.once('data', ondata) - this.resume() }) } @@ -376,4 +501,37 @@ module.exports = class MiniPass extends EE { } return { next } } + + destroy (er) { + if (this[DESTROYED]) { + if (er) + this.emit('error', er) + else + this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this.buffer = new Yallist() + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) + this.close() + + if (er) + this.emit('error', er) + else // if no error to emit, still reject pending promises + this.emit(DESTROYED) + + return this + } + + static isStream (s) { + return !!s && (s instanceof Minipass || s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable + )) + } } diff --git a/deps/npm/node_modules/minipass/package.json b/deps/npm/node_modules/minizlib/node_modules/minipass/package.json similarity index 62% rename from deps/npm/node_modules/minipass/package.json rename to deps/npm/node_modules/minizlib/node_modules/minipass/package.json index 0654e5f597df60..57284172b071f2 100644 --- a/deps/npm/node_modules/minipass/package.json +++ b/deps/npm/node_modules/minizlib/node_modules/minipass/package.json @@ -1,32 +1,27 @@ { - "_from": "minipass@^2.3.3", - "_id": "minipass@2.3.3", + "_from": "minipass@^2.9.0", + "_id": "minipass@2.9.0", "_inBundle": false, - "_integrity": "sha512-/jAn9/tEX4gnpyRATxgHEOV6xbcyxgT7iUnxo9Y3+OB0zX00TgKIv/2FZCf5brBbICcwbLqVv2ImjvWWrQMSYw==", - "_location": "/minipass", + "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "_location": "/minizlib/minipass", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "minipass@^2.3.3", + "raw": "minipass@^2.9.0", "name": "minipass", "escapedName": "minipass", - "rawSpec": "^2.3.3", + "rawSpec": "^2.9.0", "saveSpec": null, - "fetchSpec": "^2.3.3" + "fetchSpec": "^2.9.0" }, "_requiredBy": [ - "/fs-minipass", - "/minizlib", - "/pacote", - "/tap", - "/tap-parser", - "/tar" + "/minizlib" ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.3.tgz", - "_shasum": "a7dcc8b7b833f5d368759cce544dccb55f50f233", - "_spec": "minipass@^2.3.3", - "_where": "/Users/rebecca/code/npm/node_modules/pacote", + "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", + "_spec": "minipass@^2.9.0", + "_where": "/Users/mperrotte/npminc/cli/node_modules/minizlib", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -44,7 +39,7 @@ "description": "minimal implementation of a PassThrough stream", "devDependencies": { "end-of-stream": "^1.4.0", - "tap": "^12.0.1", + "tap": "^14.6.5", "through2": "^2.0.3" }, "files": [ @@ -63,10 +58,13 @@ "url": "git+https://github.com/isaacs/minipass.git" }, "scripts": { - "postpublish": "git push origin --all; git push origin --tags", + "postpublish": "git push origin --follow-tags", "postversion": "npm publish", "preversion": "npm test", - "test": "tap test/*.js --100" + "test": "tap" }, - "version": "2.3.3" + "tap": { + "check-coverage": true + }, + "version": "2.9.0" } diff --git a/deps/npm/node_modules/minizlib/package.json b/deps/npm/node_modules/minizlib/package.json index fbf08b3df98c13..1284b8c6c48316 100644 --- a/deps/npm/node_modules/minizlib/package.json +++ b/deps/npm/node_modules/minizlib/package.json @@ -1,10 +1,13 @@ { "_from": "minizlib@^1.2.1", - "_id": "minizlib@1.2.2", + "_id": "minizlib@1.3.3", "_inBundle": false, - "_integrity": "sha512-hR3At21uSrsjjDTWrbu0IMLTpnkpv8IIMFDFaoz43Tmu4LkmAXfH44vNNzpTnf+OAQQCHrb91y/wc2J4x5XgSQ==", + "_integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "_location": "/minizlib", - "_phantomChildren": {}, + "_phantomChildren": { + "safe-buffer": "5.1.2", + "yallist": "3.0.3" + }, "_requested": { "type": "range", "registry": true, @@ -18,8 +21,8 @@ "_requiredBy": [ "/tar" ], - "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.2.tgz", - "_shasum": "6f0ccc82fa53e1bf2ff145f220d2da9fa6e3a166", + "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "_shasum": "2290de96818a34c29551c8a8d301216bd65a861d", "_spec": "minizlib@^1.2.1", "_where": "/Users/mperrotte/npminc/cli/node_modules/tar", "author": { @@ -32,7 +35,7 @@ }, "bundleDependencies": false, "dependencies": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" }, "deprecated": false, "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", @@ -67,5 +70,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J" }, - "version": "1.2.2" + "version": "1.3.3" } diff --git a/deps/npm/node_modules/npm-packlist/index.js b/deps/npm/node_modules/npm-packlist/index.js index 8bfd257794f9e0..dd7706a4aee2a5 100644 --- a/deps/npm/node_modules/npm-packlist/index.js +++ b/deps/npm/node_modules/npm-packlist/index.js @@ -51,6 +51,9 @@ const defaultRules = [ 'core.+([0-9])', ] +// There may be others, but :?|<> are handled by node-tar +const nameIsBadForWindows = file => /\*/.test(file) + // a decorator that applies our custom rules to an ignore walker const npmWalker = Class => class Walker extends Class { constructor (opt) { @@ -170,6 +173,7 @@ const npmWalker = Class => class Walker extends Class { pkg.browser ? '!' + pkg.browser : '', pkg.main ? '!' + pkg.main : '', '!package.json', + '!npm-shrinkwrap.json', '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}' ] if (pkg.bin) @@ -190,6 +194,16 @@ const npmWalker = Class => class Walker extends Class { then() } + // override parent stat function to completely skip any filenames + // that will break windows entirely. + // XXX(isaacs) Next major version should make this an error instead. + stat (entry, file, dir, then) { + if (nameIsBadForWindows(entry)) + then() + else + super.stat(entry, file, dir, then) + } + // override parent onstat function to nix all symlinks onstat (st, entry, file, dir, then) { if (st.isSymbolicLink()) diff --git a/deps/npm/node_modules/npm-packlist/package.json b/deps/npm/node_modules/npm-packlist/package.json index d72eef9cae7392..a8fabfa7f12405 100644 --- a/deps/npm/node_modules/npm-packlist/package.json +++ b/deps/npm/node_modules/npm-packlist/package.json @@ -1,29 +1,29 @@ { - "_from": "npm-packlist@^1.4.3", - "_id": "npm-packlist@1.4.4", + "_from": "npm-packlist@1.4.6", + "_id": "npm-packlist@1.4.6", "_inBundle": false, - "_integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", + "_integrity": "sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg==", "_location": "/npm-packlist", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "npm-packlist@^1.4.3", + "raw": "npm-packlist@1.4.6", "name": "npm-packlist", "escapedName": "npm-packlist", - "rawSpec": "^1.4.3", + "rawSpec": "1.4.6", "saveSpec": null, - "fetchSpec": "^1.4.3" + "fetchSpec": "1.4.6" }, "_requiredBy": [ "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", - "_shasum": "866224233850ac534b63d1a6e76050092b5d2f44", - "_spec": "npm-packlist@^1.4.3", - "_where": "/Users/isaacs/dev/npm/cli", + "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.6.tgz", + "_shasum": "53ba3ed11f8523079f1457376dd379ee4ea42ff4", + "_spec": "npm-packlist@1.4.6", + "_where": "/Users/mperrotte/npminc/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -42,7 +42,7 @@ "devDependencies": { "mkdirp": "^0.5.1", "rimraf": "^2.6.1", - "tap": "^14.2.1" + "tap": "^14.6.9" }, "directories": { "test": "test" @@ -65,5 +65,8 @@ "snap": "tap", "test": "tap" }, - "version": "1.4.4" + "tap": { + "jobs": 1 + }, + "version": "1.4.6" } diff --git a/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md b/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md index fc6ba4f7e3fec5..8eee50a4790a3c 100644 --- a/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md +++ b/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [4.0.2](https://github.com/npm/registry-fetch/compare/v4.0.0...v4.0.2) (2019-10-04) + + +### Bug Fixes + +* Add null check on body on 401 errors ([e3a0186](https://github.com/npm/registry-fetch/commit/e3a0186)), closes [#9](https://github.com/npm/registry-fetch/issues/9) +* **deps:** Add explicit dependency on safe-buffer ([8eae5f0](https://github.com/npm/registry-fetch/commit/8eae5f0)), closes [npm/libnpmaccess#2](https://github.com/npm/libnpmaccess/issues/2) [#3](https://github.com/npm/registry-fetch/issues/3) + + + # [4.0.0](https://github.com/npm/registry-fetch/compare/v3.9.1...v4.0.0) (2019-07-15) diff --git a/deps/npm/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/npm-registry-fetch/check-response.js index bfde699edcfbd6..14058239ba3f5d 100644 --- a/deps/npm/node_modules/npm-registry-fetch/check-response.js +++ b/deps/npm/node_modules/npm-registry-fetch/check-response.js @@ -95,7 +95,7 @@ function checkErrors (method, res, startTime, opts) { method, res, parsed, opts.spec ) } - } else if (res.status === 401 && /one-time pass/.test(body.toString('utf8'))) { + } else if (res.status === 401 && body != null && /one-time pass/.test(body.toString('utf8'))) { // Heuristic for malformed OTP responses that don't include the www-authenticate header. throw new errors.HttpErrorAuthOTP( method, res, parsed, opts.spec diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/LICENSE b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/LICENSE new file mode 100644 index 00000000000000..0c068ceecbd48f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md new file mode 100644 index 00000000000000..356e3519302cfa --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md @@ -0,0 +1,586 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +[Get supported safe-buffer with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-safe-buffer?utm_source=npm-safe-buffer&utm_medium=referral&utm_campaign=readme) + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts new file mode 100644 index 00000000000000..e9fed809a5ab51 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js new file mode 100644 index 00000000000000..054c8d30ddafb4 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js @@ -0,0 +1,64 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json new file mode 100644 index 00000000000000..576c453b23322b --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json @@ -0,0 +1,62 @@ +{ + "_from": "safe-buffer@^5.2.0", + "_id": "safe-buffer@5.2.0", + "_inBundle": false, + "_integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "_location": "/npm-registry-fetch/safe-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "safe-buffer@^5.2.0", + "name": "safe-buffer", + "escapedName": "safe-buffer", + "rawSpec": "^5.2.0", + "saveSpec": null, + "fetchSpec": "^5.2.0" + }, + "_requiredBy": [ + "/npm-registry-fetch" + ], + "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "_shasum": "b74daec49b1148f88c64b68d49b1e815c1f2f519", + "_spec": "safe-buffer@^5.2.0", + "_where": "/Users/mperrotte/npminc/cli/node_modules/npm-registry-fetch", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Safer Node.js Buffer API", + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "name": "safe-buffer", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "types": "index.d.ts", + "version": "5.2.0" +} diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json index 10671d568b5710..78e3100daa47f9 100644 --- a/deps/npm/node_modules/npm-registry-fetch/package.json +++ b/deps/npm/node_modules/npm-registry-fetch/package.json @@ -1,19 +1,19 @@ { - "_from": "npm-registry-fetch@4.0.0", - "_id": "npm-registry-fetch@4.0.0", + "_from": "npm-registry-fetch@4.0.2", + "_id": "npm-registry-fetch@4.0.2", "_inBundle": false, - "_integrity": "sha512-Jllq35Jag8dtv0M17ue74XtdQTyqKzuAYGiX9mAjOhkmNjib3bBUgK6mUY61+AHnXeSRobQkpY3/xIOS/omptw==", + "_integrity": "sha512-Z0IFtPEozNdeZRPh3aHHxdG+ZRpzcbQaJLthsm3VhNf6DScicTFRHZzK82u8RsJUsUHkX+QH/zcB/5pmd20H4A==", "_location": "/npm-registry-fetch", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-registry-fetch@4.0.0", + "raw": "npm-registry-fetch@4.0.2", "name": "npm-registry-fetch", "escapedName": "npm-registry-fetch", - "rawSpec": "4.0.0", + "rawSpec": "4.0.2", "saveSpec": null, - "fetchSpec": "4.0.0" + "fetchSpec": "4.0.2" }, "_requiredBy": [ "#USER", @@ -28,10 +28,10 @@ "/npm-profile", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", - "_shasum": "5ef75845b605855c7964472542c25da172af8677", - "_spec": "npm-registry-fetch@4.0.0", - "_where": "/Users/isaacs/dev/npm/cli", + "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.2.tgz", + "_shasum": "2b1434f93ccbe6b6385f8e45f45db93e16921d7a", + "_spec": "npm-registry-fetch@4.0.2", + "_where": "/Users/mperrotte/npminc/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -54,7 +54,8 @@ "figgy-pudding": "^3.4.1", "lru-cache": "^5.1.1", "make-fetch-happen": "^5.0.0", - "npm-package-arg": "^6.1.0" + "npm-package-arg": "^6.1.0", + "safe-buffer": "^5.2.0" }, "deprecated": false, "description": "Fetch-based http client for use with npm registry APIs", @@ -98,5 +99,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "4.0.0" + "version": "4.0.2" } diff --git a/deps/npm/node_modules/tar/lib/write-entry.js b/deps/npm/node_modules/tar/lib/write-entry.js index 63f749488c55fd..0c019006f3b670 100644 --- a/deps/npm/node_modules/tar/lib/write-entry.js +++ b/deps/npm/node_modules/tar/lib/write-entry.js @@ -231,7 +231,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { er.path = this.absolute er.syscall = 'read' er.code = 'EOF' - this[CLOSE](fd) + this[CLOSE](fd, _ => _) return this.emit('error', er) } @@ -240,7 +240,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { er.path = this.absolute er.syscall = 'read' er.code = 'EOF' - this[CLOSE](fd) + this[CLOSE](fd, _ => _) return this.emit('error', er) } diff --git a/deps/npm/node_modules/tar/node_modules/minipass/index.js b/deps/npm/node_modules/tar/node_modules/minipass/index.js index cab9009f2befb6..c072352d448a97 100644 --- a/deps/npm/node_modules/tar/node_modules/minipass/index.js +++ b/deps/npm/node_modules/tar/node_modules/minipass/index.js @@ -43,6 +43,14 @@ const isEndish = ev => ev === 'finish' || ev === 'prefinish' +const isArrayBuffer = b => b instanceof ArrayBuffer || + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0 + +const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) + module.exports = class Minipass extends EE { constructor (options) { super() @@ -114,8 +122,19 @@ module.exports = class Minipass extends EE { if (!encoding) encoding = 'utf8' - if (typeof chunk !== 'string' && !B.isBuffer(chunk) && !this[OBJECTMODE]) - this.objectMode = true + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) + chunk = B.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } // this ensures at this point that the chunk is a buffer or string // don't buffer it up or send it to the decoder diff --git a/deps/npm/node_modules/tar/node_modules/minipass/package.json b/deps/npm/node_modules/tar/node_modules/minipass/package.json index 5c782f120d18f8..aeb390253c4ee1 100644 --- a/deps/npm/node_modules/tar/node_modules/minipass/package.json +++ b/deps/npm/node_modules/tar/node_modules/minipass/package.json @@ -1,8 +1,8 @@ { "_from": "minipass@^2.8.6", - "_id": "minipass@2.8.6", + "_id": "minipass@2.9.0", "_inBundle": false, - "_integrity": "sha512-lFG7d6g3+/UaFDCOtqPiKAC9zngWWsQZl1g5q6gaONqrjq61SX2xFqXMleQiFVyDpYwa018E9hmlAFY22PCb+A==", + "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "_location": "/tar/minipass", "_phantomChildren": {}, "_requested": { @@ -18,8 +18,8 @@ "_requiredBy": [ "/tar" ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.8.6.tgz", - "_shasum": "620d889ace26356391d010ecb9458749df9b6db5", + "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", "_spec": "minipass@^2.8.6", "_where": "/Users/mperrotte/npminc/cli/node_modules/tar", "author": { @@ -39,7 +39,7 @@ "description": "minimal implementation of a PassThrough stream", "devDependencies": { "end-of-stream": "^1.4.0", - "tap": "^14.6.4", + "tap": "^14.6.5", "through2": "^2.0.3" }, "files": [ @@ -66,5 +66,5 @@ "tap": { "check-coverage": true }, - "version": "2.8.6" + "version": "2.9.0" } diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 9a4a511239899d..b12db0f3ef5eca 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -1,8 +1,8 @@ { - "_from": "tar@4.4.12", - "_id": "tar@4.4.12", + "_from": "tar@4.4.13", + "_id": "tar@4.4.13", "_inBundle": false, - "_integrity": "sha512-4GwpJwdSjIHlUrWd/1yJrl63UqcqjJyVglgIwn4gcG+Lrp9TXpZ1ZRrGLIRBNqLTUvz6yoPJrX4B/MISxY/Ukg==", + "_integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "_location": "/tar", "_phantomChildren": { "safe-buffer": "5.1.2", @@ -11,12 +11,12 @@ "_requested": { "type": "version", "registry": true, - "raw": "tar@4.4.12", + "raw": "tar@4.4.13", "name": "tar", "escapedName": "tar", - "rawSpec": "4.4.12", + "rawSpec": "4.4.13", "saveSpec": null, - "fetchSpec": "4.4.12" + "fetchSpec": "4.4.13" }, "_requiredBy": [ "#USER", @@ -24,9 +24,9 @@ "/node-gyp", "/pacote" ], - "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.12.tgz", - "_shasum": "6a1275a870a782f92828e24d28fa6aa253193af7", - "_spec": "tar@4.4.12", + "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "_shasum": "43b364bc52888d555298637b10d60790254ab525", + "_spec": "tar@4.4.13", "_where": "/Users/mperrotte/npminc/cli", "author": { "name": "Isaac Z. Schlueter", @@ -84,5 +84,5 @@ "coverage-map": "map.js", "check-coverage": true }, - "version": "4.4.12" + "version": "4.4.13" } diff --git a/deps/npm/node_modules/uuid/.eslintrc.json b/deps/npm/node_modules/uuid/.eslintrc.json deleted file mode 100644 index 734a8e14c7ac12..00000000000000 --- a/deps/npm/node_modules/uuid/.eslintrc.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "root": true, - "env": { - "browser": true, - "commonjs": true, - "node": true, - "mocha": true - }, - "extends": ["eslint:recommended"], - "rules": { - "array-bracket-spacing": ["warn", "never"], - "arrow-body-style": ["warn", "as-needed"], - "arrow-parens": ["warn", "as-needed"], - "arrow-spacing": "warn", - "brace-style": ["warn", "1tbs"], - "camelcase": "warn", - "comma-spacing": ["warn", {"after": true}], - "dot-notation": "warn", - "eqeqeq": ["warn", "smart"], - "indent": ["warn", 2, { - "SwitchCase": 1, - "FunctionDeclaration": {"parameters": 1}, - "MemberExpression": 1, - "CallExpression": {"arguments": 1} - }], - "key-spacing": ["warn", {"beforeColon": false, "afterColon": true, "mode": "minimum"}], - "keyword-spacing": "warn", - "no-console": "off", - "no-empty": "off", - "no-multi-spaces": "warn", - "no-redeclare": "off", - "no-restricted-globals": ["warn", "Promise"], - "no-trailing-spaces": "warn", - "no-undef": "error", - "no-unused-vars": ["warn", {"args": "none"}], - "one-var": ["warn", "never"], - "padded-blocks": ["warn", "never"], - "object-curly-spacing": ["warn", "never"], - "quotes": ["warn", "single"], - "react/prop-types": "off", - "react/jsx-no-bind": "off", - "semi": ["warn", "always"], - "space-before-blocks": ["warn", "always"], - "space-before-function-paren": ["warn", "never"], - "space-in-parens": ["warn", "never"] - } -} diff --git a/deps/npm/node_modules/uuid/CHANGELOG.md b/deps/npm/node_modules/uuid/CHANGELOG.md index f29d3991e0f6c1..1ff6978076ec86 100644 --- a/deps/npm/node_modules/uuid/CHANGELOG.md +++ b/deps/npm/node_modules/uuid/CHANGELOG.md @@ -1,7 +1,9 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [3.3.3](https://github.com/kelektiv/node-uuid/compare/v3.3.2...v3.3.3) (2019-08-19) + ## [3.3.2](https://github.com/kelektiv/node-uuid/compare/v3.3.1...v3.3.2) (2018-06-28) diff --git a/deps/npm/node_modules/uuid/README.md b/deps/npm/node_modules/uuid/README.md index 9cbe1ac1848eb1..6fc3708b4b5303 100644 --- a/deps/npm/node_modules/uuid/README.md +++ b/deps/npm/node_modules/uuid/README.md @@ -28,7 +28,7 @@ Version 1 (timestamp): ```javascript const uuidv1 = require('uuid/v1'); -uuidv1(); // ⇨ '45745c60-7b1a-11e8-9c9c-2d42b21b1a3e' +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' ``` @@ -56,7 +56,7 @@ Version 4 (random): ```javascript const uuidv4 = require('uuid/v4'); -uuidv4(); // ⇨ '10ba038e-48da-487b-96e8-8d3b99b6d18a' +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' ``` @@ -147,7 +147,7 @@ Generate and return a RFC4122 v1 (timestamp-based) UUID. Returns `buffer`, if specified, otherwise the string form of the UUID -Note: The id is generated guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) +Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. Example: Generate string UUID with fully-specified options @@ -167,8 +167,8 @@ Example: In-place generation of two binary IDs ```javascript // Generate two ids in an array const arr = new Array(); -uuidv1(null, arr, 0); // ⇨ [ 69, 117, 109, 208, 123, 26, 17, 232, 146, 52, 45, 66, 178, 27, 26, 62 ] -uuidv1(null, arr, 16); // ⇨ [ 69, 117, 109, 208, 123, 26, 17, 232, 146, 52, 45, 66, 178, 27, 26, 62, 69, 117, 109, 209, 123, 26, 17, 232, 146, 52, 45, 66, 178, 27, 26, 62 ] +uuidv1(null, arr, 0); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ] +uuidv1(null, arr, 16); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125, 44, 94, 164, 193, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ] ``` @@ -237,8 +237,8 @@ Example: Generate two IDs in a single buffer ```javascript const buffer = new Array(); -uuidv4(null, buffer, 0); // ⇨ [ 54, 122, 218, 70, 45, 70, 65, 24, 171, 53, 95, 130, 83, 195, 242, 45 ] -uuidv4(null, buffer, 16); // ⇨ [ 54, 122, 218, 70, 45, 70, 65, 24, 171, 53, 95, 130, 83, 195, 242, 45, 108, 204, 255, 103, 171, 86, 76, 94, 178, 225, 188, 236, 150, 20, 151, 87 ] +uuidv4(null, buffer, 0); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109 ] +uuidv4(null, buffer, 16); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109, 27, 157, 107, 205, 187, 253, 75, 45, 155, 93, 171, 141, 251, 189, 75, 237 ] ``` diff --git a/deps/npm/node_modules/uuid/README_js.md b/deps/npm/node_modules/uuid/README_js.md deleted file mode 100644 index f34453be407b77..00000000000000 --- a/deps/npm/node_modules/uuid/README_js.md +++ /dev/null @@ -1,280 +0,0 @@ -```javascript --hide -runmd.onRequire = path => path.replace(/^uuid/, './'); -``` - -# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) # - -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. - -Features: - -* Support for version 1, 3, 4 and 5 UUIDs -* Cross-platform -* Uses cryptographically-strong random number APIs (when available) -* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883)) - -[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be -supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.] - -## Quickstart - CommonJS (Recommended) - -```shell -npm install uuid -``` - -Then generate your uuid version of choice ... - -Version 1 (timestamp): - -```javascript --run v1 -const uuidv1 = require('uuid/v1'); -uuidv1(); // RESULT -``` - -Version 3 (namespace): - -```javascript --run v3 -const uuidv3 = require('uuid/v3'); - -// ... using predefined DNS namespace (for domain names) -uuidv3('hello.example.com', uuidv3.DNS); // RESULT - -// ... using predefined URL namespace (for, well, URLs) -uuidv3('http://example.com/hello', uuidv3.URL); // RESULT - -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv3('Hello, World!', MY_NAMESPACE); // RESULT -``` - -Version 4 (random): - -```javascript --run v4 -const uuidv4 = require('uuid/v4'); -uuidv4(); // RESULT -``` - -Version 5 (namespace): - -```javascript --run v5 -const uuidv5 = require('uuid/v5'); - -// ... using predefined DNS namespace (for domain names) -uuidv5('hello.example.com', uuidv5.DNS); // RESULT - -// ... using predefined URL namespace (for, well, URLs) -uuidv5('http://example.com/hello', uuidv5.URL); // RESULT - -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv5('Hello, World!', MY_NAMESPACE); // RESULT -``` - -## Quickstart - Browser-ready Versions - -Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in). - -For version 1 uuids: - -```html - - -``` - -For version 3 uuids: - -```html - - -``` - -For version 4 uuids: - -```html - - -``` - -For version 5 uuids: - -```html - - -``` - -## API - -### Version 1 - -```javascript -const uuidv1 = require('uuid/v1'); - -// Incantations -uuidv1(); -uuidv1(options); -uuidv1(options, buffer, offset); -``` - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Note: The id is generated guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript --run v1 -const v1options = { - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}; -uuidv1(v1options); // RESULT -``` - -Example: In-place generation of two binary IDs - -```javascript --run v1 -// Generate two ids in an array -const arr = new Array(); -uuidv1(null, arr, 0); // RESULT -uuidv1(null, arr, 16); // RESULT -``` - -### Version 3 - -```javascript -const uuidv3 = require('uuid/v3'); - -// Incantations -uuidv3(name, namespace); -uuidv3(name, namespace, buffer); -uuidv3(name, namespace, buffer, offset); -``` - -Generate and return a RFC4122 v3 UUID. - -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: - -```javascript --run v3 -uuidv3('hello world', MY_NAMESPACE); // RESULT -``` - -### Version 4 - -```javascript -const uuidv4 = require('uuid/v4') - -// Incantations -uuidv4(); -uuidv4(options); -uuidv4(options, buffer, offset); -``` - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with predefined `random` values - -```javascript --run v4 -const v4options = { - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}; -uuidv4(v4options); // RESULT -``` - -Example: Generate two IDs in a single buffer - -```javascript --run v4 -const buffer = new Array(); -uuidv4(null, buffer, 0); // RESULT -uuidv4(null, buffer, 16); // RESULT -``` - -### Version 5 - -```javascript -const uuidv5 = require('uuid/v5'); - -// Incantations -uuidv5(name, namespace); -uuidv5(name, namespace, buffer); -uuidv5(name, namespace, buffer, offset); -``` - -Generate and return a RFC4122 v5 UUID. - -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: - -```javascript --run v5 -uuidv5('hello world', MY_NAMESPACE); // RESULT -``` - -## Command Line - -UUIDs can be generated from the command line with the `uuid` command. - -```shell -$ uuid -ddeb27fb-d9a0-4624-be4d-4615062daed4 - -$ uuid v1 -02d37060-d446-11e7-a9fa-7bdae751ebe1 -``` - -Type `uuid --help` for usage details - -## Testing - -```shell -npm test -``` diff --git a/deps/npm/node_modules/uuid/package.json b/deps/npm/node_modules/uuid/package.json index 81ea5a2682f685..2ffe04e3d7ea5e 100644 --- a/deps/npm/node_modules/uuid/package.json +++ b/deps/npm/node_modules/uuid/package.json @@ -1,29 +1,30 @@ { - "_from": "uuid@3.3.2", - "_id": "uuid@3.3.2", + "_from": "uuid@3.3.3", + "_id": "uuid@3.3.3", "_inBundle": false, - "_integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "_integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "_location": "/uuid", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "uuid@3.3.2", + "raw": "uuid@3.3.3", "name": "uuid", "escapedName": "uuid", - "rawSpec": "3.3.2", + "rawSpec": "3.3.3", "saveSpec": null, - "fetchSpec": "3.3.2" + "fetchSpec": "3.3.3" }, "_requiredBy": [ "#USER", "/", + "/nyc", "/request" ], - "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "_shasum": "1b4af4955eb3077c501c23872fc6513811587131", - "_spec": "uuid@3.3.2", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "_shasum": "4568f0216e78760ee1dbf3a4d2cf53e224112866", + "_spec": "uuid@3.3.3", + "_where": "/Users/mperrotte/npminc/cli", "bin": { "uuid": "./bin/uuid" }, @@ -66,13 +67,13 @@ "deprecated": false, "description": "RFC4122 (v1, v4, and v5) UUIDs", "devDependencies": { - "@commitlint/cli": "7.0.0", - "@commitlint/config-conventional": "7.0.1", - "eslint": "4.19.1", - "husky": "0.14.3", - "mocha": "5.2.0", - "runmd": "1.0.1", - "standard-version": "4.4.0" + "@commitlint/cli": "8.1.0", + "@commitlint/config-conventional": "8.1.0", + "eslint": "6.2.0", + "husky": "3.0.4", + "mocha": "6.2.0", + "runmd": "1.2.1", + "standard-version": "7.0.0" }, "homepage": "https://github.com/kelektiv/node-uuid#readme", "keywords": [ @@ -87,11 +88,11 @@ "url": "git+https://github.com/kelektiv/node-uuid.git" }, "scripts": { - "commitmsg": "commitlint -E GIT_PARAMS", + "commitmsg": "commitlint -E HUSKY_GIT_PARAMS", "md": "runmd --watch --output=README.md README_js.md", "prepare": "runmd --output=README.md README_js.md", "release": "standard-version", "test": "mocha test/test.js" }, - "version": "3.3.2" + "version": "3.3.3" } diff --git a/deps/npm/package.json b/deps/npm/package.json index 9e24f77f4b3c5b..d051bfca9ba65b 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "6.12.0", + "version": "6.12.1", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -44,7 +44,7 @@ "byte-size": "^5.0.1", "cacache": "^12.0.3", "call-limit": "^1.1.1", - "chownr": "^1.1.2", + "chownr": "^1.1.3", "ci-info": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.5.1", @@ -61,7 +61,7 @@ "fs-write-stream-atomic": "~1.0.10", "gentle-fs": "^2.2.1", "glob": "^7.1.4", - "graceful-fs": "^4.2.2", + "graceful-fs": "^4.2.3", "has-unicode": "~2.0.1", "hosted-git-info": "^2.8.5", "iferr": "^1.0.2", @@ -73,7 +73,7 @@ "is-cidr": "^3.0.0", "json-parse-better-errors": "^1.0.2", "lazy-property": "~1.0.0", - "libcipm": "^4.0.4", + "libcipm": "^4.0.7", "libnpm": "^3.0.1", "libnpmaccess": "^3.0.2", "libnpmhook": "^5.0.3", @@ -101,10 +101,10 @@ "npm-install-checks": "^3.0.2", "npm-lifecycle": "^3.1.4", "npm-package-arg": "^6.1.1", - "npm-packlist": "^1.4.4", + "npm-packlist": "^1.4.6", "npm-pick-manifest": "^3.0.2", "npm-profile": "^4.0.2", - "npm-registry-fetch": "^4.0.0", + "npm-registry-fetch": "^4.0.2", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", @@ -134,7 +134,7 @@ "sorted-union-stream": "~2.1.3", "ssri": "^6.0.1", "stringify-package": "^1.0.1", - "tar": "^4.4.12", + "tar": "^4.4.13", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "uid-number": "0.0.6", @@ -142,7 +142,7 @@ "unique-filename": "^1.1.1", "unpipe": "~1.0.0", "update-notifier": "^2.5.0", - "uuid": "^3.3.2", + "uuid": "^3.3.3", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "~3.0.0", "which": "^1.3.1", diff --git a/deps/npm/test/fixtures/config/userconfig-with-gc b/deps/npm/test/fixtures/config/userconfig-with-gc index cf774bb883d966..a3a837eb78dd47 100644 --- a/deps/npm/test/fixtures/config/userconfig-with-gc +++ b/deps/npm/test/fixtures/config/userconfig-with-gc @@ -1,4 +1,4 @@ -globalconfig = /Users/isaacs/dev/npm/cli/test/fixtures/config/globalconfig +globalconfig = /Users/mperrotte/npminc/cli/test/fixtures/config/globalconfig email = i@izs.me env-thing = ${random_env_var} init.author.name = Isaac Z. Schlueter diff --git a/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js b/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js new file mode 100644 index 00000000000000..3c1a56131bad46 --- /dev/null +++ b/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js @@ -0,0 +1,118 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = common.pkg + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-test-cli-with-broken-package-lock', + description: 'fixture', + version: '0.0.0', + dependencies: { + optimist: '0.6.0' + } +} + +var brokenLockfile = { + name: 'install-test-cli-with-broken-package-lock', + version: '0.0.0', + lockfileVersion: 1, + requires: true, + dependencies: { + optimist: { + version: '0.6.0', + resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', + integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', + requires: { + minimist: '~0.0.1', + wordwrap: '~0.0.2' + } + }, + wordwrap: { + version: '0.0.3', + resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', + integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' + } + } +} + +var expected = { + name: 'install-test-cli-with-broken-package-lock', + version: '0.0.0', + lockfileVersion: 1, + requires: true, + dependencies: { + minimist: { + version: '0.0.10', + resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz', + integrity: 'sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=' + }, + optimist: { + version: '0.6.0', + resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', + integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', + requires: { + minimist: '~0.0.1', + wordwrap: '~0.0.2' + } + }, + wordwrap: { + version: '0.0.3', + resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', + integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' + } + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('\'npm install-test\' should repair package-lock.json', function (t) { + common.npm(['install-test'], EXEC_OPTS, function (err, code, stderr, stdout) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'npm install did not raise error code') + var lockfile = JSON.parse(fs.readFileSync(path.join(pkg, 'package-lock.json'))) + t.same( + lockfile, + expected, + 'package-lock.json should be repaired' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + path.join(pkg, 'package-lock.json'), + JSON.stringify(brokenLockfile, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} From 1499a72a1f7093591213b65cb57873b475d9b6a2 Mon Sep 17 00:00:00 2001 From: dev-313 Date: Tue, 29 Oct 2019 19:41:49 +0530 Subject: [PATCH 42/65] doc: improve doc Http2Session:Timeout Add line in doc/http2.md for 'timeout' event which tell readers that 'timeout' event doesn't except any arguments. Refs: https://github.com/nodejs/help/issues/877 PR-URL: https://github.com/nodejs/node/pull/30161 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: David Carlier Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat --- doc/api/http2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 058958517d47ca..07ca77e30f5e30 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -311,6 +311,7 @@ added: v8.4.0 After the `http2session.setTimeout()` method is used to set the timeout period for this `Http2Session`, the `'timeout'` event is emitted if there is no activity on the `Http2Session` after the configured number of milliseconds. +Its listener does not expect any arguments. ```js session.setTimeout(2000); From b255688d5fe806fdd244e271f2cde3a6b6677077 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 27 Oct 2019 14:28:04 +0100 Subject: [PATCH 43/65] build: fix pkg-config search for libnghttp2 The configure script was searching for 'nghttp2' whereas the actual name of the package is 'libnghttp2'. This change also removes the hack for libcares in one fell swoop. Co-Authored-By: legendecas PR-URL: https://github.com/nodejs/node/pull/30145 Fixes: https://github.com/nodejs/node/issues/30113 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Chengzhong Wu --- configure.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/configure.py b/configure.py index 8790b3c13fcc86..959c1db6518fdb 100755 --- a/configure.py +++ b/configure.py @@ -298,23 +298,23 @@ shared_optgroup.add_option('--shared-cares', action='store_true', - dest='shared_libcares', + dest='shared_cares', help='link to a shared cares DLL instead of static linking') shared_optgroup.add_option('--shared-cares-includes', action='store', - dest='shared_libcares_includes', + dest='shared_cares_includes', help='directory containing cares header files') shared_optgroup.add_option('--shared-cares-libname', action='store', - dest='shared_libcares_libname', + dest='shared_cares_libname', default='cares', help='alternative lib name to link to [default: %default]') shared_optgroup.add_option('--shared-cares-libpath', action='store', - dest='shared_libcares_libpath', + dest='shared_cares_libpath', help='a directory to search for the shared cares DLL') parser.add_option_group(shared_optgroup) @@ -1138,12 +1138,13 @@ def configure_napi(output): version = getnapibuildversion.get_napi_version() output['variables']['napi_build_version'] = version -def configure_library(lib, output): +def configure_library(lib, output, pkgname=None): shared_lib = 'shared_' + lib output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib)) if getattr(options, shared_lib): - (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = pkg_config(lib) + (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = ( + pkg_config(pkgname or lib)) if options.__dict__[shared_lib + '_includes']: output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] @@ -1654,11 +1655,8 @@ def make_bin_override(): configure_library('zlib', output) configure_library('http_parser', output) configure_library('libuv', output) -configure_library('libcares', output) -configure_library('nghttp2', output) -# stay backwards compatible with shared cares builds -output['variables']['node_shared_cares'] = \ - output['variables'].pop('node_shared_libcares') +configure_library('cares', output, pkgname='libcares') +configure_library('nghttp2', output, pkgname='libnghttp2') configure_v8(output) configure_openssl(output) configure_intl(output) From ae813602142fc4e4d31e2c4ecc7b5ef5b481a558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 27 Oct 2019 10:39:42 +0100 Subject: [PATCH 44/65] doc: update AUTHORS list PR-URL: https://github.com/nodejs/node/pull/30142 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Jiawen Geng Reviewed-By: Gireesh Punathil --- .mailmap | 3 +++ AUTHORS | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 6d7e00af1a482f..e140392b723514 100644 --- a/.mailmap +++ b/.mailmap @@ -270,6 +270,7 @@ Miguel Angel Asencio Hurtado maasencioh Mike Kaufman Minqi Pan P.S.V.R +Minuk Park Minwoo Jung JungMinu Minwoo Jung Minwoo Jung @@ -338,6 +339,7 @@ Santiago Gimeno Sarah Meyer sarahmeyer Sartrey Lee sartrey Saúl Ibarra Corretgé +Shobhit Chittora Scott Blomquist Segu Riluvan Sergey Kryzhanovsky @@ -384,6 +386,7 @@ Takahiro ANDO Tarun Batra Tarun Ted Young Teppei Sato +Theotime Poisseau Thomas Hunter II Thomas Lee Thomas Reggi diff --git a/AUTHORS b/AUTHORS index 908ef597485387..a3d620f2f9c392 100644 --- a/AUTHORS +++ b/AUTHORS @@ -773,7 +773,7 @@ Minqi Pan Jacob Edelman Mike Atkins hackerjs <4141095@qq.com> -Minwoo Jung +Minwoo Jung Marcin Cieślak Anne-Gaelle Colom Oleksandr Chekhovskyi @@ -2653,7 +2653,6 @@ Furqan Shaikh Roy Sommer James Bunton Kevin Smith -Minwoo Jung H1Gdev Julian Alimin Lakshmi Swetha Gopireddy @@ -2847,5 +2846,25 @@ Levhita claudiahdz Geoffrey Booth Javier Ledezma +Marian Rusnak <4215517+marian-r@users.noreply.github.com> +Jenia +Anton Gerasimov +rickyes +Simon A. Eugster +TATSUNO Yasuhiro +Robert Jensen +dokugo +Jakob Krigovsky +Sergei Osipov +themez +Maria Paktiti +Unlocked <10186337+TheUnlocked@users.noreply.github.com> +Huachao Mao +Lucas Pardue +Nicolas Thumann <46975855+n-thumann@users.noreply.github.com> +akitsu-sanae +Minuk Park +Jim Schlight +Theotime Poisseau # Generated by tools/update-authors.js From ec7b69ff054c631dc82eb7fca5981d482ba62221 Mon Sep 17 00:00:00 2001 From: Alexandre Ferrando Date: Sat, 26 Oct 2019 16:59:34 +0200 Subject: [PATCH 45/65] src: change env.h includes for forward declarations Due to how the Environment class is used through the codebase, there are a lot of includes referencing either env.h or env-inl.h. This can cause that when any development touches those libraries, a lot of files have to be recompiled. This commit attempts to change those includes by forward declarations when possible to mitigate the issue. Refs: https://github.com/nodejs/node/issues/27531 PR-URL: https://github.com/nodejs/node/pull/30133 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: David Carlier Reviewed-By: Franziska Hinkelmann --- src/connection_wrap.h | 3 ++- src/diagnosticfilename-inl.h | 4 ++-- src/inspector/main_thread_interface.h | 1 - src/inspector_profiler.h | 1 - src/js_stream.h | 3 ++- src/node_crypto_bio.h | 4 +++- src/node_dtrace.h | 3 ++- src/node_perf.h | 4 +++- src/node_stat_watcher.h | 3 ++- src/node_url.h | 1 - src/pipe_wrap.h | 3 ++- src/req_wrap.h | 3 ++- src/stream_base.h | 2 +- src/stream_wrap.h | 4 ++-- src/tcp_wrap.h | 3 ++- src/tls_wrap.h | 2 +- src/tty_wrap.h | 3 ++- src/udp_wrap.h | 3 ++- 18 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/connection_wrap.h b/src/connection_wrap.h index 5b114088760dad..db74dc5df4aa5b 100644 --- a/src/connection_wrap.h +++ b/src/connection_wrap.h @@ -3,12 +3,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "stream_wrap.h" #include "v8.h" namespace node { +class Environment; + template class ConnectionWrap : public LibuvStreamWrap { public: diff --git a/src/diagnosticfilename-inl.h b/src/diagnosticfilename-inl.h index 58a3a933acc605..a0d44fd56bcd60 100644 --- a/src/diagnosticfilename-inl.h +++ b/src/diagnosticfilename-inl.h @@ -4,10 +4,10 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node_internals.h" -#include "env-inl.h" - namespace node { +class Environment; + inline DiagnosticFilename::DiagnosticFilename( Environment* env, const char* prefix, diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index bcea19f3f3937e..78337a25e43808 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -5,7 +5,6 @@ #error("This header can only be used when inspector is enabled") #endif -#include "env.h" #include "inspector_agent.h" #include "node_mutex.h" diff --git a/src/inspector_profiler.h b/src/inspector_profiler.h index 4a21eb3a2d3383..187bc0d1c49a16 100644 --- a/src/inspector_profiler.h +++ b/src/inspector_profiler.h @@ -7,7 +7,6 @@ #error("This header can only be used when inspector is enabled") #endif -#include "env.h" #include "inspector_agent.h" namespace node { diff --git a/src/js_stream.h b/src/js_stream.h index 8198a6bb36a4e1..460ac23bc98b21 100644 --- a/src/js_stream.h +++ b/src/js_stream.h @@ -4,12 +4,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env.h" #include "stream_base.h" #include "v8.h" namespace node { +class Environment; + class JSStream : public AsyncWrap, public StreamBase { public: static void Initialize(v8::Local target, diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index fef91750d541e1..5de943806a9642 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -26,11 +26,13 @@ #include "node_crypto.h" #include "openssl/bio.h" -#include "env.h" #include "util.h" #include "v8.h" namespace node { + +class Environment; + namespace crypto { // This class represents buffers for OpenSSL I/O, implemented as a singly-linked diff --git a/src/node_dtrace.h b/src/node_dtrace.h index cbabe905597cb0..b887542abfc9cf 100644 --- a/src/node_dtrace.h +++ b/src/node_dtrace.h @@ -24,7 +24,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "v8.h" extern "C" { @@ -76,6 +75,8 @@ typedef struct { namespace node { +class Environment; + void InitDTrace(Environment* env); } // namespace node diff --git a/src/node_perf.h b/src/node_perf.h index e8441e3bb72444..c5e45261c2c6fd 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -5,7 +5,6 @@ #include "node.h" #include "node_perf_common.h" -#include "env.h" #include "base_object-inl.h" #include "histogram-inl.h" @@ -15,6 +14,9 @@ #include namespace node { + +class Environment; + namespace performance { using v8::FunctionCallbackInfo; diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h index 3d819b45787e98..9669806ce796c9 100644 --- a/src/node_stat_watcher.h +++ b/src/node_stat_watcher.h @@ -26,12 +26,13 @@ #include "node.h" #include "handle_wrap.h" -#include "env.h" #include "uv.h" #include "v8.h" namespace node { +class Environment; + class StatWatcher : public HandleWrap { public: static void Initialize(Environment* env, v8::Local target); diff --git a/src/node_url.h b/src/node_url.h index e85ca6e7129f6a..963273f988c983 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -4,7 +4,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "env.h" #include diff --git a/src/pipe_wrap.h b/src/pipe_wrap.h index 473179a4f6fba0..53008b0d165044 100644 --- a/src/pipe_wrap.h +++ b/src/pipe_wrap.h @@ -26,10 +26,11 @@ #include "async_wrap.h" #include "connection_wrap.h" -#include "env.h" namespace node { +class Environment; + class PipeWrap : public ConnectionWrap { public: enum SocketType { diff --git a/src/req_wrap.h b/src/req_wrap.h index c20912cc95e22f..36eeb1cbc24005 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -4,12 +4,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env.h" #include "util.h" #include "v8.h" namespace node { +class Environment; + class ReqWrapBase { public: explicit inline ReqWrapBase(Environment* env); diff --git a/src/stream_base.h b/src/stream_base.h index 3bfdaedb791ca9..3df9e99f6e438e 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -3,7 +3,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "async_wrap-inl.h" #include "node.h" #include "util.h" @@ -13,6 +12,7 @@ namespace node { // Forward declarations +class Environment; class ShutdownWrap; class WriteWrap; class StreamBase; diff --git a/src/stream_wrap.h b/src/stream_wrap.h index 19366ff4fba2c4..37f5af46066181 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -25,14 +25,14 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "stream_base.h" - -#include "env.h" #include "handle_wrap.h" #include "string_bytes.h" #include "v8.h" namespace node { +class Environment; + class LibuvStreamWrap : public HandleWrap, public StreamBase { public: static void Initialize(v8::Local target, diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index 0467a1c3f3bf20..0099eedb4bc629 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -25,11 +25,12 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env.h" #include "connection_wrap.h" namespace node { +class Environment; + class TCPWrap : public ConnectionWrap { public: enum SocketType { diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 631ef8e7c3d8db..14b7327e7d8259 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -27,7 +27,6 @@ #include "node_crypto.h" // SSLWrap #include "async_wrap.h" -#include "env.h" #include "stream_wrap.h" #include "v8.h" @@ -38,6 +37,7 @@ namespace node { // Forward-declarations +class Environment; class WriteWrap; namespace crypto { class SecureContext; diff --git a/src/tty_wrap.h b/src/tty_wrap.h index df0c4b7c145612..fdf07e4242c1f8 100644 --- a/src/tty_wrap.h +++ b/src/tty_wrap.h @@ -24,12 +24,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "uv.h" #include "stream_wrap.h" namespace node { +class Environment; + class TTYWrap : public LibuvStreamWrap { public: static void Initialize(v8::Local target, diff --git a/src/udp_wrap.h b/src/udp_wrap.h index f79fdd9109fd0d..6375ac2d1b8c80 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -25,13 +25,14 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env.h" #include "handle_wrap.h" #include "uv.h" #include "v8.h" namespace node { +class Environment; + class UDPWrap: public HandleWrap { public: enum SocketType { From 14981f5bbac84747bd09a1ac90fae7bcdbec85db Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 27 Oct 2019 15:45:05 +0100 Subject: [PATCH 46/65] tools: git rm -r tools/v8_gypfiles/broken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30149 Reviewed-By: Michaël Zasso Reviewed-By: Ben Noordhuis Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Jiawen Geng --- tools/v8_gypfiles/broken/all.gyp | 29 - tools/v8_gypfiles/broken/coverage_wrapper.py | 38 - tools/v8_gypfiles/broken/gyp_environment.py | 57 - tools/v8_gypfiles/broken/gyp_v8 | 189 --- tools/v8_gypfiles/broken/gyp_v8.py | 41 - tools/v8_gypfiles/broken/mac/asan.gyp | 31 - tools/v8_gypfiles/broken/mkgrokdump.gyp | 27 - tools/v8_gypfiles/broken/parser-shell.gyp | 60 - tools/v8_gypfiles/broken/samples.gyp | 61 - .../broken/set_clang_warning_flags.gypi | 59 - tools/v8_gypfiles/broken/shim_headers.gypi | 73 - tools/v8_gypfiles/broken/standalone.gypi | 1403 ----------------- tools/v8_gypfiles/broken/sysroot_ld_flags.sh | 12 - tools/v8_gypfiles/broken/v8-monolithic.gyp | 55 - .../v8_gypfiles/broken/verify_source_deps.py | 172 -- 15 files changed, 2307 deletions(-) delete mode 100644 tools/v8_gypfiles/broken/all.gyp delete mode 100644 tools/v8_gypfiles/broken/coverage_wrapper.py delete mode 100644 tools/v8_gypfiles/broken/gyp_environment.py delete mode 100644 tools/v8_gypfiles/broken/gyp_v8 delete mode 100644 tools/v8_gypfiles/broken/gyp_v8.py delete mode 100644 tools/v8_gypfiles/broken/mac/asan.gyp delete mode 100644 tools/v8_gypfiles/broken/mkgrokdump.gyp delete mode 100644 tools/v8_gypfiles/broken/parser-shell.gyp delete mode 100644 tools/v8_gypfiles/broken/samples.gyp delete mode 100644 tools/v8_gypfiles/broken/set_clang_warning_flags.gypi delete mode 100644 tools/v8_gypfiles/broken/shim_headers.gypi delete mode 100644 tools/v8_gypfiles/broken/standalone.gypi delete mode 100644 tools/v8_gypfiles/broken/sysroot_ld_flags.sh delete mode 100644 tools/v8_gypfiles/broken/v8-monolithic.gyp delete mode 100644 tools/v8_gypfiles/broken/verify_source_deps.py diff --git a/tools/v8_gypfiles/broken/all.gyp b/tools/v8_gypfiles/broken/all.gyp deleted file mode 100644 index 99248205b600c7..00000000000000 --- a/tools/v8_gypfiles/broken/all.gyp +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2011 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'targets': [ - { - 'target_name': 'All', - 'type': 'none', - 'dependencies': [ - 'd8.gyp:d8', - 'mkgrokdump.gyp:*', - ], - 'conditions': [ - ['component!="shared_library"', { - 'dependencies': [ - 'parser-shell.gyp:parser-shell', - ], - }], - # These items don't compile for Android on Mac. - ['host_os!="mac" or OS!="android"', { - 'dependencies': [ - 'samples.gyp:*', - ], - }], - ] - } - ] -} diff --git a/tools/v8_gypfiles/broken/coverage_wrapper.py b/tools/v8_gypfiles/broken/coverage_wrapper.py deleted file mode 100644 index d5fdee43cfb761..00000000000000 --- a/tools/v8_gypfiles/broken/coverage_wrapper.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# CC/CXX wrapper script that excludes certain file patterns from coverage -# instrumentation. - -import re -import subprocess -import sys - -exclusions = [ - 'buildtools', - 'src/third_party', - 'third_party', - 'test', - 'testing', -] - -def remove_if_exists(string_list, item): - if item in string_list: - string_list.remove(item) - -args = sys.argv[1:] -text = ' '.join(sys.argv[2:]) -for exclusion in exclusions: - if re.search(r'\-o obj/%s[^ ]*\.o' % exclusion, text): - remove_if_exists(args, '-fprofile-arcs') - remove_if_exists(args, '-ftest-coverage') - remove_if_exists(args, '-fsanitize-coverage=func') - remove_if_exists(args, '-fsanitize-coverage=bb') - remove_if_exists(args, '-fsanitize-coverage=edge') - remove_if_exists(args, '-fsanitize-coverage=trace-pc-guard') - remove_if_exists(args, '-fsanitize-coverage=bb,trace-pc-guard') - break - -sys.exit(subprocess.check_call(args)) diff --git a/tools/v8_gypfiles/broken/gyp_environment.py b/tools/v8_gypfiles/broken/gyp_environment.py deleted file mode 100644 index fe6b51f28abbdf..00000000000000 --- a/tools/v8_gypfiles/broken/gyp_environment.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2015 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -Sets up various automatic gyp environment variables. These are used by -gyp_v8 and landmines.py which run at different stages of runhooks. To -make sure settings are consistent between them, all setup should happen here. -""" - -import os -import sys - -SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) -V8_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) - - -def apply_gyp_environment(file_path=None): - """ - Reads in a *.gyp_env file and applies the valid keys to os.environ. - """ - if not file_path or not os.path.exists(file_path): - return - file_contents = open(file_path).read() - try: - file_data = eval(file_contents, {'__builtins__': None}, None) - except SyntaxError, e: - e.filename = os.path.abspath(file_path) - raise - supported_vars = ( 'V8_GYP_FILE', - 'V8_GYP_SYNTAX_CHECK', - 'GYP_DEFINES', - 'GYP_GENERATORS', - 'GYP_GENERATOR_FLAGS', - 'GYP_GENERATOR_OUTPUT', ) - for var in supported_vars: - val = file_data.get(var) - if val: - if var in os.environ: - print 'INFO: Environment value for "%s" overrides value in %s.' % ( - var, os.path.abspath(file_path) - ) - else: - os.environ[var] = val - - -def set_environment(): - """Sets defaults for GYP_* variables.""" - - if 'SKIP_V8_GYP_ENV' not in os.environ: - # Update the environment based on v8.gyp_env - gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env') - apply_gyp_environment(gyp_env_path) - - if not os.environ.get('GYP_GENERATORS'): - # Default to ninja on all platforms. - os.environ['GYP_GENERATORS'] = 'ninja' diff --git a/tools/v8_gypfiles/broken/gyp_v8 b/tools/v8_gypfiles/broken/gyp_v8 deleted file mode 100644 index a0971cce36e610..00000000000000 --- a/tools/v8_gypfiles/broken/gyp_v8 +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# This script is wrapper for V8 that adds some support for how GYP -# is invoked by V8 beyond what can be done in the gclient hooks. - -import argparse -import glob -import os -import platform -import shlex -import sys - -script_dir = os.path.dirname(os.path.realpath(__file__)) -sys.path.insert(0, script_dir) -import gyp_environment - -v8_root = os.path.abspath(os.path.join(script_dir, os.pardir)) - -sys.path.insert(0, os.path.join(v8_root, 'tools', 'gyp', 'pylib')) -import gyp - -# Add paths so that pymod_do_main(...) can import files. -sys.path.insert( - 1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers'))) -sys.path.append( - os.path.abspath(os.path.join(v8_root, 'third_party', 'binutils'))) - -def GetOutputDirectory(): - """Returns the output directory that GYP will use.""" - - # Handle command line generator flags. - parser = argparse.ArgumentParser() - parser.add_argument('-G', dest='genflags', default=[], action='append') - genflags = parser.parse_known_args()[0].genflags - - # Handle generator flags from the environment. - genflags += shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', '')) - - needle = 'output_dir=' - for item in genflags: - if item.startswith(needle): - return item[len(needle):] - - return 'out' - - -def additional_include_files(args=[]): - """ - Returns a list of additional (.gypi) files to include, without - duplicating ones that are already specified on the command line. - """ - # Determine the include files specified on the command line. - # This doesn't cover all the different option formats you can use, - # but it's mainly intended to avoid duplicating flags on the automatic - # makefile regeneration which only uses this format. - specified_includes = set() - for arg in args: - if arg.startswith('-I') and len(arg) > 2: - specified_includes.add(os.path.realpath(arg[2:])) - - result = [] - def AddInclude(path): - if os.path.realpath(path) not in specified_includes: - result.append(path) - - # Always include standalone.gypi - AddInclude(os.path.join(v8_root, 'gypfiles', 'standalone.gypi')) - - # Optionally add supplemental .gypi files if present. - supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi')) - for supplement in supplements: - AddInclude(supplement) - - return result - - -def run_gyp(args): - if gyp.main(args) != 0: - print 'Error running GYP' - sys.exit(rc) - - -if __name__ == '__main__': - args = sys.argv[1:] - - gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION') - if gyp_chromium_no_action == '1': - print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.' - sys.exit(0) - - running_as_hook = '--running-as-hook' - if running_as_hook in args and gyp_chromium_no_action != '0': - print 'GYP is now disabled by default in runhooks.\n' - print 'If you really want to run this, either run ' - print '`python gypfiles/gyp_v8` explicitly by hand ' - print 'or set the environment variable GYP_CHROMIUM_NO_ACTION=0.' - sys.exit(0) - - if running_as_hook in args: - args.remove(running_as_hook) - - gyp_environment.set_environment() - - # This could give false positives since it doesn't actually do real option - # parsing. Oh well. - gyp_file_specified = False - for arg in args: - if arg.endswith('.gyp'): - gyp_file_specified = True - break - - # If we didn't get a file, check an env var, and then fall back to - # assuming 'all.gyp' from the same directory as the script. - if not gyp_file_specified: - gyp_file = os.environ.get('V8_GYP_FILE') - if gyp_file: - # Note that V8_GYP_FILE values can't have backslashes as - # path separators even on Windows due to the use of shlex.split(). - args.extend(shlex.split(gyp_file)) - else: - args.append(os.path.join(script_dir, 'all.gyp')) - - args.extend(['-I' + i for i in additional_include_files(args)]) - - # There shouldn't be a circular dependency relationship between .gyp files - args.append('--no-circular-check') - - # Set the GYP DEPTH variable to the root of the V8 project. - args.append('--depth=' + os.path.relpath(v8_root)) - - # If V8_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check - # to enfore syntax checking. - syntax_check = os.environ.get('V8_GYP_SYNTAX_CHECK') - if syntax_check and int(syntax_check): - args.append('--check') - - print 'Updating projects from gyp files...' - sys.stdout.flush() - - # Generate for the architectures supported on the given platform. - gyp_args = list(args) - gyp_args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()]) - gyp_generators = os.environ.get('GYP_GENERATORS', '') - if platform.system() == 'Linux' and gyp_generators != 'ninja': - # Work around for crbug.com/331475. - for f in glob.glob(os.path.join(v8_root, 'out', 'Makefile.*')): - os.unlink(f) - # --generator-output defines where the Makefile goes. - gyp_args.append('--generator-output=out') - # -Goutput_dir defines where the build output goes, relative to the - # Makefile. Set it to . so that the build output doesn't end up in out/out. - gyp_args.append('-Goutput_dir=.') - - gyp_defines = os.environ.get('GYP_DEFINES', '') - - # Automatically turn on crosscompile support for platforms that need it. - if all(('ninja' in gyp_generators, - 'OS=android' in gyp_defines, - 'GYP_CROSSCOMPILE' not in os.environ)): - os.environ['GYP_CROSSCOMPILE'] = '1' - - run_gyp(gyp_args) diff --git a/tools/v8_gypfiles/broken/gyp_v8.py b/tools/v8_gypfiles/broken/gyp_v8.py deleted file mode 100644 index 462ee674acbbc5..00000000000000 --- a/tools/v8_gypfiles/broken/gyp_v8.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2013 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# This file is (possibly, depending on python version) imported by -# gyp_v8 when GYP_PARALLEL=1 and it creates sub-processes through the -# multiprocessing library. - -# Importing in Python 2.6 (fixed in 2.7) on Windows doesn't search for imports -# that don't end in .py (and aren't directories with an __init__.py). This -# wrapper makes "import gyp_v8" work with those old versions and makes it -# possible to execute gyp_v8.py directly on Windows where the extension is -# useful. - -import os - -path = os.path.abspath(os.path.split(__file__)[0]) -execfile(os.path.join(path, 'gyp_v8')) diff --git a/tools/v8_gypfiles/broken/mac/asan.gyp b/tools/v8_gypfiles/broken/mac/asan.gyp deleted file mode 100644 index 3fc7f58d434915..00000000000000 --- a/tools/v8_gypfiles/broken/mac/asan.gyp +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2015 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'targets': [ - { - 'target_name': 'asan_dynamic_runtime', - 'toolsets': ['target', 'host'], - 'type': 'none', - 'variables': { - # Every target is going to depend on asan_dynamic_runtime, so allow - # this one to depend on itself. - 'prune_self_dependency': 1, - # Path is relative to this GYP file. - 'asan_rtl_mask_path': - '../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin', - 'asan_osx_dynamic': - '<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib', - }, - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)', - 'files': [ - '@ instead of @< to also see clang_warning_flags set in - # targets directly, not just the clang_warning_flags in target_defaults. - 'cflags': [ '>@(clang_warning_flags)' ], - 'cflags!': [ '>@(clang_warning_flags_unset)' ], - 'xcode_settings': { - 'WARNING_CFLAGS': ['>@(clang_warning_flags)'], - 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'], - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'AdditionalOptions': [ '>@(clang_warning_flags)' ], - 'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ], - }, - }, - }], - ['clang==0 and host_clang==1', { - 'target_conditions': [ - ['_toolset=="host"', { - 'cflags': [ '>@(clang_warning_flags)' ], - 'cflags!': [ '>@(clang_warning_flags_unset)' ], - }], - ], - }], - ], -} diff --git a/tools/v8_gypfiles/broken/shim_headers.gypi b/tools/v8_gypfiles/broken/shim_headers.gypi deleted file mode 100644 index 940211c2401c43..00000000000000 --- a/tools/v8_gypfiles/broken/shim_headers.gypi +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2013 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# This file is meant to be included into a target to handle shim headers -# in a consistent manner. To use this the following variables need to be -# defined: -# headers_root_path: string: path to directory containing headers -# header_filenames: list: list of header file names - -{ - 'variables': { - 'shim_headers_path': '<(SHARED_INTERMEDIATE_DIR)/shim_headers/<(_target_name)/<(_toolset)', - 'shim_generator_additional_args%': [], - }, - 'include_dirs++': [ - '<(shim_headers_path)', - ], - 'all_dependent_settings': { - 'include_dirs+++': [ - '<(shim_headers_path)', - ], - }, - 'actions': [ - { - 'variables': { - 'generator_path': '<(DEPTH)/tools/generate_shim_headers/generate_shim_headers.py', - 'generator_args': [ - '--headers-root', '<(headers_root_path)', - '--output-directory', '<(shim_headers_path)', - '<@(shim_generator_additional_args)', - '<@(header_filenames)', - ], - }, - 'action_name': 'generate_<(_target_name)_shim_headers', - 'inputs': [ - '<(generator_path)', - ], - 'outputs': [ - ' Date: Sun, 27 Oct 2019 11:10:58 +0100 Subject: [PATCH 47/65] build: find Python syntax errors in dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed in https://github.com/nodejs/node/issues/30129#issuecomment-546662351, when we vendor in code, we own the Syntax Errors in that code. This PR adds The `.flake8` config file at the root of this repo puts blinders on the linting of our dependencies so this test disables that file before linting. fixup: allow_failures until dependencies pass PR-URL: https://github.com/nodejs/node/pull/30143 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Michaël Zasso Reviewed-By: Jiawen Geng Reviewed-By: Sam Roberts --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8aa321ec1626d8..6c16bdad821f0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,3 +88,15 @@ jobs: - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST}; fi + + - name: "Find syntax errors in our Python dependencies" + language: python + python: 3.8 + install: + - mv .flake8 disabled.flake8 # take the blinders off of flake8 + - python3.8 -m pip install --upgrade pip + - python3.8 -m pip install flake8 + script: + - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + allow_failures: # TODO (cclauss): remove this when dependencies are clean + - name: "Find syntax errors in our Python dependencies" From 104bfb9a38c59e5b464c504f20122c953a0fde2d Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 29 Oct 2019 18:59:09 -0700 Subject: [PATCH 48/65] deps: V8: cherry-pick e5dbc95 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [api] Fix handle leak when getting Context embedder data The `Context::SlowGetAlignedPointerFromEmbedderData()` method returns a pointer, so the fact that it allocates handles is not obvious to the caller. Since this is the slow path anyway, simply add a handle scope inside of it. The tests are also modified to perform the same check for the `Object` equivalent of this method. Change-Id: I5f03c9a7b70b3a17315609df021606a53c9feb2d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1879902 Reviewed-by: Yang Guo Commit-Queue: Yang Guo Cr-Commit-Position: refs/heads/master@{#64583} Refs: https://github.com/v8/v8/commit/e5dbc95cc0bfbd8a3b6d67b9e4ed920cf3c9fe27 Fixes: https://github.com/nodejs/node/issues/30127 PR-URL: https://github.com/nodejs/node/pull/30130 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso --- common.gypi | 2 +- deps/v8/src/api/api.cc | 1 + deps/v8/test/cctest/test-api.cc | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index e6b189f957debb..211b418f98a38b 100644 --- a/common.gypi +++ b/common.gypi @@ -39,7 +39,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.17', + 'v8_embedder_string': '-node.18', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index aa61346d63e33b..8be7f8558c8dde 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -1314,6 +1314,7 @@ void Context::SetEmbedderData(int index, v8::Local value) { void* Context::SlowGetAlignedPointerFromEmbedderData(int index) { const char* location = "v8::Context::GetAlignedPointerFromEmbedderData()"; + HandleScope handle_scope(GetIsolate()); i::Handle data = EmbedderDataFor(this, index, false, location); if (data.is_null()) return nullptr; diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index ae3cf3e8750383..345ee0bfc9de97 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -2955,8 +2955,11 @@ THREADED_TEST(SetAlignedPointerInInternalFields) { obj->SetAlignedPointerInInternalFields(2, indices, values); CcTest::CollectAllGarbage(); - CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromInternalField(0)); - CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromInternalField(1)); + { + v8::SealHandleScope no_handle_leak(isolate); + CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromInternalField(0)); + CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromInternalField(1)); + } indices[0] = 1; indices[1] = 0; @@ -3009,6 +3012,7 @@ THREADED_TEST(EmbedderDataAlignedPointers) { } CcTest::CollectAllGarbage(); for (int i = 0; i < 100; i++) { + v8::SealHandleScope no_handle_leak(env->GetIsolate()); CHECK_EQ(AlignedTestPointer(i), env->GetAlignedPointerFromEmbedderData(i)); } } From bcbcce59831ef631171fda709e62b34ecf3b0fc9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 27 Oct 2019 13:30:30 +0100 Subject: [PATCH 49/65] tools: undefined name opts -> args in gyptest.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ./tools/gyp/gyptest.py:61:47: F821 undefined name 'opts' extra_path = [os.path.abspath(p) for p in opts.path] ^ ``` `opts.path` is an undefined name in this context while `args.path` is used on the preceding line and is defined on line 48. Undefined names have the potential to raise `NameError` at runtime which will halt the script. PR-URL: https://github.com/nodejs/node/pull/30144 Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Jiawen Geng --- tools/gyp/gyptest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gyp/gyptest.py b/tools/gyp/gyptest.py index 9930e78c7b0f1c..1a9ffca7a134ae 100755 --- a/tools/gyp/gyptest.py +++ b/tools/gyp/gyptest.py @@ -58,7 +58,7 @@ def main(argv=None): os.chdir(args.chdir) if args.path: - extra_path = [os.path.abspath(p) for p in opts.path] + extra_path = [os.path.abspath(p) for p in args.path] extra_path = os.pathsep.join(extra_path) os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH'] From e2fb353df3af70241143b41fcf81e8622721656e Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 27 Oct 2019 15:36:21 +0100 Subject: [PATCH 50/65] tools: use print() function in buildbot_run.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30148 Reviewed-By: Richard Lau Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Jiawen Geng Reviewed-By: Luigi Pinca --- tools/gyp/buildbot/buildbot_run.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/gyp/buildbot/buildbot_run.py b/tools/gyp/buildbot/buildbot_run.py index 9a2b71f1b355cf..cdd347d0bcc95a 100755 --- a/tools/gyp/buildbot/buildbot_run.py +++ b/tools/gyp/buildbot/buildbot_run.py @@ -4,6 +4,7 @@ # found in the LICENSE file. """Argument-less script to select what to run on the buildbots.""" +from __future__ import print_function import os import shutil @@ -24,14 +25,14 @@ def CallSubProcess(*args, **kwargs): with open(os.devnull) as devnull_fd: retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs) if retcode != 0: - print '@@@STEP_EXCEPTION@@@' + print('@@@STEP_EXCEPTION@@@') sys.exit(1) def PrepareCmake(): """Build CMake 2.8.8 since the version in Precise is 2.8.7.""" if os.environ['BUILDBOT_CLOBBER'] == '1': - print '@@@BUILD_STEP Clobber CMake checkout@@@' + print('@@@BUILD_STEP Clobber CMake checkout@@@') shutil.rmtree(CMAKE_DIR) # We always build CMake 2.8.8, so no need to do anything @@ -39,10 +40,10 @@ def PrepareCmake(): if os.path.isdir(CMAKE_DIR): return - print '@@@BUILD_STEP Initialize CMake checkout@@@' + print('@@@BUILD_STEP Initialize CMake checkout@@@') os.mkdir(CMAKE_DIR) - print '@@@BUILD_STEP Sync CMake@@@' + print('@@@BUILD_STEP Sync CMake@@@') CallSubProcess( ['git', 'clone', '--depth', '1', @@ -53,7 +54,7 @@ def PrepareCmake(): CMAKE_DIR], cwd=CMAKE_DIR) - print '@@@BUILD_STEP Build CMake@@@' + print('@@@BUILD_STEP Build CMake@@@') CallSubProcess( ['/bin/bash', 'bootstrap', '--prefix=%s' % CMAKE_DIR], cwd=CMAKE_DIR) @@ -74,7 +75,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]): if not format: format = title - print '@@@BUILD_STEP ' + title + '@@@' + print('@@@BUILD_STEP ' + title + '@@@') sys.stdout.flush() env = os.environ.copy() if msvs_version: @@ -89,17 +90,17 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]): retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True) if retcode: # Emit failure tag, and keep going. - print '@@@STEP_FAILURE@@@' + print('@@@STEP_FAILURE@@@') return 1 return 0 def GypBuild(): # Dump out/ directory. - print '@@@BUILD_STEP cleanup@@@' - print 'Removing %s...' % OUT_DIR + print('@@@BUILD_STEP cleanup@@@') + print('Removing %s...' % OUT_DIR) shutil.rmtree(OUT_DIR, ignore_errors=True) - print 'Done.' + print('Done.') retcode = 0 if sys.platform.startswith('linux'): @@ -128,7 +129,7 @@ def GypBuild(): # after the build proper that could be used for cumulative failures), # use that instead of this. This isolates the final return value so # that it isn't misattributed to the last stage. - print '@@@BUILD_STEP failures@@@' + print('@@@BUILD_STEP failures@@@') sys.exit(retcode) From 348ec693ac29980629e846833f615863c7fdf46f Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 27 Oct 2019 14:35:53 +0100 Subject: [PATCH 51/65] tools: fix Python 3 syntax error in mac_tool.py PR-URL: https://github.com/nodejs/node/pull/30146 Reviewed-By: Jiawen Geng Reviewed-By: Shelley Vohr Reviewed-By: David Carlier --- tools/gyp/pylib/gyp/mac_tool.py | 52 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/tools/gyp/pylib/gyp/mac_tool.py b/tools/gyp/pylib/gyp/mac_tool.py index 409c7fedbd2368..e1faa5679f90a2 100755 --- a/tools/gyp/pylib/gyp/mac_tool.py +++ b/tools/gyp/pylib/gyp/mac_tool.py @@ -137,29 +137,25 @@ def _CopyStringsFile(self, source, dest): # semicolon in dictionary. # on invalid files. Do the same kind of validation. import CoreFoundation - s = open(source, 'rb').read() + with open(source, 'rb') as in_file: + s = in_file.read() d = CoreFoundation.CFDataCreate(None, s, len(s)) _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) if error: return - fp = open(dest, 'wb') - fp.write(s.decode(input_code).encode('UTF-16')) - fp.close() + with open(dest, 'wb') as fp: + fp.write(s.decode(input_code).encode('UTF-16')) def _DetectInputEncoding(self, file_name): """Reads the first few bytes from file_name and tries to guess the text encoding. Returns None as a guess if it can't detect it.""" - fp = open(file_name, 'rb') - try: - header = fp.read(3) - except Exception: - fp.close() - return None - fp.close() - if header.startswith("\xFE\xFF"): - return "UTF-16" - elif header.startswith("\xFF\xFE"): + with open(file_name, 'rb') as fp: + try: + header = fp.read(3) + except Exception: + return None + if header.startswith(("\xFE\xFF", "\xFF\xFE")): return "UTF-16" elif header.startswith("\xEF\xBB\xBF"): return "UTF-8" @@ -169,9 +165,8 @@ def _DetectInputEncoding(self, file_name): def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): """Copies the |source| Info.plist to the destination directory |dest|.""" # Read the source Info.plist into memory. - fd = open(source, 'r') - lines = fd.read() - fd.close() + with open(source, 'r') as fd: + lines = fd.read() # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). plist = plistlib.readPlistFromString(lines) @@ -204,17 +199,16 @@ def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): lines = string.replace(lines, evar, evalue) # Remove any keys with values that haven't been replaced. - lines = lines.split('\n') + lines = lines.splitlines() for i in range(len(lines)): if lines[i].strip().startswith("${"): lines[i] = None lines[i - 1] = None - lines = '\n'.join(filter(lambda x: x is not None, lines)) + lines = '\n'.join(line for line in lines if line is not None) # Write out the file with variables replaced. - fd = open(dest, 'w') - fd.write(lines) - fd.close() + with open(dest, 'w') as fd: + fd.write(lines) # Now write out PkgInfo file now that the Info.plist file has been # "compiled". @@ -242,9 +236,8 @@ def _WritePkgInfo(self, info_plist): signature_code = '?' * 4 dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo') - fp = open(dest, 'w') - fp.write('%s%s' % (package_type, signature_code)) - fp.close() + with open(dest, 'w') as fp: + fp.write('%s%s' % (package_type, signature_code)) def ExecFlock(self, lockfile, *cmd_list): """Emulates the most basic behavior of Linux's flock(1).""" @@ -295,9 +288,8 @@ def ExecPackageIosFramework(self, framework): ' module * { export * }\n' \ '}\n' % (binary, binary) - module_file = open(os.path.join(module_path, 'module.modulemap'), "w") - module_file.write(module_template) - module_file.close() + with open(os.path.join(module_path, 'module.modulemap'), "w") as module_file: + module_file.write(module_template) def ExecPackageFramework(self, framework, version): """Takes a path to Something.framework and the Current version of that and @@ -337,7 +329,7 @@ def _Relink(self, dest, link): def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): framework_name = os.path.basename(framework).split('.')[0] - all_headers = map(os.path.abspath, all_headers) + all_headers = [os.path.abspath(header) for header in all_headers] filelist = {} for header in all_headers: filename = os.path.basename(header) @@ -669,7 +661,7 @@ def WriteHmap(output_name, filelist): count = len(filelist) capacity = NextGreaterPowerOf2(count) strings_offset = 24 + (12 * capacity) - max_value_length = len(max(filelist.items(), key=lambda (k,v):len(v))[1]) + max_value_length = max(len(value) for value in filelist.values()) out = open(output_name, "wb") out.write(struct.pack(' Date: Tue, 29 Oct 2019 16:43:35 +0100 Subject: [PATCH 52/65] doc: linkify `.fork()` in cluster documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30163 Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen --- doc/api/cluster.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 179a775074a394..c4a47539472cb3 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -531,7 +531,7 @@ added: v0.7.9 When any of the workers die the cluster module will emit the `'exit'` event. -This can be used to restart the worker by calling `.fork()` again. +This can be used to restart the worker by calling [`.fork()`][] again. ```js cluster.on('exit', (worker, code, signal) => { @@ -760,8 +760,8 @@ changes: * `windowsHide` {boolean} Hide the forked processes console window that would normally be created on Windows systems. **Default:** `false`. -After calling `.setupMaster()` (or `.fork()`) this settings object will contain -the settings, including the default values. +After calling [`.setupMaster()`][] (or [`.fork()`][]) this settings object will +contain the settings, including the default values. This object is not intended to be changed or set manually. @@ -779,11 +779,11 @@ changes: `setupMaster` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. -Any settings changes only affect future calls to `.fork()` and have no +Any settings changes only affect future calls to [`.fork()`][] and have no effect on workers that are already running. The only attribute of a worker that cannot be set via `.setupMaster()` is -the `env` passed to `.fork()`. +the `env` passed to [`.fork()`][]. The defaults above apply to the first call only; the defaults for later calls are the current values at the time of `cluster.setupMaster()` is called. @@ -862,6 +862,8 @@ socket.on('data', (id) => { }); ``` +[`.fork()`]: #cluster_cluster_fork_env +[`.setupMaster()`]: #cluster_cluster_setupmaster_settings [`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback [`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options [`child_process` event: `'exit'`]: child_process.html#child_process_event_exit From 050efebf249310a6fc12aee16dd4190846ff27f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 30 Oct 2019 09:17:40 +0100 Subject: [PATCH 53/65] meta: use contact_links instead of issue templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To redirect people to the help and website repos. PR-URL: https://github.com/nodejs/node/pull/30172 Refs: https://github.blog/changelog/2019-10-28-new-issue-template-configuration-options/ Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Beth Griggs Reviewed-By: Trivikram Kamat Reviewed-By: David Carlier --- .github/ISSUE_TEMPLATE/3-help.md | 10 ---------- .github/ISSUE_TEMPLATE/4-nodejs-org.md | 11 ----------- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 3 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/3-help.md delete mode 100644 .github/ISSUE_TEMPLATE/4-nodejs-org.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/3-help.md b/.github/ISSUE_TEMPLATE/3-help.md deleted file mode 100644 index f1a1acdfc70ba0..00000000000000 --- a/.github/ISSUE_TEMPLATE/3-help.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: "⁉️ Need help with Node.js?" -about: Please file an issue in our help repo. - ---- - -If you have a question about Node.js that is not a bug report or feature -request, please post it in https://github.com/nodejs/help! - -Questions posted to this repository will be closed. diff --git a/.github/ISSUE_TEMPLATE/4-nodejs-org.md b/.github/ISSUE_TEMPLATE/4-nodejs-org.md deleted file mode 100644 index 917e560a50c08e..00000000000000 --- a/.github/ISSUE_TEMPLATE/4-nodejs-org.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: "\U0001F310 Found a problem with nodejs.org?" -about: Please file an issue in the Node.js website repo. - ---- - -If you have a question, suggestion or issue regarding our website, -please post it in https://github.com/nodejs/nodejs.org! - -Issues with the Node.js API documentation should be posted here. All other -issues regarding the website will be closed. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000000..d319d377249b8b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: ⁉️ Need help with Node.js? + url: https://github.com/nodejs/help + about: Please file an issue in our help repo. + - name: 🌐 Found a problem with nodejs.org? + url: https://github.com/nodejs/nodejs.org/issues/new/choose + about: Please file an issue in the Node.js website repo. From a0df91cce110ce7bef4bdc66aca60af04f6b0332 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 25 Oct 2019 21:14:36 -0700 Subject: [PATCH 54/65] src: expose granular SetIsolateUpForNode This PR exposes a new embedder-focused API: SetIsolateUpForNode. It maintains previous behavior for the single-param version of SetIsolateUpForNode and changes no defaults, but was designed to be flexible by allowing for embedders to conditionally override all callbacks and flags set by the previous two-param version of SetIsolateUpForNode. PR-URL: https://github.com/nodejs/node/pull/30150 Reviewed-By: Gus Caplan Reviewed-By: Anna Henningsen Reviewed-By: Franziska Hinkelmann Reviewed-By: David Carlier --- src/api/environment.cc | 74 +++++++++++++++++++++++++-------------- src/node.h | 31 ++++++++++++++++ src/node_internals.h | 4 +-- src/node_main_instance.cc | 12 ++++--- 4 files changed, 88 insertions(+), 33 deletions(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index e6a87d5a93a3b6..846e4a873da51c 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -196,36 +196,56 @@ void SetIsolateCreateParamsForNode(Isolate::CreateParams* params) { } } -void SetIsolateUpForNode(v8::Isolate* isolate, IsolateSettingCategories cat) { - switch (cat) { - case IsolateSettingCategories::kErrorHandlers: - isolate->AddMessageListenerWithErrorLevel( - errors::PerIsolateMessageListener, - Isolate::MessageErrorLevel::kMessageError | - Isolate::MessageErrorLevel::kMessageWarning); - isolate->SetAbortOnUncaughtExceptionCallback( - ShouldAbortOnUncaughtException); - isolate->SetFatalErrorHandler(OnFatalError); - isolate->SetPrepareStackTraceCallback(PrepareStackTraceCallback); - break; - case IsolateSettingCategories::kMisc: - isolate->SetMicrotasksPolicy(MicrotasksPolicy::kExplicit); - isolate->SetAllowWasmCodeGenerationCallback( - AllowWasmCodeGenerationCallback); - isolate->SetPromiseRejectCallback(task_queue::PromiseRejectCallback); - isolate->SetHostCleanupFinalizationGroupCallback( - HostCleanupFinalizationGroupCallback); - v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); - break; - default: - UNREACHABLE(); - break; - } +void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) { + if (s.flags & MESSAGE_LISTENER_WITH_ERROR_LEVEL) + isolate->AddMessageListenerWithErrorLevel( + errors::PerIsolateMessageListener, + Isolate::MessageErrorLevel::kMessageError | + Isolate::MessageErrorLevel::kMessageWarning); + + auto* abort_callback = s.should_abort_on_uncaught_exception_callback ? + s.should_abort_on_uncaught_exception_callback : + ShouldAbortOnUncaughtException; + isolate->SetAbortOnUncaughtExceptionCallback(abort_callback); + + auto* fatal_error_cb = s.fatal_error_callback ? + s.fatal_error_callback : OnFatalError; + isolate->SetFatalErrorHandler(fatal_error_cb); + + auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ? + s.prepare_stack_trace_callback : PrepareStackTraceCallback; + isolate->SetPrepareStackTraceCallback(prepare_stack_trace_cb); +} + +void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) { + isolate->SetMicrotasksPolicy(s.policy); + + auto* allow_wasm_codegen_cb = s.allow_wasm_code_generation_callback ? + s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback; + isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb); + + auto* promise_reject_cb = s.promise_reject_callback ? + s.promise_reject_callback : task_queue::PromiseRejectCallback; + isolate->SetPromiseRejectCallback(promise_reject_cb); + + auto* host_cleanup_cb = s.host_cleanup_finalization_group_callback ? + s.host_cleanup_finalization_group_callback : + HostCleanupFinalizationGroupCallback; + isolate->SetHostCleanupFinalizationGroupCallback(host_cleanup_cb); + + if (s.flags & DETAILED_SOURCE_POSITIONS_FOR_PROFILING) + v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); +} + +void SetIsolateUpForNode(v8::Isolate* isolate, + const IsolateSettings& settings) { + SetIsolateErrorHandlers(isolate, settings); + SetIsolateMiscHandlers(isolate, settings); } void SetIsolateUpForNode(v8::Isolate* isolate) { - SetIsolateUpForNode(isolate, IsolateSettingCategories::kErrorHandlers); - SetIsolateUpForNode(isolate, IsolateSettingCategories::kMisc); + IsolateSettings settings; + SetIsolateUpForNode(isolate, settings); } Isolate* NewIsolate(ArrayBufferAllocator* allocator, uv_loop_t* event_loop) { diff --git a/src/node.h b/src/node.h index cae0673a37f80e..240399d1ed5f6a 100644 --- a/src/node.h +++ b/src/node.h @@ -291,9 +291,40 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { NODE_EXTERN void SetIsolateCreateParams(v8::Isolate::CreateParams* params, ArrayBufferAllocator* allocator = nullptr); + +enum IsolateSettingsFlags { + MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0, + DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1 +}; + +struct IsolateSettings { + uint64_t flags = MESSAGE_LISTENER_WITH_ERROR_LEVEL | + DETAILED_SOURCE_POSITIONS_FOR_PROFILING; + v8::MicrotasksPolicy policy = v8::MicrotasksPolicy::kExplicit; + + // Error handling callbacks + v8::Isolate::AbortOnUncaughtExceptionCallback + should_abort_on_uncaught_exception_callback = nullptr; + v8::FatalErrorCallback fatal_error_callback = nullptr; + v8::PrepareStackTraceCallback prepare_stack_trace_callback = nullptr; + + // Miscellaneous callbacks + v8::PromiseRejectCallback promise_reject_callback = nullptr; + v8::AllowWasmCodeGenerationCallback + allow_wasm_code_generation_callback = nullptr; + v8::HostCleanupFinalizationGroupCallback + host_cleanup_finalization_group_callback = nullptr; +}; + +// Overriding IsolateSettings may produce unexpected behavior +// in Node.js core functionality, so proceed at your own risk. +NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate, + const IsolateSettings& settings); + // Set a number of callbacks for the `isolate`, in particular the Node.js // uncaught exception listener. NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate); + // Creates a new isolate with Node.js-specific settings. // This is a convenience method equivalent to using SetIsolateCreateParams(), // Isolate::Allocate(), MultiIsolatePlatform::RegisterIsolate(), diff --git a/src/node_internals.h b/src/node_internals.h index 0f4c32bb941a31..4ec883c8913e45 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -296,8 +296,8 @@ struct InitializationResult { }; InitializationResult InitializeOncePerProcess(int argc, char** argv); void TearDownOncePerProcess(); -enum class IsolateSettingCategories { kErrorHandlers, kMisc }; -void SetIsolateUpForNode(v8::Isolate* isolate, IsolateSettingCategories cat); +void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s); +void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s); void SetIsolateCreateParamsForNode(v8::Isolate::CreateParams* params); #if HAVE_INSPECTOR diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index 0744063e0dc3a9..1c1a09280b70d8 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -30,7 +30,9 @@ NodeMainInstance::NodeMainInstance(Isolate* isolate, owns_isolate_(false), deserialize_mode_(false) { isolate_data_.reset(new IsolateData(isolate_, event_loop, platform, nullptr)); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kMisc); + + IsolateSettings misc; + SetIsolateMiscHandlers(isolate_, misc); } std::unique_ptr NodeMainInstance::Create( @@ -74,11 +76,12 @@ NodeMainInstance::NodeMainInstance( platform, array_buffer_allocator_.get(), per_isolate_data_indexes)); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kMisc); + IsolateSettings s; + SetIsolateMiscHandlers(isolate_, s); if (!deserialize_mode_) { // If in deserialize mode, delay until after the deserialization is // complete. - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kErrorHandlers); + SetIsolateErrorHandlers(isolate_, s); } } @@ -182,7 +185,8 @@ std::unique_ptr NodeMainInstance::CreateMainEnvironment( context = Context::FromSnapshot(isolate_, kNodeContextIndex).ToLocalChecked(); InitializeContextRuntime(context); - SetIsolateUpForNode(isolate_, IsolateSettingCategories::kErrorHandlers); + IsolateSettings s; + SetIsolateErrorHandlers(isolate_, s); } else { context = NewContext(isolate_); } From cc1cd2b3c5a772743dd289b1a51281bd1db62ef9 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 30 Oct 2019 10:52:45 -0700 Subject: [PATCH 55/65] src: isolate->Dispose() order consistency PR-URL: https://github.com/nodejs/node/pull/30181 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: David Carlier --- src/node.h | 3 ++- src/node_worker.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node.h b/src/node.h index 240399d1ed5f6a..872e0a811a608b 100644 --- a/src/node.h +++ b/src/node.h @@ -273,10 +273,11 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { // This function may only be called once per `Isolate`. virtual void RegisterIsolate(v8::Isolate* isolate, struct uv_loop_s* loop) = 0; - // This needs to be called right before calling `Isolate::Dispose()`. + // This function may only be called once per `Isolate`, and discard any // pending delayed tasks scheduled for that isolate. virtual void UnregisterIsolate(v8::Isolate* isolate) = 0; + // The platform should call the passed function once all state associated // with the given isolate has been cleaned up. This can, but does not have to, // happen asynchronously. diff --git a/src/node_worker.cc b/src/node_worker.cc index 025b5fed49cbb5..af79540631f153 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -155,9 +155,9 @@ class WorkerThreadData { w_->platform_->AddIsolateFinishedCallback(isolate, [](void* data) { *static_cast(data) = true; }, &platform_finished); - w_->platform_->UnregisterIsolate(isolate); isolate->Dispose(); + w_->platform_->UnregisterIsolate(isolate); // Wait until the platform has cleaned up all relevant resources. while (!platform_finished) From 03827ddf38fda88b29f6d177be2fc59a201d14c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 31 Oct 2019 12:01:26 +0100 Subject: [PATCH 56/65] build: allow Python 3.8 PR-URL: https://github.com/nodejs/node/pull/30194 Reviewed-By: Christian Clauss Reviewed-By: Anna Henningsen Reviewed-By: David Carlier Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Jiawen Geng --- BUILDING.md | 4 ++-- configure | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 006c21521df1f5..3a484c42e04d19 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -246,7 +246,7 @@ transition before the year-end deadline. * GNU Make 3.81 or newer * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, and 3.7 are experimental. + * Python 3.5, 3.6, 3.7, and 3.8 are experimental. Installation via Linux package manager can be achieved with: @@ -262,7 +262,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`. * Xcode Command Line Tools >= 10 for macOS * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, and 3.7 are experimental. + * Python 3.5, 3.6, 3.7, and 3.8 are experimental. macOS users can install the `Xcode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode diff --git a/configure b/configure index d1d7ff62ed3428..f199a353482bec 100755 --- a/configure +++ b/configure @@ -7,6 +7,7 @@ # pyenv will alert which shims are available and then will fail the build. _=[ 'exec' '/bin/sh' '-c' ''' test ${TRAVIS} && exec python "$0" "$@" # workaround for pyenv on Travis CI +which python3.8 >/dev/null && exec python3.8 "$0" "$@" which python3.7 >/dev/null && exec python3.7 "$0" "$@" which python3.6 >/dev/null && exec python3.6 "$0" "$@" which python3.5 >/dev/null && exec python3.5 "$0" "$@" @@ -20,7 +21,7 @@ import sys from distutils.spawn import find_executable print('Node configure: Found Python {0}.{1}.{2}...'.format(*sys.version_info)) -acceptable_pythons = ((2, 7), (3, 7), (3, 6), (3, 5)) +acceptable_pythons = ((3, 8), (3, 7), (3, 6), (3, 5), (2, 7)) if sys.version_info[:2] in acceptable_pythons: import configure else: From b7070f315f6b405a5166235d4330ae94d720bd0d Mon Sep 17 00:00:00 2001 From: dev-313 Date: Wed, 30 Oct 2019 18:55:59 +0530 Subject: [PATCH 57/65] doc: explain http2 aborted event callback Line added in the description of http2 aborted event that it's listener does not expect any arguments. Refs: https://github.com/nodejs/help/issues/877 PR-URL: https://github.com/nodejs/node/pull/30179 Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat --- doc/api/http2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 07ca77e30f5e30..53461ac58d4605 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -938,6 +938,7 @@ added: v8.4.0 The `'aborted'` event is emitted whenever a `Http2Stream` instance is abnormally aborted in mid-communication. +Its listener does not expect any arguments. The `'aborted'` event will only be emitted if the `Http2Stream` writable side has not been ended. From 201a60e6ba843c05bff40d04f2b2a6685dc12d5d Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 1 Nov 2019 07:36:14 -0700 Subject: [PATCH 58/65] doc: linkify `.setupMaster()` in cluster doc Refs: https://github.com/nodejs/node/pull/30163 PR-URL: https://github.com/nodejs/node/pull/30204 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: David Carlier Reviewed-By: Gireesh Punathil --- doc/api/cluster.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index c4a47539472cb3..112da9b2aa402e 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -644,11 +644,11 @@ added: v0.7.1 * `settings` {Object} -Emitted every time `.setupMaster()` is called. +Emitted every time [`.setupMaster()`][] is called. The `settings` object is the `cluster.settings` object at the time -`.setupMaster()` was called and is advisory only, since multiple calls to -`.setupMaster()` can be made in a single tick. +[`.setupMaster()`][] was called and is advisory only, since multiple calls to +[`.setupMaster()`][] can be made in a single tick. If accuracy is important, use `cluster.settings`. @@ -710,7 +710,7 @@ added: v0.11.2 The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a global setting and effectively frozen once either the first worker is spawned, -or `cluster.setupMaster()` is called, whichever comes first. +or [`.setupMaster()`][] is called, whichever comes first. `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively From fc407bb5555cab4ef9bcbe000ab4e460b29fd2ed Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 30 Oct 2019 21:35:51 -0400 Subject: [PATCH 59/65] doc: add missing hash for header link The link is to a heading in the file, but is missing the # PR-URL: https://github.com/nodejs/node/pull/30188 Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat --- doc/guides/cve_management_process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guides/cve_management_process.md b/doc/guides/cve_management_process.md index 059d15f1f91f9e..1b87215ac722f2 100644 --- a/doc/guides/cve_management_process.md +++ b/doc/guides/cve_management_process.md @@ -82,7 +82,7 @@ after we get HackerOne up and running). * Review the request. * If a CVE is appropriate then assign the CVE as outline in the section titled - [CVE Management process for Node.js vulnerabilities](cve-management-process-for-nodejs-vulnerabilities) + [CVE Management process for Node.js vulnerabilities](#cve-management-process-for-nodejs-vulnerabilities) and return the CVE number to the requester (along with the request to keep it confidential until the vulnerability is announced) * If a CVE is not appropriate then respond to the requester From 68e4b5a1fc1324b4255c803ad758439a3c316a92 Mon Sep 17 00:00:00 2001 From: Loris Zinsou Date: Fri, 1 Nov 2019 17:28:15 +0100 Subject: [PATCH 60/65] tools: fix Python 3 deprecation warning in test.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30208 Reviewed-By: Christian Clauss Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: David Carlier --- tools/test.py | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/tools/test.py b/tools/test.py index 04babded24b590..b928662decf36c 100755 --- a/tools/test.py +++ b/tools/test.py @@ -29,7 +29,6 @@ from __future__ import print_function -import imp import logging import optparse import os @@ -45,6 +44,27 @@ import errno import copy + +if sys.version_info >= (3, 5): + from importlib import machinery, util + def get_module(name, path): + loader_details = (machinery.SourceFileLoader, machinery.SOURCE_SUFFIXES) + spec = machinery.FileFinder(path, loader_details).find_spec(name) + module = util.module_from_spec(spec) + spec.loader.exec_module(module) + return module +else: + import imp + def get_module(name, path): + file = None + try: + (file, pathname, description) = imp.find_module(name, [path]) + return imp.load_module(name, file, pathname, description) + finally: + if file: + file.close() + + from io import open from os.path import join, dirname, abspath, basename, isdir, exists from datetime import datetime @@ -791,18 +811,13 @@ def GetConfiguration(self, context): if self.is_loaded: return self.config self.is_loaded = True - file = None - try: - (file, pathname, description) = imp.find_module('testcfg', [ self.path ]) - module = imp.load_module('testcfg', file, pathname, description) - self.config = module.GetConfiguration(context, self.path) - if hasattr(self.config, 'additional_flags'): - self.config.additional_flags += context.node_args - else: - self.config.additional_flags = context.node_args - finally: - if file: - file.close() + + module = get_module('testcfg', self.path) + self.config = module.GetConfiguration(context, self.path) + if hasattr(self.config, 'additional_flags'): + self.config.additional_flags += context.node_args + else: + self.config.additional_flags = context.node_args return self.config def GetBuildRequirements(self, path, context): From 46c9194ec801f427960a270d64da1c06101dac52 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 3 Nov 2019 17:09:54 +0100 Subject: [PATCH 61/65] deps: V8: cherry-pick a7dffcd767be MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [postmortem] Load files using utf-8 to support Python 3 Change-Id: I174d38cc33210c07d1a7596627e1b2d21bb06313 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1895560 Reviewed-by: Mathias Bynens Commit-Queue: Michaël Zasso Cr-Commit-Position: refs/heads/master@{#64717} Refs: https://github.com/v8/v8/commit/a7dffcd767be6e6122dd3911c8388b5ff76ac590 PR-URL: https://github.com/nodejs/node/pull/30218 Reviewed-By: Richard Lau Reviewed-By: David Carlier Reviewed-By: Colin Ihrig Reviewed-By: Chengzhong Wu Reviewed-By: Joyee Cheung --- common.gypi | 2 +- deps/v8/tools/gen-postmortem-metadata.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 211b418f98a38b..b5df26fd2be34f 100644 --- a/common.gypi +++ b/common.gypi @@ -39,7 +39,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.18', + 'v8_embedder_string': '-node.19', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 8724b988f0f2fe..ceaf7798fd32c2 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -49,6 +49,7 @@ # for py2/py3 compatibility from __future__ import print_function +import io import re import sys @@ -382,7 +383,7 @@ def load_objects(): def load_objects_from_file(objfilename, checktypes): - objfile = open(objfilename, 'r'); + objfile = io.open(objfilename, 'r', encoding='utf-8'); in_insttype = False; typestr = ''; @@ -577,7 +578,7 @@ def load_fields(): def load_fields_from_file(filename): - inlfile = open(filename, 'r'); + inlfile = io.open(filename, 'r', encoding='utf-8'); # # Each class's fields and the corresponding offsets are described in the From 8860bd68b6af7ba33ee063e88f013477794d7d5a Mon Sep 17 00:00:00 2001 From: Jizu Sun Date: Sun, 3 Nov 2019 19:45:32 +0800 Subject: [PATCH 62/65] buffer: improve performance caused by primordials This is my first PR, and it's based on the code-and-learn guidances This restore some performance after introducing primordialias. Refs: https://github.com/nodejs/node/issues/29766 Refs: https://github.com/nodejs/code-and-learn/issues/97 Refs: https://github.com/nodejs/node/pull/29633 PR-URL: https://github.com/nodejs/node/pull/30235 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Gireesh Punathil Reviewed-By: Chengzhong Wu Reviewed-By: David Carlier Reviewed-By: Anna Henningsen Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat --- lib/buffer.js | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index ce2d7c63b5b911..ab30db67010107 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -21,7 +21,19 @@ 'use strict'; -const { Math, Object } = primordials; +const { + Object: { + defineProperties: ObjectDefineProperties, + defineProperty: ObjectDefineProperty, + setPrototypeOf: ObjectSetPrototypeOf, + create: ObjectCreate + }, + Math: { + floor: MathFloor, + trunc: MathTrunc, + min: MathMin + } +} = primordials; const { byteLengthUtf8, @@ -89,7 +101,7 @@ FastBuffer.prototype.constructor = Buffer; Buffer.prototype = FastBuffer.prototype; addBufferPrototypeMethods(Buffer.prototype); -const constants = Object.defineProperties({}, { +const constants = ObjectDefineProperties({}, { MAX_LENGTH: { value: kMaxLength, writable: false, @@ -111,7 +123,7 @@ let poolSize, poolOffset, allocPool; // do not own the ArrayBuffer allocator. Zero fill is always on in that case. const zeroFill = bindingZeroFill || [0]; -const encodingsMap = Object.create(null); +const encodingsMap = ObjectCreate(null); for (let i = 0; i < encodings.length; ++i) encodingsMap[encodings[i]] = i; @@ -168,7 +180,7 @@ function toInteger(n, defaultVal) { if (!Number.isNaN(n) && n >= Number.MIN_SAFE_INTEGER && n <= Number.MAX_SAFE_INTEGER) { - return ((n % 1) === 0 ? n : Math.floor(n)); + return ((n % 1) === 0 ? n : MathFloor(n)); } return defaultVal; } @@ -253,7 +265,7 @@ function Buffer(arg, encodingOrOffset, length) { return Buffer.from(arg, encodingOrOffset, length); } -Object.defineProperty(Buffer, Symbol.species, { +ObjectDefineProperty(Buffer, Symbol.species, { enumerable: false, configurable: true, get() { return FastBuffer; } @@ -311,7 +323,7 @@ const of = (...items) => { }; Buffer.of = of; -Object.setPrototypeOf(Buffer, Uint8Array); +ObjectSetPrototypeOf(Buffer, Uint8Array); // The 'assertSize' method will remove itself from the callstack when an error // occurs. This is done simply to keep the internal details of the @@ -364,8 +376,8 @@ function SlowBuffer(length) { return createUnsafeBuffer(length); } -Object.setPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype); -Object.setPrototypeOf(SlowBuffer, Uint8Array); +ObjectSetPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype); +ObjectSetPrototypeOf(SlowBuffer, Uint8Array); function allocate(size) { if (size <= 0) { @@ -712,7 +724,7 @@ function byteLength(string, encoding) { Buffer.byteLength = byteLength; // For backwards compatibility. -Object.defineProperty(Buffer.prototype, 'parent', { +ObjectDefineProperty(Buffer.prototype, 'parent', { enumerable: true, get() { if (!(this instanceof Buffer)) @@ -720,7 +732,7 @@ Object.defineProperty(Buffer.prototype, 'parent', { return this.buffer; } }); -Object.defineProperty(Buffer.prototype, 'offset', { +ObjectDefineProperty(Buffer.prototype, 'offset', { enumerable: true, get() { if (!(this instanceof Buffer)) @@ -789,7 +801,7 @@ let INSPECT_MAX_BYTES = 50; // Override how buffers are presented by util.inspect(). Buffer.prototype[customInspectSymbol] = function inspect(recurseTimes, ctx) { const max = INSPECT_MAX_BYTES; - const actualMax = Math.min(max, this.length); + const actualMax = MathMin(max, this.length); const remaining = this.length - max; let str = this.hexSlice(0, actualMax).replace(/(.{2})/g, '$1 ').trim(); if (remaining > 0) @@ -802,7 +814,7 @@ Buffer.prototype[customInspectSymbol] = function inspect(recurseTimes, ctx) { extras = true; obj[key] = this[key]; return obj; - }, Object.create(null)); + }, ObjectCreate(null)); if (extras) { if (this.length !== 0) str += ', '; @@ -1042,7 +1054,7 @@ Buffer.prototype.toJSON = function toJSON() { function adjustOffset(offset, length) { // Use Math.trunc() to convert offset to an integer value that can be larger // than an Int32. Hence, don't use offset | 0 or similar techniques. - offset = Math.trunc(offset); + offset = MathTrunc(offset); if (offset === 0) { return 0; } @@ -1163,7 +1175,7 @@ module.exports = { kStringMaxLength }; -Object.defineProperties(module.exports, { +ObjectDefineProperties(module.exports, { constants: { configurable: false, enumerable: true, From 49e7f042f9bdbd5a62d5410c1871b73799963f94 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Sat, 2 Nov 2019 23:27:48 +0800 Subject: [PATCH 63/65] build: add workaround for WSL Signed-off-by: gengjiawen PR-URL: https://github.com/nodejs/node/pull/30221 Fixes: https://github.com/nodejs/node/issues/30189 Reviewed-By: Christian Clauss Reviewed-By: Richard Lau --- BUILDING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 3a484c42e04d19..0df731b099e5c5 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -282,6 +282,11 @@ $ ./configure $ make -j4 ``` +If you run into a `No module named 'distutils.spawn'` error when executing +`./configure`, please try `python3 -m pip install --upgrade setuptools` or +`sudo apt install python3-distutils -y`. +For more information, see https://github.com/nodejs/node/issues/30189. + The `-j4` option will cause `make` to run 4 simultaneous compilation jobs which may reduce build time. For more information, see the [GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html). From 1bded9841c24bf2f119ad61c88b7ad3703ec0d0c Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 25 Oct 2019 17:13:49 +0100 Subject: [PATCH 64/65] build: fix detection of Visual Studio 2017 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When run in a Visual Studio 2017 command prompt the `VCINSTALLDIR` environment variable will be already set and is not cleared by the `tools/msvs/vswhere_usability_wrapper.cmd` utility when it fails to find Visual Studio 2019. This causes `vcbuild.bat` to incorrectly assume Visual Studio 2019 and generate an incompatible configuration. Clearing the value of `VCINSTALLDIR` before calling the utility fixes the detection logic. PR-URL: https://github.com/nodejs/node/pull/30119 Fixes: https://github.com/nodejs/node/issues/30118 Refs: https://github.com/nodejs/node/pull/30022 Reviewed-By: James M Snell Reviewed-By: Michaël Zasso Reviewed-By: João Reis --- vcbuild.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 57f2deba799d57..10c9ef34bb6a40 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -240,6 +240,10 @@ if %target_arch%==x86 if %msvs_host_arch%==x86 set vcvarsall_arg=x86 :vs-set-2019 if defined target_env if "%target_env%" NEQ "vs2019" goto vs-set-2017 echo Looking for Visual Studio 2019 +@rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be +@rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to +@rem detect the version searched for +set "VCINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017 if defined msi ( From 64eacd8741f23cb91569faf7ec793c83badb04e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 5 Nov 2019 10:55:13 +0100 Subject: [PATCH 65/65] 2019-11-05, Version 13.1.0 (Current) Notable changes: * cli: * Added a new flag (`--trace-uncaught`) that makes Node.js print the stack trace at the time of throwing uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. https://github.com/nodejs/node/pull/30025 * crypto * Added `Hash.prototype.copy()` method. It returns a new `Hash` object with its internal state cloned from the original one. https://github.com/nodejs/node/pull/29910 * dgram * Added source-specific multicast support. This adds methods to Datagram sockets to support RFC 4607 (https://tools.ietf.org/html/rfc4607) for IPv4 and IPv6. https://github.com/nodejs/node/pull/15735 * fs * Added a `bufferSize` option to `fs.opendir()`. It allows to control the number of entries that are buffered internally when reading from the directory. https://github.com/nodejs/node/pull/30114 * meta * Added Chengzhong Wu (https://github.com/legendecas) to collaborators. https://github.com/nodejs/node/pull/30115 PR-URL: https://github.com/nodejs/node/pull/30262 --- CHANGELOG.md | 3 +- doc/api/cli.md | 4 +- doc/api/crypto.md | 2 +- doc/api/dgram.md | 4 +- doc/api/fs.md | 6 +-- doc/api/http.md | 2 +- doc/changelogs/CHANGELOG_V13.md | 93 +++++++++++++++++++++++++++++++++ src/node_version.h | 6 +-- 8 files changed, 107 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fca5a1818eb8d6..0b5817827fd274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,8 @@ release.
@@ -29,6 +31,97 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2019-11-05, Version 13.1.0 (Current), @targos + +### Notable Changes + +* **cli**: + * Added a new flag (`--trace-uncaught`) that makes Node.js print the stack + trace at the time of throwing uncaught exceptions, rather than at the + creation of the `Error` object, if there is any. This is disabled by default + because it affects GC behavior (Anna Henningsen) [#30025](https://github.com/nodejs/node/pull/30025). +* **crypto**: + * Added `Hash.prototype.copy()` method. It returns a new `Hash` object with + its internal state cloned from the original one (Ben Noordhuis) [#29910](https://github.com/nodejs/node/pull/29910). +* **dgram**: + * Added source-specific multicast support. This adds methods to Datagram + sockets to support [RFC 4607](https://tools.ietf.org/html/rfc4607) for IPv4 + and IPv6 (Lucas Pardue) [#15735](https://github.com/nodejs/node/pull/15735). +* **fs**: + * Added a `bufferSize` option to `fs.opendir()`. It allows to control the + number of entries that are buffered internally when reading from the + directory (Anna Henningsen) [#30114](https://github.com/nodejs/node/pull/30114). +* **meta**: + * Added [Chengzhong Wu](https://github.com/legendecas) to collaborators [#30115](https://github.com/nodejs/node/pull/30115). + +### Commits + +* [[`445837851b`](https://github.com/nodejs/node/commit/445837851b)] - **async_hooks**: only emit `after` for AsyncResource if stack not empty (Anna Henningsen) [#30087](https://github.com/nodejs/node/pull/30087) +* [[`8860bd68b6`](https://github.com/nodejs/node/commit/8860bd68b6)] - **buffer**: improve performance caused by primordials (Jizu Sun) [#30235](https://github.com/nodejs/node/pull/30235) +* [[`1bded9841c`](https://github.com/nodejs/node/commit/1bded9841c)] - **build**: fix detection of Visual Studio 2017 (Richard Lau) [#30119](https://github.com/nodejs/node/pull/30119) +* [[`49e7f042f9`](https://github.com/nodejs/node/commit/49e7f042f9)] - **build**: add workaround for WSL (gengjiawen) [#30221](https://github.com/nodejs/node/pull/30221) +* [[`03827ddf38`](https://github.com/nodejs/node/commit/03827ddf38)] - **build**: allow Python 3.8 (Michaël Zasso) [#30194](https://github.com/nodejs/node/pull/30194) +* [[`54698113c0`](https://github.com/nodejs/node/commit/54698113c0)] - **build**: find Python syntax errors in dependencies (Christian Clauss) [#30143](https://github.com/nodejs/node/pull/30143) +* [[`b255688d5f`](https://github.com/nodejs/node/commit/b255688d5f)] - **build**: fix pkg-config search for libnghttp2 (Ben Noordhuis) [#30145](https://github.com/nodejs/node/pull/30145) +* [[`8980d8c25f`](https://github.com/nodejs/node/commit/8980d8c25f)] - **build**: vcbuild uses default Python, not Py2 (João Reis) [#30091](https://github.com/nodejs/node/pull/30091) +* [[`cedad02406`](https://github.com/nodejs/node/commit/cedad02406)] - **build**: prefer python 3 over 2 for configure (Sam Roberts) [#30091](https://github.com/nodejs/node/pull/30091) +* [[`5ba842b8f9`](https://github.com/nodejs/node/commit/5ba842b8f9)] - **build**: python3 support for configure (Rod Vagg) [#30047](https://github.com/nodejs/node/pull/30047) +* [[`d05f67caef`](https://github.com/nodejs/node/commit/d05f67caef)] - **cli**: whitelist new V8 flag in NODE\_OPTIONS (Shelley Vohr) [#30094](https://github.com/nodejs/node/pull/30094) +* [[`5ca58646c1`](https://github.com/nodejs/node/commit/5ca58646c1)] - **(SEMVER-MINOR)** **cli**: add --trace-uncaught flag (Anna Henningsen) [#30025](https://github.com/nodejs/node/pull/30025) +* [[`8b75aabee9`](https://github.com/nodejs/node/commit/8b75aabee9)] - **crypto**: guard with OPENSSL\_NO\_GOST (Shelley Vohr) [#30050](https://github.com/nodejs/node/pull/30050) +* [[`1d03df4c5e`](https://github.com/nodejs/node/commit/1d03df4c5e)] - **(SEMVER-MINOR)** **crypto**: add Hash.prototype.copy() method (Ben Noordhuis) [#29910](https://github.com/nodejs/node/pull/29910) +* [[`46c9194ec8`](https://github.com/nodejs/node/commit/46c9194ec8)] - **deps**: V8: cherry-pick a7dffcd767be (Christian Clauss) [#30218](https://github.com/nodejs/node/pull/30218) +* [[`104bfb9a38`](https://github.com/nodejs/node/commit/104bfb9a38)] - **deps**: V8: cherry-pick e5dbc95 (Gabriel Schulhof) [#30130](https://github.com/nodejs/node/pull/30130) +* [[`e3124481c2`](https://github.com/nodejs/node/commit/e3124481c2)] - **deps**: update npm to 6.12.1 (Michael Perrotte) [#30164](https://github.com/nodejs/node/pull/30164) +* [[`f3d00c594d`](https://github.com/nodejs/node/commit/f3d00c594d)] - **deps**: V8: backport 777fa98 (Michaël Zasso) [#30062](https://github.com/nodejs/node/pull/30062) +* [[`1cfa98c23e`](https://github.com/nodejs/node/commit/1cfa98c23e)] - **deps**: V8: cherry-pick c721203 (Michaël Zasso) [#30065](https://github.com/nodejs/node/pull/30065) +* [[`0d9ae1b8f6`](https://github.com/nodejs/node/commit/0d9ae1b8f6)] - **deps**: V8: cherry-pick ed40ab1 (Michaël Zasso) [#30064](https://github.com/nodejs/node/pull/30064) +* [[`a63f7e73c4`](https://github.com/nodejs/node/commit/a63f7e73c4)] - **(SEMVER-MINOR)** **dgram**: add source-specific multicast support (Lucas Pardue) [#15735](https://github.com/nodejs/node/pull/15735) +* [[`fc407bb555`](https://github.com/nodejs/node/commit/fc407bb555)] - **doc**: add missing hash for header link (Nick Schonning) [#30188](https://github.com/nodejs/node/pull/30188) +* [[`201a60e6ba`](https://github.com/nodejs/node/commit/201a60e6ba)] - **doc**: linkify `.setupMaster()` in cluster doc (Trivikram Kamat) [#30204](https://github.com/nodejs/node/pull/30204) +* [[`b7070f315f`](https://github.com/nodejs/node/commit/b7070f315f)] - **doc**: explain http2 aborted event callback (dev-313) [#30179](https://github.com/nodejs/node/pull/30179) +* [[`f8fb2c06c5`](https://github.com/nodejs/node/commit/f8fb2c06c5)] - **doc**: linkify `.fork()` in cluster documentation (Anna Henningsen) [#30163](https://github.com/nodejs/node/pull/30163) +* [[`ae81360214`](https://github.com/nodejs/node/commit/ae81360214)] - **doc**: update AUTHORS list (Michaël Zasso) [#30142](https://github.com/nodejs/node/pull/30142) +* [[`1499a72a1f`](https://github.com/nodejs/node/commit/1499a72a1f)] - **doc**: improve doc Http2Session:Timeout (dev-313) [#30161](https://github.com/nodejs/node/pull/30161) +* [[`3709b5cc7e`](https://github.com/nodejs/node/commit/3709b5cc7e)] - **doc**: move inactive Collaborators to emeriti (Rich Trott) [#30177](https://github.com/nodejs/node/pull/30177) +* [[`a48d17900b`](https://github.com/nodejs/node/commit/a48d17900b)] - **doc**: add options description for send APIs (dev-313) [#29868](https://github.com/nodejs/node/pull/29868) +* [[`dfb4a24695`](https://github.com/nodejs/node/commit/dfb4a24695)] - **doc**: fix an error in resolution algorithm steps (Alex Zherdev) [#29940](https://github.com/nodejs/node/pull/29940) +* [[`403a648a16`](https://github.com/nodejs/node/commit/403a648a16)] - **doc**: fix numbering in require algorithm (Jan Krems) [#30117](https://github.com/nodejs/node/pull/30117) +* [[`e4ab6fced1`](https://github.com/nodejs/node/commit/e4ab6fced1)] - **doc**: remove incorrect and outdated example (Tobias Nießen) [#30138](https://github.com/nodejs/node/pull/30138) +* [[`3c23224a76`](https://github.com/nodejs/node/commit/3c23224a76)] - **doc**: adjust code sample for stream.finished (Cotton Hou) [#29983](https://github.com/nodejs/node/pull/29983) +* [[`d91d270416`](https://github.com/nodejs/node/commit/d91d270416)] - **doc**: claim NODE\_MODULE\_VERSION=80 for Electron 9 (Samuel Attard) [#30052](https://github.com/nodejs/node/pull/30052) +* [[`621eaf9ed5`](https://github.com/nodejs/node/commit/621eaf9ed5)] - **doc**: remove "it is important to" phrasing (Rich Trott) [#30108](https://github.com/nodejs/node/pull/30108) +* [[`9a71091098`](https://github.com/nodejs/node/commit/9a71091098)] - **doc**: revise os.md (Rich Trott) [#30102](https://github.com/nodejs/node/pull/30102) +* [[`381c6cd0d2`](https://github.com/nodejs/node/commit/381c6cd0d2)] - **doc**: delete "a number of" things in the docs (Rich Trott) [#30103](https://github.com/nodejs/node/pull/30103) +* [[`45c70a9793`](https://github.com/nodejs/node/commit/45c70a9793)] - **doc**: remove dashes (Rich Trott) [#30101](https://github.com/nodejs/node/pull/30101) +* [[`ea9d125536`](https://github.com/nodejs/node/commit/ea9d125536)] - **doc**: add legendecas to collaborators (legendecas) [#30115](https://github.com/nodejs/node/pull/30115) +* [[`39070bbed0`](https://github.com/nodejs/node/commit/39070bbed0)] - **doc**: make YAML matter consistent in crypto.md (Rich Trott) [#30016](https://github.com/nodejs/node/pull/30016) +* [[`978946e38b`](https://github.com/nodejs/node/commit/978946e38b)] - **doc,meta**: prefer aliases and stubs over Runtime Deprecations (Rich Trott) [#30153](https://github.com/nodejs/node/pull/30153) +* [[`32a538901f`](https://github.com/nodejs/node/commit/32a538901f)] - **doc,n-api**: sort bottom-of-the-page references (Gabriel Schulhof) [#30124](https://github.com/nodejs/node/pull/30124) +* [[`07b5584a3f`](https://github.com/nodejs/node/commit/07b5584a3f)] - **(SEMVER-MINOR)** **fs**: add `bufferSize` option to `fs.opendir()` (Anna Henningsen) [#30114](https://github.com/nodejs/node/pull/30114) +* [[`2505f678ef`](https://github.com/nodejs/node/commit/2505f678ef)] - **http**: support readable hwm in IncomingMessage (Colin Ihrig) [#30135](https://github.com/nodejs/node/pull/30135) +* [[`f01c5c51b0`](https://github.com/nodejs/node/commit/f01c5c51b0)] - **inspector**: turn platform tasks that outlive Agent into no-ops (Anna Henningsen) [#30031](https://github.com/nodejs/node/pull/30031) +* [[`050efebf24`](https://github.com/nodejs/node/commit/050efebf24)] - **meta**: use contact\_links instead of issue templates (Michaël Zasso) [#30172](https://github.com/nodejs/node/pull/30172) +* [[`edfbee3727`](https://github.com/nodejs/node/commit/edfbee3727)] - **module**: resolve self-references (Jan Krems) [#29327](https://github.com/nodejs/node/pull/29327) +* [[`93b1bb8cb5`](https://github.com/nodejs/node/commit/93b1bb8cb5)] - **n-api,doc**: add info about building n-api addons (Jim Schlight) [#30032](https://github.com/nodejs/node/pull/30032) +* [[`cc1cd2b3c5`](https://github.com/nodejs/node/commit/cc1cd2b3c5)] - **src**: isolate-\>Dispose() order consistency (Shelley Vohr) [#30181](https://github.com/nodejs/node/pull/30181) +* [[`a0df91cce1`](https://github.com/nodejs/node/commit/a0df91cce1)] - **(SEMVER-MINOR)** **src**: expose granular SetIsolateUpForNode (Shelley Vohr) [#30150](https://github.com/nodejs/node/pull/30150) +* [[`ec7b69ff05`](https://github.com/nodejs/node/commit/ec7b69ff05)] - **src**: change env.h includes for forward declarations (Alexandre Ferrando) [#30133](https://github.com/nodejs/node/pull/30133) +* [[`98c8f76dd1`](https://github.com/nodejs/node/commit/98c8f76dd1)] - **src**: split up InitializeContext (Shelley Vohr) [#30067](https://github.com/nodejs/node/pull/30067) +* [[`d78e3176dd`](https://github.com/nodejs/node/commit/d78e3176dd)] - **src**: fix crash with SyntheticModule#setExport (Michaël Zasso) [#30062](https://github.com/nodejs/node/pull/30062) +* [[`fd0aded233`](https://github.com/nodejs/node/commit/fd0aded233)] - **src**: allow inspector without v8 platform (Shelley Vohr) [#30049](https://github.com/nodejs/node/pull/30049) +* [[`87f14e13b3`](https://github.com/nodejs/node/commit/87f14e13b3)] - **stream**: extract Readable.from in its own file (Matteo Collina) [#30140](https://github.com/nodejs/node/pull/30140) +* [[`1d9f4278dd`](https://github.com/nodejs/node/commit/1d9f4278dd)] - **test**: use arrow functions for callbacks (Minuk Park) [#30069](https://github.com/nodejs/node/pull/30069) +* [[`a03809d7dd`](https://github.com/nodejs/node/commit/a03809d7dd)] - **test**: verify npm compatibility with releases (Michaël Zasso) [#30082](https://github.com/nodejs/node/pull/30082) +* [[`68e4b5a1fc`](https://github.com/nodejs/node/commit/68e4b5a1fc)] - **tools**: fix Python 3 deprecation warning in test.py (Loris Zinsou) [#30208](https://github.com/nodejs/node/pull/30208) +* [[`348ec693ac`](https://github.com/nodejs/node/commit/348ec693ac)] - **tools**: fix Python 3 syntax error in mac\_tool.py (Christian Clauss) [#30146](https://github.com/nodejs/node/pull/30146) +* [[`e2fb353df3`](https://github.com/nodejs/node/commit/e2fb353df3)] - **tools**: use print() function in buildbot\_run.py (Christian Clauss) [#30148](https://github.com/nodejs/node/pull/30148) +* [[`bcbcce5983`](https://github.com/nodejs/node/commit/bcbcce5983)] - **tools**: undefined name opts -\> args in gyptest.py (Christian Clauss) [#30144](https://github.com/nodejs/node/pull/30144) +* [[`14981f5bba`](https://github.com/nodejs/node/commit/14981f5bba)] - **tools**: git rm -r tools/v8\_gypfiles/broken (Christian Clauss) [#30149](https://github.com/nodejs/node/pull/30149) +* [[`d549a34597`](https://github.com/nodejs/node/commit/d549a34597)] - **tools**: update ESLint to 6.6.0 (Colin Ihrig) [#30123](https://github.com/nodejs/node/pull/30123) +* [[`a3757546e8`](https://github.com/nodejs/node/commit/a3757546e8)] - **tools**: doc: improve async workflow of generate.js (Theotime Poisseau) [#30106](https://github.com/nodejs/node/pull/30106) + ## 2019-10-23, Version 13.0.1 (Current), @targos diff --git a/src/node_version.h b/src/node_version.h index 1989afcf485501..7331023933e5ac 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 13 -#define NODE_MINOR_VERSION 0 -#define NODE_PATCH_VERSION 2 +#define NODE_MINOR_VERSION 1 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
-13.0.1
+13.1.0
+13.0.1
13.0.0
diff --git a/doc/api/cli.md b/doc/api/cli.md index d9d7d3ad5e7365..fa46a00aff8f0f 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -207,7 +207,7 @@ Enable experimental diagnostic report feature. ### `--experimental-resolve-self` Enable experimental support for a package using `require` or `import` to load @@ -767,7 +767,7 @@ connection problems. ### `--trace-uncaught` Print stack traces for uncaught exceptions; usually, the stack trace associated diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 83f91620a7bfcd..91eefa7f161119 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1043,7 +1043,7 @@ console.log(hash.digest('hex')); ### hash.copy(\[options\]) * `options` {Object} [`stream.transform` options][] diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 8639f894604bd1..6499282d05361c 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -125,7 +125,7 @@ if (cluster.isMaster) { ### socket.addSourceSpecificMembership(sourceAddress, groupAddress\[, multicastInterface\]) * `sourceAddress` {string} * `groupAddress` {string} @@ -314,7 +314,7 @@ drop membership on all valid interfaces. ### socket.dropSourceSpecificMembership(sourceAddress, groupAddress\[, multicastInterface\]) * `sourceAddress` {string} diff --git a/doc/api/fs.md b/doc/api/fs.md index 7f6c815b9bfbe6..de0acff8eac34e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2626,7 +2626,7 @@ Functions based on `fs.open()` exhibit this behavior as well: @@ -2653,7 +2653,7 @@ directory and subsequent read operations. @@ -4844,7 +4844,7 @@ a colon, Node.js will open a file system stream, as described by diff --git a/doc/api/http.md b/doc/api/http.md index 4d44121e8455f9..81e07b482af8d4 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1668,7 +1668,7 @@ the request body should be sent. diff --git a/doc/changelogs/CHANGELOG_V13.md b/doc/changelogs/CHANGELOG_V13.md index 67c3a3528c0c79..74b7294bee8c78 100644 --- a/doc/changelogs/CHANGELOG_V13.md +++ b/doc/changelogs/CHANGELOG_V13.md @@ -9,6 +9,8 @@
+13.1.0
+13.0.1
13.0.0