From 365e062e14befd2c00cd281d6fe2d77e248320bf Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 19 Jun 2018 02:58:49 +0800 Subject: [PATCH 01/84] fs: add *timeNs properties to BigInt Stats objects - Extend the aliased buffer for stats objects to contain the entire time spec (seconds and nanoseconds) for the time values instead of calculating the milliseconds in C++ and lose precision there. - Calculate the nanosecond-precision time values in JS and expose them in BigInt Stats objects as `*timeNs`. The millisecond-precision values are now calculated from the nanosecond-precision values. PR-URL: https://github.com/nodejs/node/pull/21387 Reviewed-By: Jeremiah Senkpiel Reviewed-By: James M Snell Reviewed-By: Gus Caplan --- doc/api/fs.md | 71 +++++++++- lib/internal/fs/utils.js | 163 ++++++++++++++-------- src/env.h | 26 +++- src/node_file.cc | 11 +- src/node_file.h | 95 +++++-------- test/parallel/test-fs-stat-bigint.js | 20 +++ test/parallel/test-fs-watchfile-bigint.js | 18 ++- 7 files changed, 275 insertions(+), 129 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index e7ecb354720cda..c61f0d4e3ef660 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -512,7 +512,8 @@ A `fs.Stats` object provides information about a file. Objects returned from [`fs.stat()`][], [`fs.lstat()`][] and [`fs.fstat()`][] and their synchronous counterparts are of this type. If `bigint` in the `options` passed to those methods is true, the numeric values -will be `bigint` instead of `number`. +will be `bigint` instead of `number`, and the object will contain additional +nanosecond-precision properties suffixed with `Ns`. ```console Stats { @@ -539,7 +540,7 @@ Stats { `bigint` version: ```console -Stats { +BigIntStats { dev: 2114n, ino: 48064969n, mode: 33188n, @@ -554,6 +555,10 @@ Stats { mtimeMs: 1318289051000n, ctimeMs: 1318289051000n, birthtimeMs: 1318289051000n, + atimeNs: 1318289051000000000n, + mtimeNs: 1318289051000000000n, + ctimeNs: 1318289051000000000n, + birthtimeNs: 1318289051000000000n, atime: Mon, 10 Oct 2011 23:24:11 GMT, mtime: Mon, 10 Oct 2011 23:24:11 GMT, ctime: Mon, 10 Oct 2011 23:24:11 GMT, @@ -726,6 +731,54 @@ added: v8.1.0 The timestamp indicating the creation time of this file expressed in milliseconds since the POSIX Epoch. +### stats.atimeNs + + +* {bigint} + +Only present when `bigint: true` is passed into the method that generates +the object. +The timestamp indicating the last time this file was accessed expressed in +nanoseconds since the POSIX Epoch. + +### stats.mtimeNs + + +* {bigint} + +Only present when `bigint: true` is passed into the method that generates +the object. +The timestamp indicating the last time this file was modified expressed in +nanoseconds since the POSIX Epoch. + +### stats.ctimeNs + + +* {bigint} + +Only present when `bigint: true` is passed into the method that generates +the object. +The timestamp indicating the last time the file status was changed expressed +in nanoseconds since the POSIX Epoch. + +### stats.birthtimeNs + + +* {bigint} + +Only present when `bigint: true` is passed into the method that generates +the object. +The timestamp indicating the creation time of this file expressed in +nanoseconds since the POSIX Epoch. + ### stats.atime + +[`data:` URLs][] are supported for importing with the following MIME types: + +* `text/javascript` for ES Modules +* `application/json` for JSON +* `application/wasm` for WASM. + +`data:` URLs only resolve [_Bare specifiers_][Terminology] for builtin modules +and [_Absolute specifiers_][Terminology]. Resolving +[_Relative specifiers_][Terminology] will not work because `data:` is not a +[special scheme][]. For example, attempting to load `./foo` +from `data:text/javascript,import "./foo";` will fail to resolve since there +is no concept of relative resolution for `data:` URLs. An example of a `data:` +URLs being used is: + +```mjs +import 'data:text/javascript,console.log("hello!");' +import _ from 'data:application/json,"world!"' +``` + ## import.meta * {Object} @@ -869,6 +894,8 @@ $ node --experimental-modules --es-module-specifier-resolution=node index success! ``` +[Terminology]: #esm_terminology +[`data:` URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs [`export`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export [`import`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import [`import()`]: #esm_import-expressions @@ -877,6 +904,7 @@ success! [CommonJS]: modules.html [ECMAScript-modules implementation]: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md [Node.js EP for ES Modules]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md +[special scheme]: https://url.spec.whatwg.org/#special-scheme [WHATWG JSON modules specification]: https://html.spec.whatwg.org/#creating-a-json-module-script [ES Module Integration Proposal for Web Assembly]: https://github.com/webassembly/esm-integration [dynamic instantiate hook]: #esm_dynamic_instantiate_hook diff --git a/lib/internal/modules/esm/default_resolve.js b/lib/internal/modules/esm/default_resolve.js index 46e7b2415a92e0..580419deac6c05 100644 --- a/lib/internal/modules/esm/default_resolve.js +++ b/lib/internal/modules/esm/default_resolve.js @@ -12,7 +12,7 @@ const typeFlag = getOptionValue('--input-type'); const experimentalWasmModules = getOptionValue('--experimental-wasm-modules'); const { resolve: moduleWrapResolve, getPackageType } = internalBinding('module_wrap'); -const { pathToFileURL, fileURLToPath } = require('internal/url'); +const { URL, pathToFileURL, fileURLToPath } = require('internal/url'); const { ERR_INPUT_TYPE_NOT_ALLOWED, ERR_UNKNOWN_FILE_EXTENSION } = require('internal/errors').codes; @@ -45,12 +45,32 @@ if (experimentalWasmModules) extensionFormatMap['.wasm'] = legacyExtensionFormatMap['.wasm'] = 'wasm'; function resolve(specifier, parentURL) { + try { + const parsed = new URL(specifier); + if (parsed.protocol === 'data:') { + const [ , mime ] = /^([^/]+\/[^;,]+)(;base64)?,/.exec(parsed.pathname) || [ null, null, null ]; + const format = ({ + '__proto__': null, + 'text/javascript': 'module', + 'application/json': 'json', + 'application/wasm': experimentalWasmModules ? 'wasm' : null + })[mime] || null; + return { + url: specifier, + format + }; + } + } catch {} if (NativeModule.canBeRequiredByUsers(specifier)) { return { url: specifier, format: 'builtin' }; } + if (parentURL && parentURL.startsWith('data:')) { + // This is gonna blow up, we want the error + new URL(specifier, parentURL); + } const isMain = parentURL === undefined; if (isMain) diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index bffefa884e4821..09109d3c71287f 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -102,9 +102,12 @@ class Loader { } } - if (format !== 'dynamic' && !url.startsWith('file:')) + if (format !== 'dynamic' && + !url.startsWith('file:') && + !url.startsWith('data:') + ) throw new ERR_INVALID_RETURN_PROPERTY( - 'file: url', 'loader resolve', 'url', url + 'file: or data: url', 'loader resolve', 'url', url ); return { url, format }; diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index d693b79448cea6..9cb0781ab98829 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -9,6 +9,8 @@ const { StringPrototype } = primordials; +const { Buffer } = require('buffer'); + const { stripShebang, stripBOM, @@ -24,6 +26,8 @@ const { debuglog } = require('internal/util/debuglog'); const { promisify } = require('internal/util'); const esmLoader = require('internal/process/esm_loader'); const { + ERR_INVALID_URL, + ERR_INVALID_URL_SCHEME, ERR_UNKNOWN_BUILTIN_MODULE } = require('internal/errors').codes; const readFileAsync = promisify(fs.readFile); @@ -34,6 +38,31 @@ const debug = debuglog('esm'); const translators = new SafeMap(); exports.translators = translators; +const DATA_URL_PATTERN = /^[^/]+\/[^,;]+(;base64)?,([\s\S]*)$/; +function getSource(url) { + const parsed = new URL(url); + if (parsed.protocol === 'file:') { + return readFileAsync(parsed); + } else if (parsed.protocol === 'data:') { + const match = DATA_URL_PATTERN.exec(parsed.pathname); + if (!match) { + throw new ERR_INVALID_URL(url); + } + const [ , base64, body ] = match; + return Buffer.from(body, base64 ? 'base64' : 'utf8'); + } else { + throw new ERR_INVALID_URL_SCHEME(['file', 'data']); + } +} + +function errPath(url) { + const parsed = new URL(url); + if (parsed.protocol === 'file:') { + return fileURLToPath(parsed); + } + return url; +} + function initializeImportMeta(meta, { url }) { meta.url = url; } @@ -45,7 +74,7 @@ async function importModuleDynamically(specifier, { url }) { // Strategy for loading a standard JavaScript module translators.set('module', async function moduleStrategy(url) { - const source = `${await readFileAsync(new URL(url))}`; + const source = `${await getSource(url)}`; debug(`Translating StandardModule ${url}`); const { ModuleWrap, callbackMap } = internalBinding('module_wrap'); const module = new ModuleWrap(stripShebang(source), url); @@ -112,26 +141,32 @@ translators.set('builtin', async function builtinStrategy(url) { translators.set('json', async function jsonStrategy(url) { debug(`Translating JSONModule ${url}`); debug(`Loading JSONModule ${url}`); - const pathname = fileURLToPath(url); - const modulePath = isWindows ? - StringPrototype.replace(pathname, winSepRegEx, '\\') : pathname; - let module = CJSModule._cache[modulePath]; - if (module && module.loaded) { - const exports = module.exports; - return createDynamicModule([], ['default'], url, (reflect) => { - reflect.exports.default.set(exports); - }); + const pathname = url.startsWith('file:') ? fileURLToPath(url) : null; + let modulePath; + let module; + if (pathname) { + modulePath = isWindows ? + StringPrototype.replace(pathname, winSepRegEx, '\\') : pathname; + module = CJSModule._cache[modulePath]; + if (module && module.loaded) { + const exports = module.exports; + return createDynamicModule([], ['default'], url, (reflect) => { + reflect.exports.default.set(exports); + }); + } } - const content = await readFileAsync(pathname, 'utf-8'); - // A require call could have been called on the same file during loading and - // that resolves synchronously. To make sure we always return the identical - // export, we have to check again if the module already exists or not. - module = CJSModule._cache[modulePath]; - if (module && module.loaded) { - const exports = module.exports; - return createDynamicModule(['default'], url, (reflect) => { - reflect.exports.default.set(exports); - }); + const content = `${await getSource(url)}`; + if (pathname) { + // A require call could have been called on the same file during loading and + // that resolves synchronously. To make sure we always return the identical + // export, we have to check again if the module already exists or not. + module = CJSModule._cache[modulePath]; + if (module && module.loaded) { + const exports = module.exports; + return createDynamicModule(['default'], url, (reflect) => { + reflect.exports.default.set(exports); + }); + } } try { const exports = JsonParse(stripBOM(content)); @@ -144,10 +179,12 @@ translators.set('json', async function jsonStrategy(url) { // parse error instead of just manipulating the original error message. // That would allow to add further properties and maybe additional // debugging information. - err.message = pathname + ': ' + err.message; + err.message = errPath(url) + ': ' + err.message; throw err; } - CJSModule._cache[modulePath] = module; + if (pathname) { + CJSModule._cache[modulePath] = module; + } return createDynamicModule([], ['default'], url, (reflect) => { debug(`Parsing JSONModule ${url}`); reflect.exports.default.set(module.exports); @@ -156,14 +193,13 @@ translators.set('json', async function jsonStrategy(url) { // Strategy for loading a wasm module translators.set('wasm', async function(url) { - const pathname = fileURLToPath(url); - const buffer = await readFileAsync(pathname); + const buffer = await getSource(url); debug(`Translating WASMModule ${url}`); let compiled; try { compiled = await WebAssembly.compile(buffer); } catch (err) { - err.message = pathname + ': ' + err.message; + err.message = errPath(url) + ': ' + err.message; throw err; } diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js new file mode 100644 index 00000000000000..bc781b0363cc44 --- /dev/null +++ b/test/es-module/test-esm-data-urls.js @@ -0,0 +1,63 @@ +// Flags: --experimental-modules +'use strict'; +const common = require('../common'); +const assert = require('assert'); +function createURL(mime, body) { + return `data:${mime},${body}`; +} +function createBase64URL(mime, body) { + return `data:${mime};base64,${Buffer.from(body).toString('base64')}`; +} +(async () => { + { + const body = 'export default {a:"aaa"};'; + const plainESMURL = createURL('text/javascript', body); + const ns = await import(plainESMURL); + assert.deepStrictEqual(Object.keys(ns), ['default']); + assert.deepStrictEqual(ns.default.a, 'aaa'); + const importerOfURL = createURL( + 'text/javascript', + `export {default as default} from ${JSON.stringify(plainESMURL)}` + ); + assert.strictEqual( + (await import(importerOfURL)).default, + ns.default + ); + const base64ESMURL = createBase64URL('text/javascript', body); + assert.notStrictEqual( + await import(base64ESMURL), + ns + ); + } + { + const body = 'export default import.meta.url;'; + const plainESMURL = createURL('text/javascript', body); + const ns = await import(plainESMURL); + assert.deepStrictEqual(Object.keys(ns), ['default']); + assert.deepStrictEqual(ns.default, plainESMURL); + } + { + const body = '{"x": 1}'; + const plainESMURL = createURL('application/json', body); + const ns = await import(plainESMURL); + assert.deepStrictEqual(Object.keys(ns), ['default']); + assert.deepStrictEqual(ns.default.x, 1); + } + { + const body = '{"default": 2}'; + const plainESMURL = createURL('application/json', body); + const ns = await import(plainESMURL); + assert.deepStrictEqual(Object.keys(ns), ['default']); + assert.deepStrictEqual(ns.default.default, 2); + } + { + const body = 'null'; + const plainESMURL = createURL('invalid', body); + try { + await import(plainESMURL); + common.mustNotCall()(); + } catch (e) { + assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); + } + } +})().then(common.mustCall()); From 293c9f0d753ef0c0978109e3350e6e0288f9e640 Mon Sep 17 00:00:00 2001 From: Bradley Farias Date: Fri, 2 Aug 2019 09:06:34 -0500 Subject: [PATCH 05/84] bootstrap: run preload prior to frozen-intrinsics This is used to allow people to run polyfills. Co-Authored-By: Anna Henningsen PR-URL: https://github.com/nodejs/node/pull/28940 Reviewed-By: Guy Bedford Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Rich Trott Reviewed-By: James M Snell --- doc/api/cli.md | 3 ++ lib/internal/bootstrap/pre_execution.js | 2 +- lib/internal/main/worker_thread.js | 2 +- test/fixtures/intrinsic-mutation.js | 10 +++++++ .../fixtures/print-intrinsic-mutation-name.js | 2 ++ test/fixtures/worker-from-argv.js | 3 ++ test/parallel/test-preload.js | 29 +++++++++++++++++++ 7 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/intrinsic-mutation.js create mode 100644 test/fixtures/print-intrinsic-mutation-name.js create mode 100644 test/fixtures/worker-from-argv.js diff --git a/doc/api/cli.md b/doc/api/cli.md index c8dce1db9c1e98..376e427db0a801 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -218,6 +218,9 @@ Support is currently only provided for the root context and no guarantees are currently provided that `global.Array` is indeed the default intrinsic reference. Code may break under this flag. +`--require` runs prior to freezing intrinsics in order to allow polyfills to +be added. + ### `--heapsnapshot-signal=signal` +* Extends: {Stream} + This object is created internally by an HTTP server — not by the user. It is passed as the second parameter to the [`'request'`][] event. -The response inherits from [Stream][], and additionally implements the -following: - #### Event: 'close' +* Extends: {stream.Readable} + A `Http2ServerRequest` object is created by [`http2.Server`][] or [`http2.SecureServer`][] and passed as the first argument to the [`'request'`][] event. It may be used to access a request status, headers, and data. -It implements the [Readable Stream][] interface, as well as the -following additional events, methods, and properties. - #### Event: 'aborted' +* Extends: {Http2Session} + #### serverhttp2session.altsvc(alt, originOrStream) +* Extends: {Http2Session} + #### Event: 'altsvc' +> Stability: 1 - Recursive removal is experimental. + * `path` {string|Buffer|URL} +* `options` {Object} + * `emfileWait` {integer} If an `EMFILE` error is encountered, Node.js will + retry the operation with a linear backoff of 1ms longer on each try until the + timeout duration passes this limit. This option is ignored if the `recursive` + option is not `true`. **Default:** `1000`. + * `maxBusyTries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is + encountered, Node.js will retry the operation with a linear backoff wait of + 100ms longer on each try. This option represents the number of retries. This + option is ignored if the `recursive` option is not `true`. **Default:** `3`. + * `recursive` {boolean} If `true`, perform a recursive directory removal. In + recursive mode, errors are not reported if `path` does not exist, and + operations are retried on failure. **Default:** `false`. * `callback` {Function} * `err` {Error} @@ -3045,17 +3063,27 @@ to the completion callback. Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -## fs.rmdirSync(path) +## fs.rmdirSync(path[, options]) +> Stability: 1 - Recursive removal is experimental. + * `path` {string|Buffer|URL} +* `options` {Object} + * `recursive` {boolean} If `true`, perform a recursive directory removal. In + recursive mode, errors are not reported if `path` does not exist, and + operations are retried on failure. **Default:** `false`. Synchronous rmdir(2). Returns `undefined`. @@ -4694,12 +4722,31 @@ added: v10.0.0 Renames `oldPath` to `newPath` and resolves the `Promise` with no arguments upon success. -### fsPromises.rmdir(path) +### fsPromises.rmdir(path[, options]) +> Stability: 1 - Recursive removal is experimental. + * `path` {string|Buffer|URL} +* `options` {Object} + * `emfileWait` {integer} If an `EMFILE` error is encountered, Node.js will + retry the operation with a linear backoff of 1ms longer on each try until the + timeout duration passes this limit. This option is ignored if the `recursive` + option is not `true`. **Default:** `1000`. + * `maxBusyTries` {integer} If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is + encountered, Node.js will retry the operation with a linear backoff wait of + 100ms longer on each try. This option represents the number of retries. This + option is ignored if the `recursive` option is not `true`. **Default:** `3`. + * `recursive` {boolean} If `true`, perform a recursive directory removal. In + recursive mode, errors are not reported if `path` does not exist, and + operations are retried on failure. **Default:** `false`. * Returns: {Promise} Removes the directory identified by `path` then resolves the `Promise` with @@ -5193,7 +5240,7 @@ the file contents. [`fs.readdir()`]: #fs_fs_readdir_path_options_callback [`fs.readdirSync()`]: #fs_fs_readdirsync_path_options [`fs.realpath()`]: #fs_fs_realpath_path_options_callback -[`fs.rmdir()`]: #fs_fs_rmdir_path_callback +[`fs.rmdir()`]: #fs_fs_rmdir_path_options_callback [`fs.stat()`]: #fs_fs_stat_path_options_callback [`fs.symlink()`]: #fs_fs_symlink_target_path_type_callback [`fs.utimes()`]: #fs_fs_utimes_path_atime_mtime_callback diff --git a/lib/fs.js b/lib/fs.js index cf25a9a2f781c6..89eadf067cd2d3 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -76,6 +76,7 @@ const { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath, + validateRmdirOptions, warnOnNonPortableTemplate } = require('internal/fs/utils'); const { @@ -100,6 +101,8 @@ let watchers; let ReadFileContext; let ReadStream; let WriteStream; +let rimraf; +let rimrafSync; // These have to be separate because of how graceful-fs happens to do it's // monkeypatching. @@ -720,16 +723,41 @@ function ftruncateSync(fd, len = 0) { handleErrorFromBinding(ctx); } -function rmdir(path, callback) { + +function lazyLoadRimraf() { + if (rimraf === undefined) + ({ rimraf, rimrafSync } = require('internal/fs/rimraf')); +} + +function rmdir(path, options, callback) { + if (typeof options === 'function') { + callback = options; + options = undefined; + } + callback = makeCallback(callback); - path = getValidatedPath(path); + path = pathModule.toNamespacedPath(getValidatedPath(path)); + options = validateRmdirOptions(options); + + if (options.recursive) { + lazyLoadRimraf(); + return rimraf(path, options, callback); + } + const req = new FSReqCallback(); req.oncomplete = callback; - binding.rmdir(pathModule.toNamespacedPath(path), req); + binding.rmdir(path, req); } -function rmdirSync(path) { +function rmdirSync(path, options) { path = getValidatedPath(path); + options = validateRmdirOptions(options); + + if (options.recursive) { + lazyLoadRimraf(); + return rimrafSync(pathModule.toNamespacedPath(path), options); + } + const ctx = { path }; binding.rmdir(pathModule.toNamespacedPath(path), undefined, ctx); handleErrorFromBinding(ctx); diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 171fec6e65a99c..a642641acf59a5 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -18,6 +18,7 @@ const { ERR_METHOD_NOT_IMPLEMENTED } = require('internal/errors').codes; const { isUint8Array } = require('internal/util/types'); +const { rimrafPromises } = require('internal/fs/rimraf'); const { copyObject, getDirents, @@ -32,6 +33,7 @@ const { validateBufferArray, validateOffsetLengthRead, validateOffsetLengthWrite, + validateRmdirOptions, warnOnNonPortableTemplate } = require('internal/fs/utils'); const { @@ -291,9 +293,15 @@ async function ftruncate(handle, len = 0) { return binding.ftruncate(handle.fd, len, kUsePromises); } -async function rmdir(path) { - path = getValidatedPath(path); - return binding.rmdir(pathModule.toNamespacedPath(path), kUsePromises); +async function rmdir(path, options) { + path = pathModule.toNamespacedPath(getValidatedPath(path)); + options = validateRmdirOptions(options); + + if (options.recursive) { + return rimrafPromises(path, options); + } + + return binding.rmdir(path, kUsePromises); } async function fdatasync(handle) { diff --git a/lib/internal/fs/rimraf.js b/lib/internal/fs/rimraf.js new file mode 100644 index 00000000000000..73f783d1d231f2 --- /dev/null +++ b/lib/internal/fs/rimraf.js @@ -0,0 +1,252 @@ +// This file is a modified version of the rimraf module on npm. It has been +// modified in the following ways: +// - Use of the assert module has been replaced with core's error system. +// - All code related to the glob dependency has been removed. +// - Bring your own custom fs module is not currently supported. +// - Some basic code cleanup. +'use strict'; +const { + chmod, + chmodSync, + lstat, + lstatSync, + readdir, + readdirSync, + rmdir, + rmdirSync, + stat, + statSync, + unlink, + unlinkSync +} = require('fs'); +const { join } = require('path'); +const { setTimeout } = require('timers'); +const notEmptyErrorCodes = new Set(['ENOTEMPTY', 'EEXIST', 'EPERM']); +const isWindows = process.platform === 'win32'; +const epermHandler = isWindows ? fixWinEPERM : _rmdir; +const epermHandlerSync = isWindows ? fixWinEPERMSync : _rmdirSync; +const numRetries = isWindows ? 100 : 1; + + +function rimraf(path, options, callback) { + let timeout = 0; // For EMFILE handling. + let busyTries = 0; + + _rimraf(path, options, function CB(err) { + if (err) { + if ((err.code === 'EBUSY' || err.code === 'ENOTEMPTY' || + err.code === 'EPERM') && busyTries < options.maxBusyTries) { + busyTries++; + return setTimeout(_rimraf, busyTries * 100, path, options, CB); + } + + if (err.code === 'EMFILE' && timeout < options.emfileWait) + return setTimeout(_rimraf, timeout++, path, options, CB); + + // The file is already gone. + if (err.code === 'ENOENT') + err = null; + } + + callback(err); + }); +} + + +function _rimraf(path, options, callback) { + // SunOS lets the root user unlink directories. Use lstat here to make sure + // it's not a directory. + lstat(path, (err, stats) => { + if (err) { + if (err.code === 'ENOENT') + return callback(null); + + // Windows can EPERM on stat. + if (isWindows && err.code === 'EPERM') + return fixWinEPERM(path, options, err, callback); + } else if (stats.isDirectory()) { + return _rmdir(path, options, err, callback); + } + + unlink(path, (err) => { + if (err) { + if (err.code === 'ENOENT') + return callback(null); + if (err.code === 'EISDIR') + return _rmdir(path, options, err, callback); + if (err.code === 'EPERM') { + return epermHandler(path, options, err, callback); + } + } + + return callback(err); + }); + }); +} + + +function fixWinEPERM(path, options, originalErr, callback) { + chmod(path, 0o666, (err) => { + if (err) + return callback(err.code === 'ENOENT' ? null : originalErr); + + stat(path, (err, stats) => { + if (err) + return callback(err.code === 'ENOENT' ? null : originalErr); + + if (stats.isDirectory()) + _rmdir(path, options, originalErr, callback); + else + unlink(path, callback); + }); + }); +} + + +function _rmdir(path, options, originalErr, callback) { + rmdir(path, (err) => { + if (err) { + if (notEmptyErrorCodes.has(err.code)) + return _rmchildren(path, options, callback); + if (err.code === 'ENOTDIR') + return callback(originalErr); + } + + callback(err); + }); +} + + +function _rmchildren(path, options, callback) { + readdir(path, (err, files) => { + if (err) + return callback(err); + + let numFiles = files.length; + + if (numFiles === 0) + return rmdir(path, callback); + + let done = false; + + files.forEach((child) => { + rimraf(join(path, child), options, (err) => { + if (done) + return; + + if (err) { + done = true; + return callback(err); + } + + numFiles--; + if (numFiles === 0) + rmdir(path, callback); + }); + }); + }); +} + + +function rimrafPromises(path, options) { + return new Promise((resolve, reject) => { + rimraf(path, options, (err) => { + if (err) + return reject(err); + + resolve(); + }); + }); +} + + +function rimrafSync(path, options) { + let stats; + + try { + stats = lstatSync(path); + } catch (err) { + if (err.code === 'ENOENT') + return; + + // Windows can EPERM on stat. + if (isWindows && err.code === 'EPERM') + fixWinEPERMSync(path, options, err); + } + + try { + // SunOS lets the root user unlink directories. + if (stats !== undefined && stats.isDirectory()) + _rmdirSync(path, options, null); + else + unlinkSync(path); + } catch (err) { + if (err.code === 'ENOENT') + return; + if (err.code === 'EPERM') + return epermHandlerSync(path, options, err); + if (err.code !== 'EISDIR') + throw err; + + _rmdirSync(path, options, err); + } +} + + +function _rmdirSync(path, options, originalErr) { + try { + rmdirSync(path); + } catch (err) { + if (err.code === 'ENOENT') + return; + if (err.code === 'ENOTDIR') + throw originalErr; + + if (notEmptyErrorCodes.has(err.code)) { + // Removing failed. Try removing all children and then retrying the + // original removal. Windows has a habit of not closing handles promptly + // when files are deleted, resulting in spurious ENOTEMPTY failures. Work + // around that issue by retrying on Windows. + readdirSync(path).forEach((child) => { + rimrafSync(join(path, child), options); + }); + + for (let i = 0; i < numRetries; i++) { + try { + return rmdirSync(path, options); + } catch {} // Ignore errors. + } + } + } +} + + +function fixWinEPERMSync(path, options, originalErr) { + try { + chmodSync(path, 0o666); + } catch (err) { + if (err.code === 'ENOENT') + return; + + throw originalErr; + } + + let stats; + + try { + stats = statSync(path); + } catch (err) { + if (err.code === 'ENOENT') + return; + + throw originalErr; + } + + if (stats.isDirectory()) + _rmdirSync(path, options, originalErr); + else + unlinkSync(path); +} + + +module.exports = { rimraf, rimrafPromises, rimrafSync }; diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index ac426b55881aee..80f0784681b588 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -22,6 +22,10 @@ const { } = require('internal/util/types'); const { once } = require('internal/util'); const { toPathIfFileURL } = require('internal/url'); +const { + validateInt32, + validateUint32 +} = require('internal/validators'); const pathModule = require('path'); const kType = Symbol('type'); const kStats = Symbol('stats'); @@ -526,6 +530,30 @@ function warnOnNonPortableTemplate(template) { } } +const defaultRmdirOptions = { + emfileWait: 1000, + maxBusyTries: 3, + recursive: false, +}; + +const validateRmdirOptions = hideStackFrames((options) => { + if (options === undefined) + return defaultRmdirOptions; + if (options === null || typeof options !== 'object') + throw new ERR_INVALID_ARG_TYPE('options', 'object', options); + + options = { ...defaultRmdirOptions, ...options }; + + if (typeof options.recursive !== 'boolean') + throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', options.recursive); + + validateInt32(options.emfileWait, 'emfileWait', 0); + validateUint32(options.maxBusyTries, 'maxBusyTries'); + + return options; +}); + + module.exports = { assertEncoding, BigIntStats, // for testing @@ -546,5 +574,6 @@ module.exports = { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath, + validateRmdirOptions, warnOnNonPortableTemplate }; diff --git a/node.gyp b/node.gyp index 4576e5a335c3e6..1d45f5117144b0 100644 --- a/node.gyp +++ b/node.gyp @@ -124,6 +124,7 @@ 'lib/internal/freeze_intrinsics.js', 'lib/internal/fs/promises.js', 'lib/internal/fs/read_file_context.js', + 'lib/internal/fs/rimraf.js', 'lib/internal/fs/streams.js', 'lib/internal/fs/sync_write_stream.js', 'lib/internal/fs/utils.js', diff --git a/test/parallel/test-fs-rmdir-recursive.js b/test/parallel/test-fs-rmdir-recursive.js new file mode 100644 index 00000000000000..b020221b27b0a3 --- /dev/null +++ b/test/parallel/test-fs-rmdir-recursive.js @@ -0,0 +1,152 @@ +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const { validateRmdirOptions } = require('internal/fs/utils'); +let count = 0; + +tmpdir.refresh(); + +function makeNonEmptyDirectory() { + const dirname = `rmdir-recursive-${count}`; + fs.mkdirSync(path.join(dirname, 'foo', 'bar', 'baz'), { recursive: true }); + fs.writeFileSync(path.join(dirname, 'text.txt'), 'hello', 'utf8'); + count++; + return dirname; +} + +// Test the asynchronous version. +{ + const dir = makeNonEmptyDirectory(); + + // Removal should fail without the recursive option. + fs.rmdir(dir, common.mustCall((err) => { + assert.strictEqual(err.syscall, 'rmdir'); + + // Removal should fail without the recursive option set to true. + fs.rmdir(dir, { recursive: false }, common.mustCall((err) => { + assert.strictEqual(err.syscall, 'rmdir'); + + // Recursive removal should succeed. + fs.rmdir(dir, { recursive: true }, common.mustCall((err) => { + assert.ifError(err); + + // No error should occur if recursive and the directory does not exist. + fs.rmdir(dir, { recursive: true }, common.mustCall((err) => { + assert.ifError(err); + + // Attempted removal should fail now because the directory is gone. + fs.rmdir(dir, common.mustCall((err) => { + assert.strictEqual(err.syscall, 'rmdir'); + })); + })); + })); + })); + })); +} + +// Test the synchronous version. +{ + const dir = makeNonEmptyDirectory(); + + // Removal should fail without the recursive option set to true. + common.expectsError(() => { + fs.rmdirSync(dir); + }, { syscall: 'rmdir' }); + common.expectsError(() => { + fs.rmdirSync(dir, { recursive: false }); + }, { syscall: 'rmdir' }); + + // Recursive removal should succeed. + fs.rmdirSync(dir, { recursive: true }); + + // No error should occur if recursive and the directory does not exist. + fs.rmdirSync(dir, { recursive: true }); + + // Attempted removal should fail now because the directory is gone. + common.expectsError(() => fs.rmdirSync(dir), { syscall: 'rmdir' }); +} + +// Test the Promises based version. +(async () => { + const dir = makeNonEmptyDirectory(); + + // Removal should fail without the recursive option set to true. + assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); + assert.rejects(fs.promises.rmdir(dir, { recursive: false }), { + syscall: 'rmdir' + }); + + // Recursive removal should succeed. + await fs.promises.rmdir(dir, { recursive: true }); + + // No error should occur if recursive and the directory does not exist. + await fs.promises.rmdir(dir, { recursive: true }); + + // Attempted removal should fail now because the directory is gone. + assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); +})(); + +// Test input validation. +{ + const defaults = { + emfileWait: 1000, + maxBusyTries: 3, + recursive: false + }; + const modified = { + emfileWait: 953, + maxBusyTries: 5, + recursive: true + }; + + assert.deepStrictEqual(validateRmdirOptions(), defaults); + assert.deepStrictEqual(validateRmdirOptions({}), defaults); + assert.deepStrictEqual(validateRmdirOptions(modified), modified); + assert.deepStrictEqual(validateRmdirOptions({ + maxBusyTries: 99 + }), { + emfileWait: 1000, + maxBusyTries: 99, + recursive: false + }); + + [null, 'foo', 5, NaN].forEach((bad) => { + common.expectsError(() => { + validateRmdirOptions(bad); + }, { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: /^The "options" argument must be of type object\./ + }); + }); + + [undefined, null, 'foo', Infinity, function() {}].forEach((bad) => { + common.expectsError(() => { + validateRmdirOptions({ recursive: bad }); + }, { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: /^The "recursive" argument must be of type boolean\./ + }); + }); + + common.expectsError(() => { + validateRmdirOptions({ emfileWait: -1 }); + }, { + code: 'ERR_OUT_OF_RANGE', + type: RangeError, + message: /^The value of "emfileWait" is out of range\./ + }); + + common.expectsError(() => { + validateRmdirOptions({ maxBusyTries: -1 }); + }, { + code: 'ERR_OUT_OF_RANGE', + type: RangeError, + message: /^The value of "maxBusyTries" is out of range\./ + }); +} diff --git a/tools/license-builder.sh b/tools/license-builder.sh index 7875a0cd24e4a4..c46b18845f18d1 100755 --- a/tools/license-builder.sh +++ b/tools/license-builder.sh @@ -106,4 +106,7 @@ addlicense "HdrHistogram" "deps/histogram" "$(cat ${rootdir}/deps/histogram/LICE addlicense "node-heapdump" "src/heap_utils.cc" \ "$(curl -sL https://raw.githubusercontent.com/bnoordhuis/node-heapdump/0ca52441e46241ffbea56a389e2856ec01c48c97/LICENSE)" +addlicense "rimraf" "lib/internal/fs/rimraf.js" \ + "$(curl -sL https://raw.githubusercontent.com/isaacs/rimraf/0e365ac4e4d64a25aa2a3cc026348f13410210e1/LICENSE)" + mv $tmplicense $licensefile From 2fafd635d7a00ba8af757ce6459b968eb90c49a2 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 21 Aug 2019 12:03:00 +0300 Subject: [PATCH 28/84] doc: fix nits in esm.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ```mjs -> ```js as our linting of doc code fragments does not recognize this tag, IIRC. * Add semicolons to a code fragment. * Fix ASCII sorting in bottom references. PR-URL: https://github.com/nodejs/node/pull/29242 Reviewed-By: Guy Bedford Reviewed-By: Daniel Bevenius Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Сковорода Никита Андреевич --- doc/api/esm.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 277f5cf8300403..159dcc678c74f7 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -339,9 +339,9 @@ from `data:text/javascript,import "./foo";` will fail to resolve since there is no concept of relative resolution for `data:` URLs. An example of a `data:` URLs being used is: -```mjs -import 'data:text/javascript,console.log("hello!");' -import _ from 'data:application/json,"world!"' +```js +import 'data:text/javascript,console.log("hello!");'; +import _ from 'data:application/json,"world!"'; ``` ## import.meta @@ -894,18 +894,18 @@ $ node --experimental-modules --es-module-specifier-resolution=node index success! ``` +[CommonJS]: modules.html +[ECMAScript-modules implementation]: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md +[ES Module Integration Proposal for Web Assembly]: https://github.com/webassembly/esm-integration +[Node.js EP for ES Modules]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md [Terminology]: #esm_terminology +[WHATWG JSON modules specification]: https://html.spec.whatwg.org/#creating-a-json-module-script [`data:` URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs [`export`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export -[`import`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import [`import()`]: #esm_import-expressions [`import.meta.url`]: #esm_import_meta +[`import`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import [`module.createRequire()`]: modules.html#modules_module_createrequire_filename -[CommonJS]: modules.html -[ECMAScript-modules implementation]: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md -[Node.js EP for ES Modules]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md -[special scheme]: https://url.spec.whatwg.org/#special-scheme -[WHATWG JSON modules specification]: https://html.spec.whatwg.org/#creating-a-json-module-script -[ES Module Integration Proposal for Web Assembly]: https://github.com/webassembly/esm-integration [dynamic instantiate hook]: #esm_dynamic_instantiate_hook +[special scheme]: https://url.spec.whatwg.org/#special-scheme [the official standard format]: https://tc39.github.io/ecma262/#sec-modules From dfc0ef5d88b03d1ba472287c9908f060893edb41 Mon Sep 17 00:00:00 2001 From: Brian White Date: Thu, 10 Jan 2019 15:52:27 -0500 Subject: [PATCH 29/84] net: allow reading data into a static buffer Co-Authored-By: Anna Henningsen PR-URL: https://github.com/nodejs/node/pull/25436 Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Ben Noordhuis --- benchmark/net/net-s2c.js | 57 ++++-- doc/api/net.md | 36 ++++ lib/internal/stream_base_commons.js | 31 ++- lib/net.js | 144 ++++++++++---- src/stream_base.cc | 59 +++++- src/stream_base.h | 26 ++- .../parallel/test-net-onread-static-buffer.js | 186 ++++++++++++++++++ 7 files changed, 474 insertions(+), 65 deletions(-) create mode 100644 test/parallel/test-net-onread-static-buffer.js diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index e3c5c7e5eb41c6..d8c26db9bdb035 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -5,33 +5,68 @@ const common = require('../common.js'); const PORT = common.PORT; const bench = common.createBenchmark(main, { - len: [64, 102400, 1024 * 1024 * 16], + sendchunklen: [256, 32 * 1024, 128 * 1024, 16 * 1024 * 1024], type: ['utf', 'asc', 'buf'], + recvbuflen: [0, 64 * 1024, 1024 * 1024], + recvbufgenfn: ['true', 'false'], dur: [5] }); var chunk; var encoding; +var recvbuf; +var received = 0; + +function main({ dur, sendchunklen, type, recvbuflen, recvbufgenfn }) { + if (isFinite(recvbuflen) && recvbuflen > 0) + recvbuf = Buffer.alloc(recvbuflen); -function main({ dur, len, type }) { switch (type) { case 'buf': - chunk = Buffer.alloc(len, 'x'); + chunk = Buffer.alloc(sendchunklen, 'x'); break; case 'utf': encoding = 'utf8'; - chunk = 'ü'.repeat(len / 2); + chunk = 'ü'.repeat(sendchunklen / 2); break; case 'asc': encoding = 'ascii'; - chunk = 'x'.repeat(len); + chunk = 'x'.repeat(sendchunklen); break; default: throw new Error(`invalid type: ${type}`); } const reader = new Reader(); - const writer = new Writer(); + var writer; + var socketOpts; + if (recvbuf === undefined) { + writer = new Writer(); + socketOpts = { port: PORT }; + } else { + let buffer = recvbuf; + if (recvbufgenfn === 'true') { + let bufidx = -1; + const bufpool = [ + recvbuf, + Buffer.from(recvbuf), + Buffer.from(recvbuf), + ]; + buffer = () => { + bufidx = (bufidx + 1) % bufpool.length; + return bufpool[bufidx]; + }; + } + socketOpts = { + port: PORT, + onread: { + buffer, + callback: function(nread, buf) { + received += nread; + } + } + }; + } // The actual benchmark. const server = net.createServer((socket) => { @@ -39,14 +74,15 @@ function main({ dur, len, type }) { }); server.listen(PORT, () => { - const socket = net.connect(PORT); + const socket = net.connect(socketOpts); socket.on('connect', () => { bench.start(); - socket.pipe(writer); + if (recvbuf === undefined) + socket.pipe(writer); setTimeout(() => { - const bytes = writer.received; + const bytes = received; const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); @@ -58,12 +94,11 @@ function main({ dur, len, type }) { const net = require('net'); function Writer() { - this.received = 0; this.writable = true; } Writer.prototype.write = function(chunk, encoding, cb) { - this.received += chunk.length; + received += chunk.length; if (typeof encoding === 'function') encoding(); diff --git a/doc/api/net.md b/doc/api/net.md index 396cad36ab18dd..a396edf31a97bc 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -593,6 +593,9 @@ for the [`'connect'`][] event **once**. -The `tls.Server` class is a subclass of `net.Server` that accepts encrypted -connections using TLS or SSL. +* Extends: {net.Server} + +Accepts encrypted connections using TLS or SSL. ### Event: 'keylog' -The `tls.TLSSocket` is a subclass of [`net.Socket`][] that performs transparent -encryption of written data and all required TLS negotiation. +* Extends: {net.Socket} + +Performs transparent encryption of written data and all required TLS +negotiation. Instances of `tls.TLSSocket` implement the duplex [Stream][] interface. From 8599052283853419ba9f7a4acc5bd8cb76909a0c Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Wed, 21 Aug 2019 13:32:59 -0700 Subject: [PATCH 31/84] doc: add https.Server extends tls.Server PR-URL: https://github.com/nodejs/node/pull/29256 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Jiawen Geng --- doc/api/https.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/https.md b/doc/api/https.md index 6118004aec4fbd..172c91bbfa9fae 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -49,8 +49,9 @@ changes: added: v0.3.4 --> -This class is a subclass of `tls.Server` and emits events same as -[`http.Server`][]. See [`http.Server`][] for more information. +* Extends: {tls.Server} + +See [`http.Server`][] for more information. ### server.close([callback]) +* Extends: {Stream} + This object is created internally and returned from [`http.request()`][]. It represents an _in-progress_ request whose header has already been queued. The header is still mutable using the [`setHeader(name, value)`][], @@ -325,9 +327,6 @@ Unlike the `request` object, if the response closes prematurely, the Node.js does not check whether Content-Length and the length of the body which has been transmitted are equal or not. -The request inherits from [Stream][], and additionally implements the -following: - ### Event: 'abort' -This class inherits from [`net.Server`][] and has the following additional -events: +* Extends: {net.Server} ### Event: 'checkContinue' +* Extends: {Stream} + This object is created internally by an HTTP server — not by the user. It is passed as the second parameter to the [`'request'`][] event. -The response inherits from [Stream][], and additionally implements the -following: - ### Event: 'close' +* Extends: {stream.Readable} + An `IncomingMessage` object is created by [`http.Server`][] or [`http.ClientRequest`][] and passed as the first argument to the [`'request'`][] and [`'response'`][] event respectively. It may be used to access response status, headers and data. -It implements the [Readable Stream][] interface, as well as the -following additional events, methods, and properties. - ### Event: 'aborted' From db6e4ce239e0907021f8c4c1feea2f59dad62ac1 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 4 Jul 2019 15:57:09 -0700 Subject: [PATCH 35/84] src: expose MaybeInitializeContext to allow existing contexts Splits the node.js specific tweak intialization of NewContext into a new helper MaybeInitializeContext so that embedders with existing contexts can still use them in a Node.js Environment now that primordials are initialized and required so early. Update MaybeInitializeContext to return MaybeLocal, PR-URL: https://github.com/nodejs/node/pull/28544 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- src/api/environment.cc | 17 +++++++++++++---- src/node.h | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index ac1e513967310a..7fd219d6e8fcfe 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -353,6 +353,15 @@ Local NewContext(Isolate* isolate, Local object_template) { auto context = Context::New(isolate, nullptr, object_template); if (context.IsEmpty()) return context; + + if (!InitializeContext(context)) { + return Local(); + } + return context; +} + +bool InitializeContext(Local context) { + Isolate* isolate = context->GetIsolate(); HandleScope handle_scope(isolate); context->SetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration, @@ -373,7 +382,7 @@ Local NewContext(Isolate* isolate, if (!primordials->SetPrototype(context, Null(isolate)).FromJust() || !GetPerContextExports(context).ToLocal(&exports) || !exports->Set(context, primordials_string, primordials).FromJust()) { - return Local(); + return false; } static const char* context_files[] = {"internal/per_context/primordials", @@ -389,7 +398,7 @@ Local NewContext(Isolate* isolate, native_module::NativeModuleEnv::LookupAndCompile( context, *module, ¶meters, nullptr); if (maybe_fn.IsEmpty()) { - return Local(); + return false; } Local fn = maybe_fn.ToLocalChecked(); MaybeLocal result = @@ -398,12 +407,12 @@ Local NewContext(Isolate* isolate, // Execution failed during context creation. // TODO(joyeecheung): deprecate this signature and return a MaybeLocal. if (result.IsEmpty()) { - return Local(); + return false; } } } - return context; + return true; } uv_loop_t* GetCurrentEventLoop(Isolate* isolate) { diff --git a/src/node.h b/src/node.h index f78c76023bb667..13d71d41398545 100644 --- a/src/node.h +++ b/src/node.h @@ -299,6 +299,10 @@ NODE_EXTERN v8::Local NewContext( v8::Local object_template = v8::Local()); +// Runs Node.js-specific tweaks on an already constructed context +// Return value indicates success of operation +NODE_EXTERN bool InitializeContext(v8::Local context); + // If `platform` is passed, it will be used to register new Worker instances. // It can be `nullptr`, in which case creating new Workers inside of // Environments that use this `IsolateData` will not work. From a2c704773ac429125f197fabe74b792e4cfa9760 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 24 Aug 2019 18:35:50 -0700 Subject: [PATCH 36/84] doc,errors: add extends to derived classes PR-URL: https://github.com/nodejs/node/pull/29303 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/assert.md | 6 ++++-- doc/api/errors.md | 45 +++++++++++++++++++++++++--------------- tools/doc/type-parser.js | 2 ++ 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index fb33994df1586d..6057ba5c2afff1 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -10,8 +10,10 @@ lenient legacy mode. ## Class: assert.AssertionError -A subclass of `Error` that indicates the failure of an assertion. All errors -thrown by the `assert` module will be instances of the `AssertionError` class. +* Extends: {errors.Error} + +Indicates the failure of an assertion. All errors thrown by the `assert` module +will be instances of the `AssertionError` class. ### new assert.AssertionError(options) -A generic JavaScript `Error` object that does not denote any specific +A generic JavaScript {Error} object that does not denote any specific circumstance of why the error occurred. `Error` objects capture a "stack trace" detailing the point in the code at which the `Error` was instantiated, and may provide a text description of the error. @@ -352,14 +352,18 @@ loop tick. ## Class: AssertionError -A subclass of `Error` that indicates the failure of an assertion. For details, -see [`Class: assert.AssertionError`][]. +* Extends: {errors.Error} + +Indicates the failure of an assertion. For details, see +[`Class: assert.AssertionError`][]. ## Class: RangeError -A subclass of `Error` that indicates that a provided argument was not within the -set or range of acceptable values for a function; whether that is a numeric -range, or outside the set of options for a given function parameter. +* Extends: {errors.Error} + +Indicates that a provided argument was not within the set or range of +acceptable values for a function; whether that is a numeric range, or +outside the set of options for a given function parameter. ```js require('net').connect(-1); @@ -371,9 +375,11 @@ of argument validation. ## Class: ReferenceError -A subclass of `Error` that indicates that an attempt is being made to access a -variable that is not defined. Such errors commonly indicate typos in code, or -an otherwise broken program. +* Extends: {errors.Error} + +Indicates that an attempt is being made to access a variable that is not +defined. Such errors commonly indicate typos in code, or an otherwise broken +program. While client code may generate and propagate these errors, in practice, only V8 will do so. @@ -389,11 +395,12 @@ or its dependencies. ## Class: SyntaxError -A subclass of `Error` that indicates that a program is not valid JavaScript. -These errors may only be generated and propagated as a result of code -evaluation. Code evaluation may happen as a result of `eval`, `Function`, -`require`, or [vm][]. These errors are almost always indicative of a broken -program. +* Extends: {errors.Error} + +Indicates that a program is not valid JavaScript. These errors may only be +generated and propagated as a result of code evaluation. Code evaluation may +happen as a result of `eval`, `Function`, `require`, or [vm][]. These errors +are almost always indicative of a broken program. ```js try { @@ -408,6 +415,8 @@ they may only be caught by other contexts. ## Class: SystemError +* Extends: {errors.Error} + Node.js generates system errors when exceptions occur within its runtime environment. These usually occur when an application violates an operating system constraint. For example, a system error will occur if an application @@ -548,9 +557,11 @@ program. For a comprehensive list, see the [`errno`(3) man page][]. ## Class: TypeError -A subclass of `Error` that indicates that a provided argument is not an -allowable type. For example, passing a function to a parameter which expects a -string would be considered a `TypeError`. +* Extends {errors.Error} + +Indicates that a provided argument is not an allowable type. For example, +passing a function to a parameter which expects a string would be considered +a `TypeError`. ```js require('url').parse(() => { }); diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 6acc4196a36d99..c2c1147639bba7 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -64,6 +64,8 @@ const customTypesMap = { 'Domain': 'domain.html#domain_class_domain', + 'errors.Error': 'errors.html#errors_class_error', + 'import.meta': 'esm.html#esm_import_meta', 'EventEmitter': 'events.html#events_class_eventemitter', From 395245f1eb54ada2faeedaf8a94983e49683feb7 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 24 Aug 2019 18:59:14 -0700 Subject: [PATCH 37/84] doc,fs: add extends for derived classes PR-URL: https://github.com/nodejs/node/pull/29304 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/fs.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 7e8266a90ec63a..1dc2c6841cc0a5 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -374,11 +374,13 @@ value is determined by the `options.encoding` passed to [`fs.readdir()`][] or added: v0.5.8 --> +* Extends {EventEmitter} + A successful call to [`fs.watch()`][] method will return a new `fs.FSWatcher` object. -All `fs.FSWatcher` objects are [`EventEmitter`][]'s that will emit a `'change'` -event whenever a specific watched file is modified. +All `fs.FSWatcher` objects emit a `'change'` event whenever a specific watched +file is modified. ### Event: 'change' +* Extends: {stream.Readable} + A successful call to `fs.createReadStream()` will return a new `fs.ReadStream` object. -All `fs.ReadStream` objects are [Readable Streams][]. - ### Event: 'close' -`WriteStream` is a [Writable Stream][]. +* Extends {stream.Writable} ### Event: 'close' - `--abort-on-uncaught-exception` +- `--interpreted-frames-native-stack` - `--max-old-space-size` - `--perf-basic-prof-only-functions` - `--perf-basic-prof` diff --git a/src/node_options.cc b/src/node_options.cc index 2086214e65f735..98049453d8b24e 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -563,6 +563,9 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "for analysis", V8Option{}, kAllowedInEnvironment); + AddOption("--interpreted-frames-native-stack", + "help system profilers to translate JavaScript interpreted frames", + V8Option{}, kAllowedInEnvironment); AddOption("--max-old-space-size", "", V8Option{}, kAllowedInEnvironment); AddOption("--perf-basic-prof", "", V8Option{}, kAllowedInEnvironment); AddOption("--perf-basic-prof-only-functions", diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 07b69c5b130ea5..7e42139470e964 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -65,6 +65,9 @@ expect('--stack-trace-limit=100', /(\s*at f \(\[eval\]:1:\d*\)\r?\n){100}/, '(function f() { f(); })();', true); +// Unsupported on arm. See https://crbug.com/v8/8713. +if (!['arm', 'arm64'].includes(process.arch)) + expect('--interpreted-frames-native-stack', 'B\n'); function expect(opt, want, command = 'console.log("B")', wantsError = false) { const argv = ['-e', command]; From f4f88270e7b4acdbd8c5679f8f0c8d996456f3a8 Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 11 Jan 2019 22:36:26 -0500 Subject: [PATCH 45/84] process: improve nextTick performance PR-URL: https://github.com/nodejs/node/pull/25461 Reviewed-By: Matteo Collina Reviewed-By: Anna Henningsen --- benchmark/process/next-tick-breadth-args.js | 2 +- benchmark/process/next-tick-breadth.js | 2 +- benchmark/process/next-tick-depth-args.js | 2 +- benchmark/process/next-tick-depth.js | 2 +- benchmark/process/next-tick-exec-args.js | 2 +- benchmark/process/next-tick-exec.js | 2 +- lib/internal/fixed_queue.js | 2 +- lib/internal/process/task_queues.js | 42 +++++++++++---------- 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/benchmark/process/next-tick-breadth-args.js b/benchmark/process/next-tick-breadth-args.js index 6baa8d99609030..f7f9882c87e34b 100644 --- a/benchmark/process/next-tick-breadth-args.js +++ b/benchmark/process/next-tick-breadth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [4e6] + n: [1e7] }); function main({ n }) { diff --git a/benchmark/process/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js index 392d8e02093707..297bf43495d2e6 100644 --- a/benchmark/process/next-tick-breadth.js +++ b/benchmark/process/next-tick-breadth.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [4e6] + n: [1e7] }); function main({ n }) { diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index da61f90a647278..d9fc37887ec5a3 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [12e6] + n: [7e6] }); function main({ n }) { diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index c88e042b965ef4..5b0f817475f9b6 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [12e6] + n: [7e6] }); function main({ n }) { diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index f5d0fb94224148..ec172ea8931e3f 100644 --- a/benchmark/process/next-tick-exec-args.js +++ b/benchmark/process/next-tick-exec-args.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [4e6] }); function main({ n }) { diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index 936b253bfaf324..14fce9cccf8d6a 100644 --- a/benchmark/process/next-tick-exec.js +++ b/benchmark/process/next-tick-exec.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [4e6] }); function main({ n }) { diff --git a/lib/internal/fixed_queue.js b/lib/internal/fixed_queue.js index 7571a8f67e36d2..a073ab7fc327af 100644 --- a/lib/internal/fixed_queue.js +++ b/lib/internal/fixed_queue.js @@ -102,7 +102,7 @@ module.exports = class FixedQueue { } shift() { - const { tail } = this; + const tail = this.tail; const next = tail.shift(); if (tail.isEmpty() && tail.next !== null) { // If there is another queue, it forms the new tail. diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 68b5d8b343d206..8906b4aa1e2426 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -71,10 +71,18 @@ function processTicksAndRejections() { try { const callback = tock.callback; - if (tock.args === undefined) + if (tock.args === undefined) { callback(); - else - callback(...tock.args); + } else { + const args = tock.args; + switch (args.length) { + case 1: callback(args[0]); break; + case 2: callback(args[0], args[1]); break; + case 3: callback(args[0], args[1], args[2]); break; + case 4: callback(args[0], args[1], args[2], args[3]); break; + default: callback(...args); + } + } } finally { if (destroyHooksExist()) emitDestroy(asyncId); @@ -88,22 +96,6 @@ function processTicksAndRejections() { setHasRejectionToWarn(false); } -class TickObject { - constructor(callback, args) { - this.callback = callback; - this.args = args; - - const asyncId = newAsyncId(); - const triggerAsyncId = getDefaultTriggerAsyncId(); - this[async_id_symbol] = asyncId; - this[trigger_async_id_symbol] = triggerAsyncId; - - if (initHooksExist()) { - emitInit(asyncId, 'TickObject', triggerAsyncId, this); - } - } -} - // `nextTick()` will not enqueue any callback when the process is about to // exit since the callback would not have a chance to be executed. function nextTick(callback) { @@ -127,7 +119,17 @@ function nextTick(callback) { if (queue.isEmpty()) setHasTickScheduled(true); - queue.push(new TickObject(callback, args)); + const asyncId = newAsyncId(); + const triggerAsyncId = getDefaultTriggerAsyncId(); + const tickObject = { + [async_id_symbol]: asyncId, + [trigger_async_id_symbol]: triggerAsyncId, + callback, + args + }; + if (initHooksExist()) + emitInit(asyncId, 'TickObject', triggerAsyncId, tickObject); + queue.push(tickObject); } let AsyncResource; From bd1e8eacf32ced3df7e7104f85d13f10d6b0d017 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 27 Aug 2019 14:55:40 -0700 Subject: [PATCH 46/84] test: fix flaky test-http-server-keepalive-req-gc Use `server` to keep the event loop open until the `ongc` listener runs. PR-URL: https://github.com/nodejs/node/pull/29347 Fixes: https://github.com/nodejs/node/issues/29344 Reviewed-By: Anna Henningsen Reviewed-By: Daniel Bevenius --- test/parallel/test-http-server-keepalive-req-gc.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/parallel/test-http-server-keepalive-req-gc.js b/test/parallel/test-http-server-keepalive-req-gc.js index aa4bf1a3de9c83..77defb5154676e 100644 --- a/test/parallel/test-http-server-keepalive-req-gc.js +++ b/test/parallel/test-http-server-keepalive-req-gc.js @@ -16,7 +16,7 @@ if (common.isWindows) { let client; const server = createServer(common.mustCall((req, res) => { - onGC(req, { ongc: common.mustCall() }); + onGC(req, { ongc: common.mustCall(() => { server.close(); }) }); req.resume(); req.on('end', common.mustCall(() => { setImmediate(() => { @@ -27,8 +27,6 @@ const server = createServer(common.mustCall((req, res) => { res.end('hello world'); })); -server.unref(); - server.listen(0, common.mustCall(() => { client = connect(server.address().port); From 0e1ccca81dc9db439865058b67bdd7d82a92d1ed Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 25 Aug 2019 00:27:53 -0400 Subject: [PATCH 47/84] querystring: improve performance PR-URL: https://github.com/nodejs/node/pull/29306 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Yongsheng Zhang --- lib/querystring.js | 68 +++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/lib/querystring.js b/lib/querystring.js index a09dc7d4261250..9fac6e2627c08b 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -174,19 +174,22 @@ function stringify(obj, sep, eq, options) { for (var i = 0; i < len; ++i) { var k = keys[i]; var v = obj[k]; - var ks = encode(stringifyPrimitive(k)) + eq; + var ks = encode(stringifyPrimitive(k)); + ks += eq; if (Array.isArray(v)) { var vlen = v.length; if (vlen === 0) continue; var vlast = vlen - 1; for (var j = 0; j < vlen; ++j) { - fields += ks + encode(stringifyPrimitive(v[j])); + fields += ks; + fields += encode(stringifyPrimitive(v[j])); if (j < vlast) fields += sep; } } else { - fields += ks + encode(stringifyPrimitive(v)); + fields += ks; + fields += encode(stringifyPrimitive(v)); } if (i < flast) @@ -200,14 +203,34 @@ function stringify(obj, sep, eq, options) { function charCodes(str) { if (str.length === 0) return []; if (str.length === 1) return [str.charCodeAt(0)]; - const ret = []; + const ret = new Array(str.length); for (var i = 0; i < str.length; ++i) - ret[ret.length] = str.charCodeAt(i); + ret[i] = str.charCodeAt(i); return ret; } const defSepCodes = [38]; // & const defEqCodes = [61]; // = +function addKeyVal(obj, key, value, keyEncoded, valEncoded, decode) { + if (key.length > 0 && keyEncoded) + key = decodeStr(key, decode); + if (value.length > 0 && valEncoded) + value = decodeStr(value, decode); + + if (obj[key] === undefined) { + obj[key] = value; + } else { + const curValue = obj[key]; + // A simple Array-specific property check is enough here to + // distinguish from a string value and is faster and still safe + // since we are generating all of the values being assigned. + if (curValue.pop) + curValue[curValue.length] = value; + else + obj[key] = [curValue, value]; + } +} + // Parse a key/val string. function parse(qs, sep, eq, options) { const obj = Object.create(null); @@ -272,23 +295,8 @@ function parse(qs, sep, eq, options) { value += qs.slice(lastPos, end); } - if (key.length > 0 && keyEncoded) - key = decodeStr(key, decode); - if (value.length > 0 && valEncoded) - value = decodeStr(value, decode); + addKeyVal(obj, key, value, keyEncoded, valEncoded, decode); - if (obj[key] === undefined) { - obj[key] = value; - } else { - const curValue = obj[key]; - // A simple Array-specific property check is enough here to - // distinguish from a string value and is faster and still safe - // since we are generating all of the values being assigned. - if (curValue.pop) - curValue[curValue.length] = value; - else - obj[key] = [curValue, value]; - } if (--pairs === 0) return obj; keyEncoded = valEncoded = customDecode; @@ -370,22 +378,8 @@ function parse(qs, sep, eq, options) { // We ended on an empty substring return obj; } - if (key.length > 0 && keyEncoded) - key = decodeStr(key, decode); - if (value.length > 0 && valEncoded) - value = decodeStr(value, decode); - if (obj[key] === undefined) { - obj[key] = value; - } else { - const curValue = obj[key]; - // A simple Array-specific property check is enough here to - // distinguish from a string value and is faster and still safe since - // we are generating all of the values being assigned. - if (curValue.pop) - curValue[curValue.length] = value; - else - obj[key] = [curValue, value]; - } + + addKeyVal(obj, key, value, keyEncoded, valEncoded, decode); return obj; } From 2df84752c6b490355a1cc54f3413ac849d2c7236 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 25 Aug 2019 23:50:55 -0400 Subject: [PATCH 48/84] tools: update babel-eslint to 10.0.3 PR-URL: https://github.com/nodejs/node/pull/29320 Reviewed-By: Rich Trott Reviewed-By: Daniel Bevenius Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat Reviewed-By: Roman Reiss --- .../babel-eslint/lib/analyze-scope.js | 12 +- .../babel-eslint/lib/require-from-eslint.js | 9 + .../node_modules/@babel/code-frame/LICENSE | 2 +- .../@babel/code-frame/lib/index.js | 6 +- .../@babel/code-frame/package.json | 6 +- .../@babel/generator/lib/generators/flow.js | 13 +- .../@babel/generator/package.json | 12 +- .../node_modules/@babel/highlight/LICENSE | 2 +- .../@babel/highlight/package.json | 6 +- .../node_modules/@babel/parser/lib/index.js | 173 ++-- .../node_modules/@babel/parser/package.json | 8 +- .../@babel/traverse/lib/path/modification.js | 4 +- .../@babel/traverse/lib/path/replacement.js | 8 + .../node_modules/@babel/traverse/package.json | 14 +- .../@babel/types/lib/definitions/es2015.js | 17 +- .../@babel/types/lib/definitions/flow.js | 2 +- .../types/lib/definitions/typescript.js | 1 + .../@babel/types/lib/definitions/utils.js | 29 + .../@babel/types/lib/index.js.flow | 21 +- .../types/lib/validators/generated/index.js | 6 +- .../@babel/types/lib/validators/validate.js | 5 + .../node_modules/@babel/types/package.json | 10 +- .../types/scripts/utils/stringifyValidator.js | 23 + .../node_modules/eslint-scope/LICENSE | 23 - .../node_modules/eslint-scope/README.md | 54 -- .../eslint-scope/lib/definition.js | 86 -- .../node_modules/eslint-scope/lib/index.js | 165 ---- .../eslint-scope/lib/pattern-visitor.js | 152 ---- .../eslint-scope/lib/reference.js | 167 ---- .../eslint-scope/lib/referencer.js | 638 ------------- .../eslint-scope/lib/scope-manager.js | 255 ------ .../node_modules/eslint-scope/lib/scope.js | 722 --------------- .../node_modules/eslint-scope/lib/variable.js | 89 -- .../node_modules/eslint-scope/package.json | 51 -- .../eslint-visitor-keys/lib/visitor-keys.json | 3 + .../eslint-visitor-keys/package.json | 11 +- .../node_modules/esrecurse/README.md | 171 ---- .../node_modules/esrecurse/esrecurse.js | 117 --- .../node_modules/esrecurse/package.json | 57 -- .../node_modules/estraverse/LICENSE.BSD | 19 - .../node_modules/estraverse/estraverse.js | 849 ------------------ .../node_modules/estraverse/package.json | 45 - .../node_modules/esutils/README.md | 17 +- .../node_modules/esutils/lib/code.js | 18 +- .../node_modules/esutils/package.json | 13 +- .../babel-eslint/node_modules/lodash/LICENSE | 2 +- .../node_modules/lodash/README.md | 6 +- .../node_modules/lodash/_baseClone.js | 8 +- .../node_modules/lodash/_baseMerge.js | 2 +- .../node_modules/lodash/_createRound.js | 8 +- .../node_modules/lodash/_safeGet.js | 6 +- .../babel-eslint/node_modules/lodash/core.js | 4 +- .../node_modules/lodash/core.min.js | 2 +- .../node_modules/lodash/debounce.js | 1 + .../node_modules/lodash/lodash.js | 43 +- .../node_modules/lodash/lodash.min.js | 236 ++--- .../node_modules/lodash/package.json | 11 +- .../node_modules/lodash/template.js | 19 +- .../node_modules/path-parse/LICENSE | 21 + .../node_modules/path-parse/README.md | 42 + .../node_modules/path-parse/index.js | 93 ++ .../node_modules/path-parse/package.json | 38 + .../babel-eslint/node_modules/resolve/LICENSE | 21 + .../node_modules/resolve/index.js | 8 + .../node_modules/resolve/lib/async.js | 271 ++++++ .../node_modules/resolve/lib/caller.js | 8 + .../node_modules/resolve/lib/core.js | 53 ++ .../node_modules/resolve/lib/core.json | 74 ++ .../resolve/lib/node-modules-paths.js | 42 + .../resolve/lib/normalize-options.js | 10 + .../node_modules/resolve/lib/sync.js | 172 ++++ .../node_modules/resolve/package.json | 49 + .../node_modules/resolve/readme.markdown | 201 +++++ tools/node_modules/babel-eslint/package.json | 6 +- 74 files changed, 1591 insertions(+), 3977 deletions(-) create mode 100644 tools/node_modules/babel-eslint/lib/require-from-eslint.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/LICENSE delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/definition.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/pattern-visitor.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/reference.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/referencer.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope-manager.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/variable.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/eslint-scope/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/esrecurse/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/esrecurse/esrecurse.js delete mode 100755 tools/node_modules/babel-eslint/node_modules/esrecurse/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/estraverse/LICENSE.BSD delete mode 100644 tools/node_modules/babel-eslint/node_modules/estraverse/estraverse.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/estraverse/package.json create mode 100644 tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE create mode 100644 tools/node_modules/babel-eslint/node_modules/path-parse/README.md create mode 100644 tools/node_modules/babel-eslint/node_modules/path-parse/index.js create mode 100644 tools/node_modules/babel-eslint/node_modules/path-parse/package.json create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/LICENSE create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/index.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/package.json create mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown diff --git a/tools/node_modules/babel-eslint/lib/analyze-scope.js b/tools/node_modules/babel-eslint/lib/analyze-scope.js index 05b470b1b10b6c..9ad95bd2517e4f 100644 --- a/tools/node_modules/babel-eslint/lib/analyze-scope.js +++ b/tools/node_modules/babel-eslint/lib/analyze-scope.js @@ -1,10 +1,14 @@ "use strict"; const t = require("@babel/types"); -const escope = require("eslint-scope"); -const Definition = require("eslint-scope/lib/definition").Definition; -const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor"); -const OriginalReferencer = require("eslint-scope/lib/referencer"); +const requireFromESLint = require("./require-from-eslint"); + +const escope = requireFromESLint("eslint-scope"); +const Definition = requireFromESLint("eslint-scope/lib/definition").Definition; +const OriginalPatternVisitor = requireFromESLint( + "eslint-scope/lib/pattern-visitor" +); +const OriginalReferencer = requireFromESLint("eslint-scope/lib/referencer"); const fallback = require("eslint-visitor-keys").getKeys; const childVisitorKeys = require("./visitor-keys"); diff --git a/tools/node_modules/babel-eslint/lib/require-from-eslint.js b/tools/node_modules/babel-eslint/lib/require-from-eslint.js new file mode 100644 index 00000000000000..3834689f54bde4 --- /dev/null +++ b/tools/node_modules/babel-eslint/lib/require-from-eslint.js @@ -0,0 +1,9 @@ +"use strict"; + +const resolve = require("resolve"); +const eslintBase = require.resolve("eslint"); + +module.exports = function requireFromESLint(id) { + const path = resolve.sync(id, { basedir: eslintBase }); + return require(path); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE index 620366eb90071c..f31575ec773bb1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE +++ b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2014-2018 Sebastian McKenzie +Copyright (c) 2014-present Sebastian McKenzie and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js index 1f64c6ce7b992d..35176fbc0682ca 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js @@ -66,7 +66,7 @@ function getMarkerLines(loc, source, opts) { markerLines[lineNumber] = true; } else if (i === 0) { const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn]; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; } else if (i === lineDiff) { markerLines[lineNumber] = [0, endColumn]; } else { @@ -102,7 +102,6 @@ function codeFrameColumns(rawLines, loc, opts = {}) { return highlighted ? chalkFn(string) : string; }; - if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts); const lines = rawLines.split(NEWLINE); const { start, @@ -111,7 +110,8 @@ function codeFrameColumns(rawLines, loc, opts = {}) { } = getMarkerLines(loc, lines, opts); const hasColumns = loc.start && typeof loc.start.column === "number"; const numberMaxWidth = String(end).length; - let frame = lines.slice(start, end).map((line, index) => { + const highlightedLines = highlighted ? (0, _highlight().default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); const gutter = ` ${paddedNumber} | `; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json index f3b551dfa972de..d619d9a8f53194 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json @@ -13,13 +13,17 @@ "chalk": "^2.0.0", "strip-ansi": "^4.0.0" }, + "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", "name": "@babel/code-frame", + "publishConfig": { + "access": "public" + }, "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame" }, - "version": "7.0.0" + "version": "7.5.5" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js b/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js index 0b24d2ccad1ee6..8853fd8aabcefa 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js @@ -492,7 +492,7 @@ function ObjectTypeAnnotation(node) { indent: true, statement: true, iterator: () => { - if (props.length !== 1) { + if (props.length !== 1 || node.inexact) { this.token(","); this.space(); } @@ -501,6 +501,17 @@ function ObjectTypeAnnotation(node) { this.space(); } + if (node.inexact) { + this.indent(); + this.token("..."); + + if (props.length) { + this.newline(); + } + + this.dedent(); + } + if (node.exact) { this.token("|}"); } else { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json index c1a8311407f601..6eca8973ea377b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json @@ -5,22 +5,22 @@ }, "bundleDependencies": false, "dependencies": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.5.5", "jsesc": "^2.5.1", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, "deprecated": false, "description": "Turns an AST into code.", "devDependencies": { - "@babel/helper-fixtures": "^7.4.4", - "@babel/parser": "^7.4.4" + "@babel/helper-fixtures": "^7.5.5", + "@babel/parser": "^7.5.5" }, "files": [ "lib" ], - "gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba", + "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", @@ -32,5 +32,5 @@ "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-generator" }, - "version": "7.4.4" + "version": "7.5.5" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE b/tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE index 620366eb90071c..f31575ec773bb1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE +++ b/tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2014-2018 Sebastian McKenzie +Copyright (c) 2014-present Sebastian McKenzie and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json index ff84c66ec29732..9c16718356c0a9 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json @@ -14,13 +14,17 @@ "devDependencies": { "strip-ansi": "^4.0.0" }, + "gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", "name": "@babel/highlight", + "publishConfig": { + "access": "public" + }, "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-highlight" }, - "version": "7.0.0" + "version": "7.5.0" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js index 5c5e616572add9..81b6994d07e99d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js @@ -940,7 +940,7 @@ var flow = (superClass => class extends superClass { if (this.match(types._import)) { this.next(); - if (!this.isContextual("type") && !this.isContextual("typeof")) { + if (!this.isContextual("type") && !this.match(types._typeof)) { this.unexpected(this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`"); } @@ -1170,11 +1170,7 @@ var flow = (superClass => class extends superClass { return this.finishNode(node, "OpaqueType"); } - flowParseTypeParameter(allowDefault = true, requireDefault = false) { - if (!allowDefault && requireDefault) { - throw new Error("Cannot disallow a default value (`allowDefault`) while also requiring it (`requireDefault`)."); - } - + flowParseTypeParameter(requireDefault = false) { const nodeStart = this.state.start; const node = this.startNode(); const variance = this.flowParseVariance(); @@ -1184,12 +1180,8 @@ var flow = (superClass => class extends superClass { node.bound = ident.typeAnnotation; if (this.match(types.eq)) { - if (allowDefault) { - this.eat(types.eq); - node.default = this.flowParseType(); - } else { - this.unexpected(); - } + this.eat(types.eq); + node.default = this.flowParseType(); } else { if (requireDefault) { this.unexpected(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default."); @@ -1199,7 +1191,7 @@ var flow = (superClass => class extends superClass { return this.finishNode(node, "TypeParameter"); } - flowParseTypeParameterDeclaration(allowDefault = true) { + flowParseTypeParameterDeclaration() { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; @@ -1214,7 +1206,7 @@ var flow = (superClass => class extends superClass { let defaultRequired = false; do { - const typeParameter = this.flowParseTypeParameter(allowDefault, defaultRequired); + const typeParameter = this.flowParseTypeParameter(defaultRequired); node.params.push(typeParameter); if (typeParameter.default) { @@ -1345,7 +1337,7 @@ var flow = (superClass => class extends superClass { node.typeParameters = null; if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(false); + node.typeParameters = this.flowParseTypeParameterDeclaration(); } this.expect(types.parenL); @@ -1751,11 +1743,14 @@ var flow = (superClass => class extends superClass { }); case types.bracketL: - return this.flowParseTupleType(); + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; case types.relational: if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(false); + node.typeParameters = this.flowParseTypeParameterDeclaration(); this.expect(types.parenL); tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; @@ -1820,11 +1815,15 @@ var flow = (superClass => class extends superClass { if (this.state.value === "-") { this.next(); - if (!this.match(types.num)) { - this.unexpected(null, `Unexpected token, expected "number"`); + if (this.match(types.num)) { + return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + } + + if (this.match(types.bigint)) { + return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); } - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + this.unexpected(null, `Unexpected token, expected "number" or "bigint"`); } this.unexpected(); @@ -1832,6 +1831,9 @@ var flow = (superClass => class extends superClass { case types.num: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case types.bigint: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + case types._void: this.next(); return this.finishNode(node, "VoidTypeAnnotation"); @@ -2381,7 +2383,7 @@ var flow = (superClass => class extends superClass { delete method.variance; if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(false); + method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); @@ -2443,7 +2445,7 @@ var flow = (superClass => class extends superClass { let typeParameters; if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(false); + typeParameters = this.flowParseTypeParameterDeclaration(); if (!this.match(types.parenL)) this.unexpected(); } @@ -2587,7 +2589,7 @@ var flow = (superClass => class extends superClass { const kind = node.kind; if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(false); + node.typeParameters = this.flowParseTypeParameterDeclaration(); } super.parseFunctionParams(node, allowModifiers); @@ -3992,10 +3994,6 @@ var typescript = (superClass => class extends superClass { return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true)); } - tsTryParseDelimitedList(kind, parseElement) { - return this.tsParseDelimitedListWorker(kind, parseElement, false); - } - tsParseDelimitedListWorker(kind, parseElement, expectSuccess) { const result = []; @@ -4965,24 +4963,6 @@ var typescript = (superClass => class extends superClass { } } - nodeWithSamePosition(original, type) { - const node = this.startNodeAtNode(original); - node.type = type; - node.end = original.end; - node.loc.end = original.loc.end; - - if (original.leadingComments) { - node.leadingComments = original.leadingComments; - } - - if (original.trailingComments) { - node.trailingComments = original.trailingComments; - } - - if (original.innerComments) node.innerComments = original.innerComments; - return node; - } - tsTryParseDeclare(nany) { if (this.isLineTerminator()) { return; @@ -6080,7 +6060,7 @@ function getPluginOption(plugins, name, option) { return null; } -const PIPELINE_PROPOSALS = ["minimal", "smart"]; +const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"]; function validatePlugins(plugins) { if (hasPlugin(plugins, "decorators")) { if (hasPlugin(plugins, "decorators-legacy")) { @@ -6121,6 +6101,7 @@ const defaultOptions = { allowReturnOutsideFunction: false, allowImportExportEverywhere: false, allowSuperOutsideMethod: false, + allowUndeclaredExports: false, plugins: [], strictMode: null, ranges: false, @@ -6377,6 +6358,8 @@ class State { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; + this.soloAwait = false; + this.inFSharpPipelineDirectBody = false; this.classLevel = 0; this.labels = []; this.decoratorStack = [[]]; @@ -8030,6 +8013,10 @@ class LValParser extends NodeUtils { } } + if (bindingType === BIND_LEXICAL && expr.name === "let") { + this.raise(expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations."); + } + if (!(bindingType & BIND_NONE)) { this.scope.declareName(expr.name, bindingType, expr.start); } @@ -8295,8 +8282,13 @@ class ExpressionParser extends LValParser { if (prec != null && (!noIn || !this.match(types._in))) { if (prec > minPrec) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); const operator = this.state.value; + + if (operator === "|>" && this.state.inFSharpPipelineDirectBody) { + return left; + } + + const node = this.startNodeAt(leftStartPos, leftStartLoc); node.left = left; node.operator = operator; @@ -8332,14 +8324,21 @@ class ExpressionParser extends LValParser { } parseExprOpRightExpr(op, prec, noIn) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + switch (op) { case types.pipeline: - if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc); - }); + switch (this.getPluginOption("pipelineOperator", "proposal")) { + case "smart": + return this.withTopicPermittingContext(() => { + return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc); + }); + + case "fsharp": + return this.withSoloAwaitPermittingContext(() => { + return this.parseFSharpPipelineBody(prec, noIn); + }); } default: @@ -8597,6 +8596,8 @@ class ExpressionParser extends LValParser { const elts = []; let innerParenStart; let first = true; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; while (!this.eat(close)) { if (first) { @@ -8628,6 +8629,7 @@ class ExpressionParser extends LValParser { this.unexpected(); } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } @@ -8760,18 +8762,29 @@ class ExpressionParser extends LValParser { return this.parseParenAndDistinguishExpression(canBeArrow); case types.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos); + { + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos); - if (!this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } + if (!this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } - return this.finishNode(node, "ArrayExpression"); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return this.finishNode(node, "ArrayExpression"); + } case types.braceL: - return this.parseObj(false, refShorthandDefaultPos); + { + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const ret = this.parseObj(false, refShorthandDefaultPos); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } case types._function: return this.parseFunctionExpression(); @@ -8924,9 +8937,11 @@ class ExpressionParser extends LValParser { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; this.state.yieldPos = 0; this.state.awaitPos = 0; + this.state.inFSharpPipelineDirectBody = false; const innerStartPos = this.state.start; const innerStartLoc = this.state.startLoc; const exprList = []; @@ -8968,6 +8983,7 @@ class ExpressionParser extends LValParser { const innerEndLoc = this.state.startLoc; this.expect(types.parenR); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let arrowNode = this.startNodeAt(startPos, startLoc); if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { @@ -9557,7 +9573,10 @@ class ExpressionParser extends LValParser { this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); } - node.argument = this.parseMaybeUnary(); + if (!this.state.soloAwait) { + node.argument = this.parseMaybeUnary(); + } + return this.finishNode(node, "AwaitExpression"); } @@ -9686,6 +9705,17 @@ class ExpressionParser extends LValParser { } } + withSoloAwaitPermittingContext(callback) { + const outerContextSoloAwaitState = this.state.soloAwait; + this.state.soloAwait = true; + + try { + return callback(); + } finally { + this.state.soloAwait = outerContextSoloAwaitState; + } + } + registerTopicReference() { this.state.topicContext.maxTopicIndex = 0; } @@ -9698,6 +9728,17 @@ class ExpressionParser extends LValParser { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } + parseFSharpPipelineBody(prec, noIn) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.state.potentialArrowAt = this.state.start; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = true; + const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } + } const loopLabel = { @@ -9716,7 +9757,7 @@ class StatementParser extends ExpressionParser { program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, types.eof); - if (this.inModule && this.scope.undefinedExports.size > 0) { + if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) { const [name] = _Array$from[_i]; const pos = this.scope.undefinedExports.get(name); @@ -9995,7 +10036,7 @@ class StatementParser extends ExpressionParser { node.expression = this.parseMaybeDecoratorArguments(expr); this.state.decoratorStack.pop(); } else { - node.expression = this.parseMaybeAssign(); + node.expression = this.parseExprSubscripts(); } return this.finishNode(node, "Decorator"); @@ -10457,10 +10498,6 @@ class StatementParser extends ExpressionParser { } parseVarId(decl, kind) { - if ((kind === "const" || kind === "let") && this.isContextual("let")) { - this.unexpected(null, "let is disallowed as a lexically bound name"); - } - decl.id = this.parseBindingAtom(); this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration"); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json index 2c4ad12717a1a5..4bfd8d41cb84c0 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json @@ -10,8 +10,8 @@ "deprecated": false, "description": "A JavaScript parser", "devDependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/helper-fixtures": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/helper-fixtures": "^7.5.5", "charcodes": "^0.2.0", "unicode-12.0.0": "^0.7.9" }, @@ -23,7 +23,7 @@ "lib", "typings" ], - "gitHead": "33ab4f166117e2380de3955a0842985f578b01b8", + "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "homepage": "https://babeljs.io/", "keywords": [ "babel", @@ -44,5 +44,5 @@ "url": "https://github.com/babel/babel/tree/master/packages/babel-parser" }, "types": "typings/babel-parser.d.ts", - "version": "7.4.5" + "version": "7.5.5" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js index b522de8c75f945..34cee6fb1cf745 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js @@ -44,7 +44,7 @@ function insertBefore(nodes) { if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { return parentPath.insertBefore(nodes); - } else if (this.isNodeType("Expression") && this.listKey !== "params" && this.listKey !== "arguments" || parentPath.isForStatement() && this.key === "init") { + } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { if (this.node) nodes.push(this.node); return this.replaceExpressionWithStatements(nodes); } else if (Array.isArray(this.container)) { @@ -196,7 +196,7 @@ function unshiftContainer(listKey, nodes) { key: 0 }); - return path.insertBefore(nodes); + return path._containerInsertBefore(nodes); } function pushContainer(listKey, nodes) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js index 36e6c9fdd2d9c7..a204ca6ef819e2 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js @@ -206,6 +206,8 @@ function replaceExpressionWithStatements(nodes) { return this.replaceWith(toSequenceExpression)[0].get("expressions"); } + const functionParent = this.getFunctionParent(); + const isParentAsync = functionParent && functionParent.is("async"); const container = t().arrowFunctionExpression([], t().blockStatement(nodes)); this.replaceWith(t().callExpression(container, [])); this.traverse(hoistVariablesVisitor); @@ -235,6 +237,12 @@ function replaceExpressionWithStatements(nodes) { const callee = this.get("callee"); callee.arrowFunctionToExpression(); + + if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) { + callee.set("async", true); + this.replaceWith(t().awaitExpression(this.node)); + } + return callee.get("body.body"); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json index 9eff77c00ee98b..f53af95bf56a7c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json @@ -5,22 +5,22 @@ }, "bundleDependencies": false, "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.5", - "@babel/types": "^7.4.4", + "@babel/parser": "^7.5.5", + "@babel/types": "^7.5.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" }, "deprecated": false, "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "devDependencies": { "@babel/helper-plugin-test-runner": "^7.0.0" }, - "gitHead": "33ab4f166117e2380de3955a0842985f578b01b8", + "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", @@ -32,5 +32,5 @@ "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-traverse" }, - "version": "7.4.5" + "version": "7.5.5" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js index b4ce6fa04d99af..71e01365390ebf 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js @@ -17,7 +17,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; aliases: ["Pattern", "PatternLike", "LVal"], fields: Object.assign({}, _core.patternLikeCommon, { left: { - validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern") + validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression") }, right: { validate: (0, _utils.assertNodeType)("Expression") @@ -158,7 +158,8 @@ const classCommon = { source: { validate: (0, _utils.assertNodeType)("StringLiteral"), optional: true - } + }, + exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) } }); (0, _utils.default)("ExportSpecifier", { @@ -354,7 +355,17 @@ exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; (0, _utils.default)("TemplateElement", { builder: ["value", "tail"], fields: { - value: {}, + value: { + validate: (0, _utils.assertShape)({ + raw: { + validate: (0, _utils.assertValueType)("string") + }, + cooked: { + validate: (0, _utils.assertValueType)("string"), + optional: true + } + }) + }, tail: { validate: (0, _utils.assertValueType)("boolean"), default: false diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js index 6969237dfa3dbc..07db5e38323cf5 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js @@ -118,7 +118,7 @@ defineInterfaceishType("DeclareInterface"); aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], fields: { source: (0, _utils.validateType)("StringLiteral"), - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)(["type", "value"])) + exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) } }); (0, _utils.default)("DeclaredPredicate", { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js index 6760567a53ad42..4d9be114a5d88c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js @@ -319,6 +319,7 @@ const unionOrIntersection = { } }); (0, _utils.default)("TSModuleBlock", { + aliases: ["Scopable", "Block", "BlockParent"], visitor: ["body"], fields: { body: (0, _utils.validateArrayOfType)("Statement") diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js index f049ccc173cd4d..95ba9740c49588 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js @@ -16,12 +16,15 @@ exports.assertOneOf = assertOneOf; exports.assertNodeType = assertNodeType; exports.assertNodeOrValueType = assertNodeOrValueType; exports.assertValueType = assertValueType; +exports.assertShape = assertShape; exports.chain = chain; exports.default = defineType; exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; var _is = _interopRequireDefault(require("../validators/is")); +var _validate = require("../validators/validate"); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const VISITOR_KEYS = {}; @@ -166,6 +169,32 @@ function assertValueType(type) { return validate; } +function assertShape(shape) { + function validate(node, key, val) { + const errors = []; + + for (const property of Object.keys(shape)) { + try { + (0, _validate.validateField)(node, property, val[property], shape[property]); + } catch (error) { + if (error instanceof TypeError) { + errors.push(error.message); + continue; + } + + throw error; + } + } + + if (errors.length) { + throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`); + } + } + + validate.shapeOf = shape; + return validate; +} + function chain(...fns) { function validate(...args) { for (const fn of fns) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow index b717fab48db516..c7e80a15fdb1a2 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow @@ -372,7 +372,7 @@ declare class BabelNodeWithStatement extends BabelNode { declare class BabelNodeAssignmentPattern extends BabelNode { type: "AssignmentPattern"; - left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern; + left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression; right: BabelNodeExpression; decorators?: Array; typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; @@ -440,6 +440,7 @@ declare class BabelNodeExportNamedDeclaration extends BabelNode { declaration?: BabelNodeDeclaration; specifiers: Array; source?: BabelNodeStringLiteral; + exportKind?: "type" | "value"; } declare class BabelNodeExportSpecifier extends BabelNode { @@ -528,7 +529,7 @@ declare class BabelNodeTaggedTemplateExpression extends BabelNode { declare class BabelNodeTemplateElement extends BabelNode { type: "TemplateElement"; - value: any; + value: { raw: string, cooked?: string }; tail?: boolean; } @@ -635,7 +636,7 @@ declare class BabelNodeDeclareExportDeclaration extends BabelNode { declare class BabelNodeDeclareExportAllDeclaration extends BabelNode { type: "DeclareExportAllDeclaration"; source: BabelNodeStringLiteral; - exportKind?: ["type","value"]; + exportKind?: "type" | "value"; } declare class BabelNodeDeclaredPredicate extends BabelNode { @@ -1423,9 +1424,9 @@ declare class BabelNodeTSTypeParameter extends BabelNode { type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeParenthesizedExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeAwaitExpression | BabelNodeBindExpression | BabelNodeOptionalMemberExpression | BabelNodePipelinePrimaryTopicReference | BabelNodeOptionalCallExpression | BabelNodeImport | BabelNodeDoExpression | BabelNodeBigIntLiteral | BabelNodeTSAsExpression | BabelNodeTSTypeAssertion | BabelNodeTSNonNullExpression; type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression; -type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram; +type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeTSModuleBlock; +type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeTSModuleBlock; +type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram | BabelNodeTSModuleBlock; type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration | BabelNodeTSImportEqualsDeclaration | BabelNodeTSExportAssignment | BabelNodeTSNamespaceExportDeclaration; type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression; type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement; @@ -1516,7 +1517,7 @@ declare module "@babel/types" { declare function variableDeclarator(id: BabelNodeLVal, init?: BabelNodeExpression, definite?: boolean): BabelNodeVariableDeclarator; declare function whileStatement(test: BabelNodeExpression, body: BabelNodeBlockStatement | BabelNodeStatement): BabelNodeWhileStatement; declare function withStatement(object: BabelNodeExpression, body: BabelNodeBlockStatement | BabelNodeStatement): BabelNodeWithStatement; - declare function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern, right: BabelNodeExpression, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeAssignmentPattern; + declare function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression, right: BabelNodeExpression, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeAssignmentPattern; declare function arrayPattern(elements: Array, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeArrayPattern; declare function arrowFunctionExpression(params: Array, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean, expression?: boolean, generator?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeArrowFunctionExpression; declare function classBody(body: Array): BabelNodeClassBody; @@ -1524,7 +1525,7 @@ declare module "@babel/types" { declare function classExpression(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array, _implements?: Array, mixins?: any, superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassExpression; declare function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration; declare function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration; - declare function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers: Array, source?: BabelNodeStringLiteral): BabelNodeExportNamedDeclaration; + declare function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers: Array, source?: BabelNodeStringLiteral, exportKind?: "type" | "value"): BabelNodeExportNamedDeclaration; declare function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier): BabelNodeExportSpecifier; declare function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement, _await?: boolean): BabelNodeForOfStatement; declare function importDeclaration(specifiers: Array, source: BabelNodeStringLiteral, importKind?: "type" | "typeof" | "value"): BabelNodeImportDeclaration; @@ -1536,7 +1537,7 @@ declare module "@babel/types" { declare function objectPattern(properties: Array, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeObjectPattern; declare function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement; declare function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral, typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation): BabelNodeTaggedTemplateExpression; - declare function templateElement(value: any, tail?: boolean): BabelNodeTemplateElement; + declare function templateElement(value: { raw: string, cooked?: string }, tail?: boolean): BabelNodeTemplateElement; declare function templateLiteral(quasis: Array, expressions: Array): BabelNodeTemplateLiteral; declare function yieldExpression(argument?: BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression; declare function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation; @@ -1554,7 +1555,7 @@ declare module "@babel/types" { declare function declareOpaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType): BabelNodeDeclareOpaqueType; declare function declareVariable(id: BabelNodeIdentifier): BabelNodeDeclareVariable; declare function declareExportDeclaration(declaration?: BabelNodeFlow, specifiers?: Array, source?: BabelNodeStringLiteral, _default?: boolean): BabelNodeDeclareExportDeclaration; - declare function declareExportAllDeclaration(source: BabelNodeStringLiteral, exportKind?: ["type","value"]): BabelNodeDeclareExportAllDeclaration; + declare function declareExportAllDeclaration(source: BabelNodeStringLiteral, exportKind?: "type" | "value"): BabelNodeDeclareExportAllDeclaration; declare function declaredPredicate(value: BabelNodeFlow): BabelNodeDeclaredPredicate; declare function existsTypeAnnotation(): BabelNodeExistsTypeAnnotation; declare function functionTypeAnnotation(typeParameters?: BabelNodeTypeParameterDeclaration, params: Array, rest?: BabelNodeFunctionTypeParam, returnType: BabelNodeFlowType): BabelNodeFunctionTypeAnnotation; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js index e94b2fbbb04c85..24ffceb446e08f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js @@ -3656,7 +3656,7 @@ function isScopable(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { + if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3671,7 +3671,7 @@ function isBlockParent(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { + if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3686,7 +3686,7 @@ function isBlock(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { + if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js index 1fe1c1c9b80d57..092da9913d9e71 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js @@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = validate; +exports.validateField = validateField; var _definitions = require("../definitions"); @@ -12,6 +13,10 @@ function validate(node, key, val) { const fields = _definitions.NODE_FIELDS[node.type]; if (!fields) return; const field = fields[key]; + validateField(node, key, val, field); +} + +function validateField(node, key, val, field) { if (!field || !field.validate) return; if (field.optional && val == null) return; field.validate(node, key, val); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json index 72e411f75f6223..e13eb11bd5a9ed 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json @@ -6,16 +6,16 @@ "bundleDependencies": false, "dependencies": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" }, "deprecated": false, "description": "Babel Types is a Lodash-esque utility library for AST nodes", "devDependencies": { - "@babel/generator": "^7.4.4", - "@babel/parser": "^7.4.4" + "@babel/generator": "^7.5.5", + "@babel/parser": "^7.5.5" }, - "gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba", + "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", @@ -25,5 +25,5 @@ "url": "https://github.com/babel/babel/tree/master/packages/babel-types" }, "types": "lib/index.d.ts", - "version": "7.4.4" + "version": "7.5.5" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js index ff33e8e25ade29..2ea1e80357dd41 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js @@ -31,6 +31,29 @@ module.exports = function stringifyValidator(validator, nodePrefix) { return validator.type; } + if (validator.shapeOf) { + return ( + "{ " + + Object.keys(validator.shapeOf) + .map(shapeKey => { + const propertyDefinition = validator.shapeOf[shapeKey]; + if (propertyDefinition.validate) { + const isOptional = + propertyDefinition.optional || propertyDefinition.default != null; + return ( + shapeKey + + (isOptional ? "?: " : ": ") + + stringifyValidator(propertyDefinition.validate) + ); + } + return null; + }) + .filter(Boolean) + .join(", ") + + " }" + ); + } + return ["any"]; }; diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/LICENSE b/tools/node_modules/babel-eslint/node_modules/eslint-scope/LICENSE deleted file mode 100644 index 4419797c9c8524..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -eslint-scope -Copyright JS Foundation and other contributors, https://js.foundation -Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. - -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. - -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 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. diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/README.md b/tools/node_modules/babel-eslint/node_modules/eslint-scope/README.md deleted file mode 100644 index 7e7ce0d345cdf2..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# ESLint Scope - -ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). - -## Usage - -Install: - -``` -npm i eslint-scope --save -``` - -Example: - -```js -var eslintScope = require('eslint-scope'); -var espree = require('espree'); -var estraverse = require('estraverse'); - -var ast = espree.parse(code); -var scopeManager = eslintScope.analyze(ast); - -var currentScope = scopeManager.acquire(ast); // global scope - -estraverse.traverse(ast, { - enter: function(node, parent) { - // do stuff - - if (/Function/.test(node.type)) { - currentScope = scopeManager.acquire(node); // get current function scope - } - }, - leave: function(node, parent) { - if (/Function/.test(node.type)) { - currentScope = currentScope.upper; // set to parent scope - } - - // do stuff - } -}); -``` - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). - -## Build Commands - -* `npm test` - run all linting and tests -* `npm run lint` - run all linting - -## License - -ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/definition.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/definition.js deleted file mode 100644 index 172bfe23b5fdcf..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/definition.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -const Variable = require("./variable"); - -/** - * @class Definition - */ -class Definition { - constructor(type, name, node, parent, index, kind) { - - /** - * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). - */ - this.type = type; - - /** - * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. - */ - this.name = name; - - /** - * @member {espree.Node} Definition#node - the enclosing node of the identifier. - */ - this.node = node; - - /** - * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. - */ - this.parent = parent; - - /** - * @member {Number?} Definition#index - the index in the declaration statement. - */ - this.index = index; - - /** - * @member {String?} Definition#kind - the kind of the declaration statement. - */ - this.kind = kind; - } -} - -/** - * @class ParameterDefinition - */ -class ParameterDefinition extends Definition { - constructor(name, node, index, rest) { - super(Variable.Parameter, name, node, null, index, null); - - /** - * Whether the parameter definition is a part of a rest parameter. - * @member {boolean} ParameterDefinition#rest - */ - this.rest = rest; - } -} - -module.exports = { - ParameterDefinition, - Definition -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/index.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/index.js deleted file mode 100644 index f48252fc5f4b22..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/index.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2013 Alex Seville - Copyright (C) 2014 Thiago de Arruda - - 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. - - 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 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. -*/ - -/** - * Escope (escope) is an ECMAScript - * scope analyzer extracted from the esmangle project. - *

- * escope finds lexical scopes in a source program, i.e. areas of that - * program where different occurrences of the same identifier refer to the same - * variable. With each scope the contained variables are collected, and each - * identifier reference in code is linked to its corresponding variable (if - * possible). - *

- * escope works on a syntax tree of the parsed source code which has - * to adhere to the - * Mozilla Parser API. E.g. espree is a parser - * that produces such syntax trees. - *

- * The main interface is the {@link analyze} function. - * @module escope - */ -"use strict"; - -/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ - -const assert = require("assert"); - -const ScopeManager = require("./scope-manager"); -const Referencer = require("./referencer"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const Scope = require("./scope").Scope; -const version = require("../package.json").version; - -/** - * Set the default options - * @returns {Object} options - */ -function defaultOptions() { - return { - optimistic: false, - directive: false, - nodejsScope: false, - impliedStrict: false, - sourceType: "script", // one of ['script', 'module'] - ecmaVersion: 5, - childVisitorKeys: null, - fallback: "iteration" - }; -} - -/** - * Preform deep update on option object - * @param {Object} target - Options - * @param {Object} override - Updates - * @returns {Object} Updated options - */ -function updateDeeply(target, override) { - - /** - * Is hash object - * @param {Object} value - Test value - * @returns {boolean} Result - */ - function isHashObject(value) { - return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); - } - - for (const key in override) { - if (override.hasOwnProperty(key)) { - const val = override[key]; - - if (isHashObject(val)) { - if (isHashObject(target[key])) { - updateDeeply(target[key], val); - } else { - target[key] = updateDeeply({}, val); - } - } else { - target[key] = val; - } - } - } - return target; -} - -/** - * Main interface function. Takes an Espree syntax tree and returns the - * analyzed scopes. - * @function analyze - * @param {espree.Tree} tree - Abstract Syntax Tree - * @param {Object} providedOptions - Options that tailor the scope analysis - * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag - * @param {boolean} [providedOptions.directive=false]- the directive flag - * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls - * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole - * script is executed under node.js environment. When enabled, escope adds - * a function scope immediately following the global scope. - * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode - * (if ecmaVersion >= 5). - * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' - * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered - * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. - * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. - * @returns {ScopeManager} ScopeManager - */ -function analyze(tree, providedOptions) { - const options = updateDeeply(defaultOptions(), providedOptions); - const scopeManager = new ScopeManager(options); - const referencer = new Referencer(options, scopeManager); - - referencer.visit(tree); - - assert(scopeManager.__currentScope === null, "currentScope should be null."); - - return scopeManager; -} - -module.exports = { - - /** @name module:escope.version */ - version, - - /** @name module:escope.Reference */ - Reference, - - /** @name module:escope.Variable */ - Variable, - - /** @name module:escope.Scope */ - Scope, - - /** @name module:escope.ScopeManager */ - ScopeManager, - analyze -}; - - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/pattern-visitor.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/pattern-visitor.js deleted file mode 100644 index afa629173b73ae..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/pattern-visitor.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); - -/** - * Get last array element - * @param {array} xs - array - * @returns {any} Last elment - */ -function getLast(xs) { - return xs[xs.length - 1] || null; -} - -class PatternVisitor extends esrecurse.Visitor { - static isPattern(node) { - const nodeType = node.type; - - return ( - nodeType === Syntax.Identifier || - nodeType === Syntax.ObjectPattern || - nodeType === Syntax.ArrayPattern || - nodeType === Syntax.SpreadElement || - nodeType === Syntax.RestElement || - nodeType === Syntax.AssignmentPattern - ); - } - - constructor(options, rootPattern, callback) { - super(null, options); - this.rootPattern = rootPattern; - this.callback = callback; - this.assignments = []; - this.rightHandNodes = []; - this.restElements = []; - } - - Identifier(pattern) { - const lastRestElement = getLast(this.restElements); - - this.callback(pattern, { - topLevel: pattern === this.rootPattern, - rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, - assignments: this.assignments - }); - } - - Property(property) { - - // Computed property's key is a right hand node. - if (property.computed) { - this.rightHandNodes.push(property.key); - } - - // If it's shorthand, its key is same as its value. - // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). - // If it's not shorthand, the name of new variable is its value's. - this.visit(property.value); - } - - ArrayPattern(pattern) { - for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { - const element = pattern.elements[i]; - - this.visit(element); - } - } - - AssignmentPattern(pattern) { - this.assignments.push(pattern); - this.visit(pattern.left); - this.rightHandNodes.push(pattern.right); - this.assignments.pop(); - } - - RestElement(pattern) { - this.restElements.push(pattern); - this.visit(pattern.argument); - this.restElements.pop(); - } - - MemberExpression(node) { - - // Computed property's key is a right hand node. - if (node.computed) { - this.rightHandNodes.push(node.property); - } - - // the object is only read, write to its property. - this.rightHandNodes.push(node.object); - } - - // - // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. - // By spec, LeftHandSideExpression is Pattern or MemberExpression. - // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) - // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... - // - - SpreadElement(node) { - this.visit(node.argument); - } - - ArrayExpression(node) { - node.elements.forEach(this.visit, this); - } - - AssignmentExpression(node) { - this.assignments.push(node); - this.visit(node.left); - this.rightHandNodes.push(node.right); - this.assignments.pop(); - } - - CallExpression(node) { - - // arguments are right hand nodes. - node.arguments.forEach(a => { - this.rightHandNodes.push(a); - }); - this.visit(node.callee); - } -} - -module.exports = PatternVisitor; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/reference.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/reference.js deleted file mode 100644 index 9529827fe786c6..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/reference.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -const READ = 0x1; -const WRITE = 0x2; -const RW = READ | WRITE; - -/** - * A Reference represents a single occurrence of an identifier in code. - * @class Reference - */ -class Reference { - constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { - - /** - * Identifier syntax node. - * @member {espreeIdentifier} Reference#identifier - */ - this.identifier = ident; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Reference#from - */ - this.from = scope; - - /** - * Whether the reference comes from a dynamic scope (such as 'eval', - * 'with', etc.), and may be trapped by dynamic scopes. - * @member {boolean} Reference#tainted - */ - this.tainted = false; - - /** - * The variable this reference is resolved with. - * @member {Variable} Reference#resolved - */ - this.resolved = null; - - /** - * The read-write mode of the reference. (Value is one of {@link - * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). - * @member {number} Reference#flag - * @private - */ - this.flag = flag; - if (this.isWrite()) { - - /** - * If reference is writeable, this is the tree being written to it. - * @member {espreeNode} Reference#writeExpr - */ - this.writeExpr = writeExpr; - - /** - * Whether the Reference might refer to a partial value of writeExpr. - * @member {boolean} Reference#partial - */ - this.partial = partial; - - /** - * Whether the Reference is to write of initialization. - * @member {boolean} Reference#init - */ - this.init = init; - } - this.__maybeImplicitGlobal = maybeImplicitGlobal; - } - - /** - * Whether the reference is static. - * @method Reference#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.tainted && this.resolved && this.resolved.scope.isStatic(); - } - - /** - * Whether the reference is writeable. - * @method Reference#isWrite - * @returns {boolean} write - */ - isWrite() { - return !!(this.flag & Reference.WRITE); - } - - /** - * Whether the reference is readable. - * @method Reference#isRead - * @returns {boolean} read - */ - isRead() { - return !!(this.flag & Reference.READ); - } - - /** - * Whether the reference is read-only. - * @method Reference#isReadOnly - * @returns {boolean} read only - */ - isReadOnly() { - return this.flag === Reference.READ; - } - - /** - * Whether the reference is write-only. - * @method Reference#isWriteOnly - * @returns {boolean} write only - */ - isWriteOnly() { - return this.flag === Reference.WRITE; - } - - /** - * Whether the reference is read-write. - * @method Reference#isReadWrite - * @returns {boolean} read write - */ - isReadWrite() { - return this.flag === Reference.RW; - } -} - -/** - * @constant Reference.READ - * @private - */ -Reference.READ = READ; - -/** - * @constant Reference.WRITE - * @private - */ -Reference.WRITE = WRITE; - -/** - * @constant Reference.RW - * @private - */ -Reference.RW = RW; - -module.exports = Reference; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/referencer.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/referencer.js deleted file mode 100644 index b7cdbb6003ecc9..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/referencer.js +++ /dev/null @@ -1,638 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; -const esrecurse = require("esrecurse"); -const Reference = require("./reference"); -const Variable = require("./variable"); -const PatternVisitor = require("./pattern-visitor"); -const definition = require("./definition"); -const assert = require("assert"); - -const ParameterDefinition = definition.ParameterDefinition; -const Definition = definition.Definition; - -/** - * Traverse identifier in pattern - * @param {Object} options - options - * @param {pattern} rootPattern - root pattern - * @param {Refencer} referencer - referencer - * @param {callback} callback - callback - * @returns {void} - */ -function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { - - // Call the callback at left hand identifier nodes, and Collect right hand nodes. - const visitor = new PatternVisitor(options, rootPattern, callback); - - visitor.visit(rootPattern); - - // Process the right hand nodes recursively. - if (referencer !== null && referencer !== undefined) { - visitor.rightHandNodes.forEach(referencer.visit, referencer); - } -} - -// Importing ImportDeclaration. -// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation -// https://github.com/estree/estree/blob/master/es6.md#importdeclaration -// FIXME: Now, we don't create module environment, because the context is -// implementation dependent. - -class Importer extends esrecurse.Visitor { - constructor(declaration, referencer) { - super(null, referencer.options); - this.declaration = declaration; - this.referencer = referencer; - } - - visitImport(id, specifier) { - this.referencer.visitPattern(id, pattern => { - this.referencer.currentScope().__define(pattern, - new Definition( - Variable.ImportBinding, - pattern, - specifier, - this.declaration, - null, - null - )); - }); - } - - ImportNamespaceSpecifier(node) { - const local = (node.local || node.id); - - if (local) { - this.visitImport(local, node); - } - } - - ImportDefaultSpecifier(node) { - const local = (node.local || node.id); - - this.visitImport(local, node); - } - - ImportSpecifier(node) { - const local = (node.local || node.id); - - if (node.name) { - this.visitImport(node.name, node); - } else { - this.visitImport(local, node); - } - } -} - -// Referencing variables and creating bindings. -class Referencer extends esrecurse.Visitor { - constructor(options, scopeManager) { - super(null, options); - this.options = options; - this.scopeManager = scopeManager; - this.parent = null; - this.isInnerMethodDefinition = false; - } - - currentScope() { - return this.scopeManager.__currentScope; - } - - close(node) { - while (this.currentScope() && node === this.currentScope().block) { - this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); - } - } - - pushInnerMethodDefinition(isInnerMethodDefinition) { - const previous = this.isInnerMethodDefinition; - - this.isInnerMethodDefinition = isInnerMethodDefinition; - return previous; - } - - popInnerMethodDefinition(isInnerMethodDefinition) { - this.isInnerMethodDefinition = isInnerMethodDefinition; - } - - materializeTDZScope(node, iterationNode) { - - // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation - // TDZ scope hides the declaration's names. - this.scopeManager.__nestTDZScope(node, iterationNode); - this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0, true); - } - - materializeIterationScope(node) { - - // Generate iteration scope for upper ForIn/ForOf Statements. - const letOrConstDecl = node.left; - - this.scopeManager.__nestForScope(node); - this.visitVariableDeclaration(this.currentScope(), Variable.Variable, letOrConstDecl, 0); - this.visitPattern(letOrConstDecl.declarations[0].id, pattern => { - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); - }); - } - - referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { - const scope = this.currentScope(); - - assignments.forEach(assignment => { - scope.__referencing( - pattern, - Reference.WRITE, - assignment.right, - maybeImplicitGlobal, - pattern !== assignment.left, - init); - }); - } - - visitPattern(node, options, callback) { - if (typeof options === "function") { - callback = options; - options = { processRightHandNodes: false }; - } - traverseIdentifierInPattern( - this.options, - node, - options.processRightHandNodes ? this : null, - callback); - } - - visitFunction(node) { - let i, iz; - - // FunctionDeclaration name is defined in upper scope - // NOTE: Not referring variableScope. It is intended. - // Since - // in ES5, FunctionDeclaration should be in FunctionBody. - // in ES6, FunctionDeclaration should be block scoped. - - if (node.type === Syntax.FunctionDeclaration) { - - // id is defined in upper scope - this.currentScope().__define(node.id, - new Definition( - Variable.FunctionName, - node.id, - node, - null, - null, - null - )); - } - - // FunctionExpression with name creates its special scope; - // FunctionExpressionNameScope. - if (node.type === Syntax.FunctionExpression && node.id) { - this.scopeManager.__nestFunctionExpressionNameScope(node); - } - - // Consider this function is in the MethodDefinition. - this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); - - const that = this; - - /** - * Visit pattern callback - * @param {pattern} pattern - pattern - * @param {Object} info - info - * @returns {void} - */ - function visitPatternCallback(pattern, info) { - that.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - i, - info.rest - )); - - that.referencingDefaultValue(pattern, info.assignments, null, true); - } - - // Process parameter declarations. - for (i = 0, iz = node.params.length; i < iz; ++i) { - this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); - } - - // if there's a rest argument, add that - if (node.rest) { - this.visitPattern({ - type: "RestElement", - argument: node.rest - }, pattern => { - this.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - node.params.length, - true - )); - }); - } - - // In TypeScript there are a number of function-like constructs which have no body, - // so check it exists before traversing - if (node.body) { - - // Skip BlockStatement to prevent creating BlockStatement scope. - if (node.body.type === Syntax.BlockStatement) { - this.visitChildren(node.body); - } else { - this.visit(node.body); - } - } - - this.close(node); - } - - visitClass(node) { - if (node.type === Syntax.ClassDeclaration) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node, - null, - null, - null - )); - } - - // FIXME: Maybe consider TDZ. - this.visit(node.superClass); - - this.scopeManager.__nestClassScope(node); - - if (node.id) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node - )); - } - this.visit(node.body); - - this.close(node); - } - - visitProperty(node) { - let previous; - - if (node.computed) { - this.visit(node.key); - } - - const isMethodDefinition = node.type === Syntax.MethodDefinition; - - if (isMethodDefinition) { - previous = this.pushInnerMethodDefinition(true); - } - this.visit(node.value); - if (isMethodDefinition) { - this.popInnerMethodDefinition(previous); - } - } - - visitForIn(node) { - if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { - this.materializeTDZScope(node.right, node); - this.visit(node.right); - this.close(node.right); - - this.materializeIterationScope(node); - this.visit(node.body); - this.close(node); - } else { - if (node.left.type === Syntax.VariableDeclaration) { - this.visit(node.left); - this.visitPattern(node.left.declarations[0].id, pattern => { - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); - }); - } else { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); - }); - } - this.visit(node.right); - this.visit(node.body); - } - } - - visitVariableDeclaration(variableTargetScope, type, node, index, fromTDZ) { - - // If this was called to initialize a TDZ scope, this needs to make definitions, but doesn't make references. - const decl = node.declarations[index]; - const init = decl.init; - - this.visitPattern(decl.id, { processRightHandNodes: !fromTDZ }, (pattern, info) => { - variableTargetScope.__define(pattern, - new Definition( - type, - pattern, - decl, - node, - index, - node.kind - )); - - if (!fromTDZ) { - this.referencingDefaultValue(pattern, info.assignments, null, true); - } - if (init) { - this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); - } - }); - } - - AssignmentExpression(node) { - if (PatternVisitor.isPattern(node.left)) { - if (node.operator === "=") { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); - }); - } else { - this.currentScope().__referencing(node.left, Reference.RW, node.right); - } - } else { - this.visit(node.left); - } - this.visit(node.right); - } - - CatchClause(node) { - this.scopeManager.__nestCatchScope(node); - - this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { - this.currentScope().__define(pattern, - new Definition( - Variable.CatchClause, - node.param, - node, - null, - null, - null - )); - this.referencingDefaultValue(pattern, info.assignments, null, true); - }); - this.visit(node.body); - - this.close(node); - } - - Program(node) { - this.scopeManager.__nestGlobalScope(node); - - if (this.scopeManager.__isNodejsScope()) { - - // Force strictness of GlobalScope to false when using node.js scope. - this.currentScope().isStrict = false; - this.scopeManager.__nestFunctionScope(node, false); - } - - if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { - this.scopeManager.__nestModuleScope(node); - } - - if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { - this.currentScope().isStrict = true; - } - - this.visitChildren(node); - this.close(node); - } - - Identifier(node) { - this.currentScope().__referencing(node); - } - - UpdateExpression(node) { - if (PatternVisitor.isPattern(node.argument)) { - this.currentScope().__referencing(node.argument, Reference.RW, null); - } else { - this.visitChildren(node); - } - } - - MemberExpression(node) { - this.visit(node.object); - if (node.computed) { - this.visit(node.property); - } - } - - Property(node) { - this.visitProperty(node); - } - - MethodDefinition(node) { - this.visitProperty(node); - } - - BreakStatement() {} // eslint-disable-line class-methods-use-this - - ContinueStatement() {} // eslint-disable-line class-methods-use-this - - LabeledStatement(node) { - this.visit(node.body); - } - - ForStatement(node) { - - // Create ForStatement declaration. - // NOTE: In ES6, ForStatement dynamically generates - // per iteration environment. However, escope is - // a static analyzer, we only generate one scope for ForStatement. - if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { - this.scopeManager.__nestForScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ClassExpression(node) { - this.visitClass(node); - } - - ClassDeclaration(node) { - this.visitClass(node); - } - - CallExpression(node) { - - // Check this is direct call to eval - if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { - - // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and - // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. - this.currentScope().variableScope.__detectEval(); - } - this.visitChildren(node); - } - - BlockStatement(node) { - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestBlockScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ThisExpression() { - this.currentScope().variableScope.__detectThis(); - } - - WithStatement(node) { - this.visit(node.object); - - // Then nest scope for WithStatement. - this.scopeManager.__nestWithScope(node); - - this.visit(node.body); - - this.close(node); - } - - VariableDeclaration(node) { - const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); - - for (let i = 0, iz = node.declarations.length; i < iz; ++i) { - const decl = node.declarations[i]; - - this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); - if (decl.init) { - this.visit(decl.init); - } - } - } - - // sec 13.11.8 - SwitchStatement(node) { - this.visit(node.discriminant); - - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestSwitchScope(node); - } - - for (let i = 0, iz = node.cases.length; i < iz; ++i) { - this.visit(node.cases[i]); - } - - this.close(node); - } - - FunctionDeclaration(node) { - this.visitFunction(node); - } - - FunctionExpression(node) { - this.visitFunction(node); - } - - ForOfStatement(node) { - this.visitForIn(node); - } - - ForInStatement(node) { - this.visitForIn(node); - } - - ArrowFunctionExpression(node) { - this.visitFunction(node); - } - - ImportDeclaration(node) { - assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); - - const importer = new Importer(node, this); - - importer.visit(node); - } - - visitExportDeclaration(node) { - if (node.source) { - return; - } - if (node.declaration) { - this.visit(node.declaration); - return; - } - - this.visitChildren(node); - } - - ExportDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportNamedDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportSpecifier(node) { - const local = (node.id || node.local); - - this.visit(local); - } - - MetaProperty() { // eslint-disable-line class-methods-use-this - - // do nothing. - } -} - -module.exports = Referencer; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope-manager.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope-manager.js deleted file mode 100644 index 0cc75a03bad6af..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope-manager.js +++ /dev/null @@ -1,255 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ - -const Scope = require("./scope"); -const assert = require("assert"); - -const GlobalScope = Scope.GlobalScope; -const CatchScope = Scope.CatchScope; -const WithScope = Scope.WithScope; -const ModuleScope = Scope.ModuleScope; -const ClassScope = Scope.ClassScope; -const SwitchScope = Scope.SwitchScope; -const FunctionScope = Scope.FunctionScope; -const ForScope = Scope.ForScope; -const TDZScope = Scope.TDZScope; -const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; -const BlockScope = Scope.BlockScope; - -/** - * @class ScopeManager - */ -class ScopeManager { - constructor(options) { - this.scopes = []; - this.globalScope = null; - this.__nodeToScope = new WeakMap(); - this.__currentScope = null; - this.__options = options; - this.__declaredVariables = new WeakMap(); - } - - __useDirective() { - return this.__options.directive; - } - - __isOptimistic() { - return this.__options.optimistic; - } - - __ignoreEval() { - return this.__options.ignoreEval; - } - - __isNodejsScope() { - return this.__options.nodejsScope; - } - - isModule() { - return this.__options.sourceType === "module"; - } - - isImpliedStrict() { - return this.__options.impliedStrict; - } - - isStrictModeSupported() { - return this.__options.ecmaVersion >= 5; - } - - // Returns appropriate scope for this node. - __get(node) { - return this.__nodeToScope.get(node); - } - - /** - * Get variables that are declared by the node. - * - * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. - * If the node declares nothing, this method returns an empty array. - * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. - * - * @param {Espree.Node} node - a node to get. - * @returns {Variable[]} variables that declared by the node. - */ - getDeclaredVariables(node) { - return this.__declaredVariables.get(node) || []; - } - - /** - * acquire scope from node. - * @method ScopeManager#acquire - * @param {Espree.Node} node - node for the acquired scope. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} Scope from node - */ - acquire(node, inner) { - - /** - * predicate - * @param {Scope} testScope - scope to test - * @returns {boolean} predicate - */ - function predicate(testScope) { - if (testScope.type === "function" && testScope.functionExpressionScope) { - return false; - } - if (testScope.type === "TDZ") { - return false; - } - return true; - } - - const scopes = this.__get(node); - - if (!scopes || scopes.length === 0) { - return null; - } - - // Heuristic selection from all scopes. - // If you would like to get all scopes, please use ScopeManager#acquireAll. - if (scopes.length === 1) { - return scopes[0]; - } - - if (inner) { - for (let i = scopes.length - 1; i >= 0; --i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } else { - for (let i = 0, iz = scopes.length; i < iz; ++i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } - - return null; - } - - /** - * acquire all scopes from node. - * @method ScopeManager#acquireAll - * @param {Espree.Node} node - node for the acquired scope. - * @returns {Scopes?} Scope array - */ - acquireAll(node) { - return this.__get(node); - } - - /** - * release the node. - * @method ScopeManager#release - * @param {Espree.Node} node - releasing node. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} upper scope for the node. - */ - release(node, inner) { - const scopes = this.__get(node); - - if (scopes && scopes.length) { - const scope = scopes[0].upper; - - if (!scope) { - return null; - } - return this.acquire(scope.block, inner); - } - return null; - } - - attach() { } // eslint-disable-line class-methods-use-this - - detach() { } // eslint-disable-line class-methods-use-this - - __nestScope(scope) { - if (scope instanceof GlobalScope) { - assert(this.__currentScope === null); - this.globalScope = scope; - } - this.__currentScope = scope; - return scope; - } - - __nestGlobalScope(node) { - return this.__nestScope(new GlobalScope(this, node)); - } - - __nestBlockScope(node) { - return this.__nestScope(new BlockScope(this, this.__currentScope, node)); - } - - __nestFunctionScope(node, isMethodDefinition) { - return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); - } - - __nestForScope(node) { - return this.__nestScope(new ForScope(this, this.__currentScope, node)); - } - - __nestCatchScope(node) { - return this.__nestScope(new CatchScope(this, this.__currentScope, node)); - } - - __nestWithScope(node) { - return this.__nestScope(new WithScope(this, this.__currentScope, node)); - } - - __nestClassScope(node) { - return this.__nestScope(new ClassScope(this, this.__currentScope, node)); - } - - __nestSwitchScope(node) { - return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); - } - - __nestModuleScope(node) { - return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); - } - - __nestTDZScope(node) { - return this.__nestScope(new TDZScope(this, this.__currentScope, node)); - } - - __nestFunctionExpressionNameScope(node) { - return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); - } - - __isES6() { - return this.__options.ecmaVersion >= 6; - } -} - -module.exports = ScopeManager; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope.js deleted file mode 100644 index 3307a36adec7af..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/scope.js +++ /dev/null @@ -1,722 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = require("estraverse").Syntax; - -const Reference = require("./reference"); -const Variable = require("./variable"); -const Definition = require("./definition").Definition; -const assert = require("assert"); - -/** - * Test if scope is struct - * @param {Scope} scope - scope - * @param {Block} block - block - * @param {boolean} isMethodDefinition - is method definiton - * @param {boolean} useDirective - use directive - * @returns {boolean} is strict scope - */ -function isStrictScope(scope, block, isMethodDefinition, useDirective) { - let body; - - // When upper scope is exists and strict, inner scope is also strict. - if (scope.upper && scope.upper.isStrict) { - return true; - } - - // ArrowFunctionExpression's scope is always strict scope. - if (block.type === Syntax.ArrowFunctionExpression) { - return true; - } - - if (isMethodDefinition) { - return true; - } - - if (scope.type === "class" || scope.type === "module") { - return true; - } - - if (scope.type === "block" || scope.type === "switch") { - return false; - } - - if (scope.type === "function") { - if (block.type === Syntax.Program) { - body = block; - } else { - body = block.body; - } - - if (!body) { - return false; - } - } else if (scope.type === "global") { - body = block; - } else { - return false; - } - - // Search 'use strict' directive. - if (useDirective) { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.DirectiveStatement) { - break; - } - if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { - return true; - } - } - } else { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.ExpressionStatement) { - break; - } - const expr = stmt.expression; - - if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { - break; - } - if (expr.raw !== null && expr.raw !== undefined) { - if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { - return true; - } - } else { - if (expr.value === "use strict") { - return true; - } - } - } - } - return false; -} - -/** - * Register scope - * @param {ScopeManager} scopeManager - scope manager - * @param {Scope} scope - scope - * @returns {void} - */ -function registerScope(scopeManager, scope) { - scopeManager.scopes.push(scope); - - const scopes = scopeManager.__nodeToScope.get(scope.block); - - if (scopes) { - scopes.push(scope); - } else { - scopeManager.__nodeToScope.set(scope.block, [scope]); - } -} - -/** - * Should be statically - * @param {Object} def - def - * @returns {boolean} should be statically - */ -function shouldBeStatically(def) { - return ( - (def.type === Variable.ClassName) || - (def.type === Variable.Variable && def.parent.kind !== "var") - ); -} - -/** - * @class Scope - */ -class Scope { - constructor(scopeManager, type, upperScope, block, isMethodDefinition) { - - /** - * One of 'TDZ', 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. - * @member {String} Scope#type - */ - this.type = type; - - /** - * The scoped {@link Variable}s of this scope, as { Variable.name - * : Variable }. - * @member {Map} Scope#set - */ - this.set = new Map(); - - /** - * The tainted variables of this scope, as { Variable.name : - * boolean }. - * @member {Map} Scope#taints */ - this.taints = new Map(); - - /** - * Generally, through the lexical scoping of JS you can always know - * which variable an identifier in the source code refers to. There are - * a few exceptions to this rule. With 'global' and 'with' scopes you - * can only decide at runtime which variable a reference refers to. - * Moreover, if 'eval()' is used in a scope, it might introduce new - * bindings in this or its parent scopes. - * All those scopes are considered 'dynamic'. - * @member {boolean} Scope#dynamic - */ - this.dynamic = this.type === "global" || this.type === "with"; - - /** - * A reference to the scope-defining syntax node. - * @member {espree.Node} Scope#block - */ - this.block = block; - - /** - * The {@link Reference|references} that are not resolved with this scope. - * @member {Reference[]} Scope#through - */ - this.through = []; - - /** - * The scoped {@link Variable}s of this scope. In the case of a - * 'function' scope this includes the automatic argument arguments as - * its first element, as well as all further formal arguments. - * @member {Variable[]} Scope#variables - */ - this.variables = []; - - /** - * Any variable {@link Reference|reference} found in this scope. This - * includes occurrences of local variables as well as variables from - * parent scopes (including the global scope). For local variables - * this also includes defining occurrences (like in a 'var' statement). - * In a 'function' scope this does not include the occurrences of the - * formal parameter in the parameter list. - * @member {Reference[]} Scope#references - */ - this.references = []; - - /** - * For 'global' and 'function' scopes, this is a self-reference. For - * other scope types this is the variableScope value of the - * parent scope. - * @member {Scope} Scope#variableScope - */ - this.variableScope = - (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; - - /** - * Whether this scope is created by a FunctionExpression. - * @member {boolean} Scope#functionExpressionScope - */ - this.functionExpressionScope = false; - - /** - * Whether this is a scope that contains an 'eval()' invocation. - * @member {boolean} Scope#directCallToEvalScope - */ - this.directCallToEvalScope = false; - - /** - * @member {boolean} Scope#thisFound - */ - this.thisFound = false; - - this.__left = []; - - /** - * Reference to the parent {@link Scope|scope}. - * @member {Scope} Scope#upper - */ - this.upper = upperScope; - - /** - * Whether 'use strict' is in effect in this scope. - * @member {boolean} Scope#isStrict - */ - this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); - - /** - * List of nested {@link Scope}s. - * @member {Scope[]} Scope#childScopes - */ - this.childScopes = []; - if (this.upper) { - this.upper.childScopes.push(this); - } - - this.__declaredVariables = scopeManager.__declaredVariables; - - registerScope(scopeManager, this); - } - - __shouldStaticallyClose(scopeManager) { - return (!this.dynamic || scopeManager.__isOptimistic()); - } - - __shouldStaticallyCloseForGlobal(ref) { - - // On global scope, let/const/class declarations should be resolved statically. - const name = ref.identifier.name; - - if (!this.set.has(name)) { - return false; - } - - const variable = this.set.get(name); - const defs = variable.defs; - - return defs.length > 0 && defs.every(shouldBeStatically); - } - - __staticCloseRef(ref) { - if (!this.__resolve(ref)) { - this.__delegateToUpperScope(ref); - } - } - - __dynamicCloseRef(ref) { - - // notify all names are through to global - let current = this; - - do { - current.through.push(ref); - current = current.upper; - } while (current); - } - - __globalCloseRef(ref) { - - // let/const/class declarations should be resolved statically. - // others should be resolved dynamically. - if (this.__shouldStaticallyCloseForGlobal(ref)) { - this.__staticCloseRef(ref); - } else { - this.__dynamicCloseRef(ref); - } - } - - __close(scopeManager) { - let closeRef; - - if (this.__shouldStaticallyClose(scopeManager)) { - closeRef = this.__staticCloseRef; - } else if (this.type !== "global") { - closeRef = this.__dynamicCloseRef; - } else { - closeRef = this.__globalCloseRef; - } - - // Try Resolving all references in this scope. - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - closeRef.call(this, ref); - } - this.__left = null; - - return this.upper; - } - - __resolve(ref) { - const name = ref.identifier.name; - - if (this.set.has(name)) { - const variable = this.set.get(name); - - variable.references.push(ref); - variable.stack = variable.stack && ref.from.variableScope === this.variableScope; - if (ref.tainted) { - variable.tainted = true; - this.taints.set(variable.name, true); - } - ref.resolved = variable; - return true; - } - return false; - } - - __delegateToUpperScope(ref) { - if (this.upper) { - this.upper.__left.push(ref); - } - this.through.push(ref); - } - - __addDeclaredVariablesOfNode(variable, node) { - if (node === null || node === undefined) { - return; - } - - let variables = this.__declaredVariables.get(node); - - if (variables === null || variables === undefined) { - variables = []; - this.__declaredVariables.set(node, variables); - } - if (variables.indexOf(variable) === -1) { - variables.push(variable); - } - } - - __defineGeneric(name, set, variables, node, def) { - let variable; - - variable = set.get(name); - if (!variable) { - variable = new Variable(name, this); - set.set(name, variable); - variables.push(variable); - } - - if (def) { - variable.defs.push(def); - if (def.type !== Variable.TDZ) { - this.__addDeclaredVariablesOfNode(variable, def.node); - this.__addDeclaredVariablesOfNode(variable, def.parent); - } - } - if (node) { - variable.identifiers.push(node); - } - } - - __define(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.set, - this.variables, - node, - def); - } - } - - __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { - - // because Array element may be null - if (!node || node.type !== Syntax.Identifier) { - return; - } - - // Specially handle like `this`. - if (node.name === "super") { - return; - } - - const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); - - this.references.push(ref); - this.__left.push(ref); - } - - __detectEval() { - let current = this; - - this.directCallToEvalScope = true; - do { - current.dynamic = true; - current = current.upper; - } while (current); - } - - __detectThis() { - this.thisFound = true; - } - - __isClosed() { - return this.__left === null; - } - - /** - * returns resolved {Reference} - * @method Scope#resolve - * @param {Espree.Identifier} ident - identifier to be resolved. - * @returns {Reference} reference - */ - resolve(ident) { - let ref, i, iz; - - assert(this.__isClosed(), "Scope should be closed."); - assert(ident.type === Syntax.Identifier, "Target should be identifier."); - for (i = 0, iz = this.references.length; i < iz; ++i) { - ref = this.references[i]; - if (ref.identifier === ident) { - return ref; - } - } - return null; - } - - /** - * returns this scope is static - * @method Scope#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.dynamic; - } - - /** - * returns this scope has materialized arguments - * @method Scope#isArgumentsMaterialized - * @returns {boolean} arguemnts materialized - */ - isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - /** - * returns this scope has materialized `this` reference - * @method Scope#isThisMaterialized - * @returns {boolean} this materialized - */ - isThisMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - isUsedName(name) { - if (this.set.has(name)) { - return true; - } - for (let i = 0, iz = this.through.length; i < iz; ++i) { - if (this.through[i].identifier.name === name) { - return true; - } - } - return false; - } -} - -class GlobalScope extends Scope { - constructor(scopeManager, block) { - super(scopeManager, "global", null, block, false); - this.implicit = { - set: new Map(), - variables: [], - - /** - * List of {@link Reference}s that are left to be resolved (i.e. which - * need to be linked to the variable they refer to). - * @member {Reference[]} Scope#implicit#left - */ - left: [] - }; - } - - __close(scopeManager) { - const implicit = []; - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { - implicit.push(ref.__maybeImplicitGlobal); - } - } - - // create an implicit global variable from assignment expression - for (let i = 0, iz = implicit.length; i < iz; ++i) { - const info = implicit[i]; - - this.__defineImplicit(info.pattern, - new Definition( - Variable.ImplicitGlobalVariable, - info.pattern, - info.node, - null, - null, - null - )); - - } - - this.implicit.left = this.__left; - - return super.__close(scopeManager); - } - - __defineImplicit(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.implicit.set, - this.implicit.variables, - node, - def); - } - } -} - -class ModuleScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "module", upperScope, block, false); - } -} - -class FunctionExpressionNameScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "function-expression-name", upperScope, block, false); - this.__define(block.id, - new Definition( - Variable.FunctionName, - block.id, - block, - null, - null, - null - )); - this.functionExpressionScope = true; - } -} - -class CatchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "catch", upperScope, block, false); - } -} - -class WithScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "with", upperScope, block, false); - } - - __close(scopeManager) { - if (this.__shouldStaticallyClose(scopeManager)) { - return super.__close(scopeManager); - } - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - ref.tainted = true; - this.__delegateToUpperScope(ref); - } - this.__left = null; - - return this.upper; - } -} - -class TDZScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "TDZ", upperScope, block, false); - } -} - -class BlockScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "block", upperScope, block, false); - } -} - -class SwitchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "switch", upperScope, block, false); - } -} - -class FunctionScope extends Scope { - constructor(scopeManager, upperScope, block, isMethodDefinition) { - super(scopeManager, "function", upperScope, block, isMethodDefinition); - - // section 9.2.13, FunctionDeclarationInstantiation. - // NOTE Arrow functions never have an arguments objects. - if (this.block.type !== Syntax.ArrowFunctionExpression) { - this.__defineArguments(); - } - } - - isArgumentsMaterialized() { - - // TODO(Constellation) - // We can more aggressive on this condition like this. - // - // function t() { - // // arguments of t is always hidden. - // function arguments() { - // } - // } - if (this.block.type === Syntax.ArrowFunctionExpression) { - return false; - } - - if (!this.isStatic()) { - return true; - } - - const variable = this.set.get("arguments"); - - assert(variable, "Always have arguments variable."); - return variable.tainted || variable.references.length !== 0; - } - - isThisMaterialized() { - if (!this.isStatic()) { - return true; - } - return this.thisFound; - } - - __defineArguments() { - this.__defineGeneric( - "arguments", - this.set, - this.variables, - null, - null); - this.taints.set("arguments", true); - } -} - -class ForScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "for", upperScope, block, false); - } -} - -class ClassScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "class", upperScope, block, false); - } -} - -module.exports = { - Scope, - GlobalScope, - ModuleScope, - FunctionExpressionNameScope, - CatchScope, - WithScope, - TDZScope, - BlockScope, - SwitchScope, - FunctionScope, - ForScope, - ClassScope -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/variable.js b/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/variable.js deleted file mode 100644 index 63732099140f50..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/lib/variable.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (C) 2015 Yusuke Suzuki - - 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. - - 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 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. -*/ -"use strict"; - -/** - * A Variable represents a locally scoped identifier. These include arguments to - * functions. - * @class Variable - */ -class Variable { - constructor(name, scope) { - - /** - * The variable name, as given in the source code. - * @member {String} Variable#name - */ - this.name = name; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as AST nodes. - * @member {espree.Identifier[]} Variable#identifiers - */ - this.identifiers = []; - - /** - * List of {@link Reference|references} of this variable (excluding parameter entries) - * in its defining scope and all nested scopes. For defining - * occurrences only see {@link Variable#defs}. - * @member {Reference[]} Variable#references - */ - this.references = []; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as custom objects. - * @member {Definition[]} Variable#defs - */ - this.defs = []; - - this.tainted = false; - - /** - * Whether this is a stack variable. - * @member {boolean} Variable#stack - */ - this.stack = true; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Variable#scope - */ - this.scope = scope; - } -} - -Variable.CatchClause = "CatchClause"; -Variable.Parameter = "Parameter"; -Variable.FunctionName = "FunctionName"; -Variable.ClassName = "ClassName"; -Variable.Variable = "Variable"; -Variable.ImportBinding = "ImportBinding"; -Variable.TDZ = "TDZ"; -Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; - -module.exports = Variable; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-scope/package.json b/tools/node_modules/babel-eslint/node_modules/eslint-scope/package.json deleted file mode 100644 index 11062ef6e2e878..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/eslint-scope/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/eslint/eslint-scope/issues" - }, - "bundleDependencies": false, - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "deprecated": false, - "description": "ECMAScript scope analyzer for ESLint", - "devDependencies": { - "chai": "^3.4.1", - "eslint": "^3.15.0", - "eslint-config-eslint": "^4.0.0", - "eslint-release": "^0.10.1", - "espree": "^3.1.1", - "istanbul": "^0.4.5", - "mocha": "^3.2.0", - "npm-license": "^0.3.3", - "shelljs": "^0.7.6", - "typescript": "~2.0.10", - "typescript-eslint-parser": "^1.0.0" - }, - "engines": { - "node": ">=4.0.0" - }, - "files": [ - "LICENSE", - "README.md", - "lib" - ], - "homepage": "http://github.com/eslint/eslint-scope", - "license": "BSD-2-Clause", - "main": "lib/index.js", - "name": "eslint-scope", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-scope.git" - }, - "scripts": { - "alpharelease": "eslint-prerelease alpha", - "betarelease": "eslint-prerelease beta", - "ci-release": "eslint-ci-release", - "gh-release": "eslint-gh-release", - "lint": "node Makefile.js lint", - "release": "eslint-release", - "test": "node Makefile.js test" - }, - "version": "3.7.1" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json index 5e07415c430a70..d31b7b29439a13 100644 --- a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ b/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json @@ -128,6 +128,9 @@ "ImportDefaultSpecifier": [ "local" ], + "ImportExpression": [ + "source" + ], "ImportNamespaceSpecifier": [ "local" ], diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json index 13c7c6e90390b2..68eec940691e0b 100644 --- a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json @@ -13,7 +13,7 @@ "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", - "eslint-release": "^0.10.3", + "eslint-release": "^1.0.0", "mocha": "^3.5.3", "nyc": "^11.2.1", "opener": "^1.4.3" @@ -34,12 +34,15 @@ "url": "git+https://github.com/eslint/eslint-visitor-keys.git" }, "scripts": { - "ci-release": "eslint-ci-release", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", "lint": "eslint lib tests/lib", "pretest": "npm run -s lint", - "release": "eslint-release", + "publish-release": "eslint-publish-release", "test": "nyc mocha tests/lib" }, - "version": "1.0.0" + "version": "1.1.0" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/esrecurse/README.md b/tools/node_modules/babel-eslint/node_modules/esrecurse/README.md deleted file mode 100644 index ffea6b434a4a63..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esrecurse/README.md +++ /dev/null @@ -1,171 +0,0 @@ -### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) - -Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is -[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) -recursive traversing functionality. - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -esrecurse.visit(ast, { - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); -``` - -We can use `Visitor` instance. - -```javascript -var visitor = new esrecurse.Visitor({ - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); - -visitor.visit(ast); -``` - -We can inherit `Visitor` instance easily. - -```javascript -class Derived extends esrecurse.Visitor { - constructor() - { - super(null); - } - - XXXStatement(node) { - } -} -``` - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); -}; -``` - -And you can invoke default visiting operation inside custom visit operation. - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - // do something... - this.visitChildren(node); -}; -``` - -The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. -We can use user-defined node types. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - // Extending the existing traversing rules. - childVisitorKeys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } - } -); -``` - -We can use the `fallback` option as well. -If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: 'iteration' - } -); -``` - -If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. -Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). - -```javascript -esrecurse.visit( - ast, - { - Literal: function (node) { - // do something... - } - }, - { - fallback: function (node) { - return Object.keys(node).filter(function(key) { - return key !== 'argument' - }); - } - } -); -``` - -### License - -Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) - (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. - -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. - -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 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. diff --git a/tools/node_modules/babel-eslint/node_modules/esrecurse/esrecurse.js b/tools/node_modules/babel-eslint/node_modules/esrecurse/esrecurse.js deleted file mode 100644 index 15d57dfd0218f6..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esrecurse/esrecurse.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - 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. - - 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 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. -*/ -(function () { - 'use strict'; - - var estraverse = require('estraverse'); - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; - } - - function Visitor(visitor, options) { - options = options || {}; - - this.__visitor = visitor || this; - this.__childVisitorKeys = options.childVisitorKeys - ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) - : estraverse.VisitorKeys; - if (options.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof options.fallback === 'function') { - this.__fallback = options.fallback; - } - } - - /* Default method for visiting children. - * When you need to call default visiting operation inside custom visiting - * operation, you can use it with `this.visitChildren(node)`. - */ - Visitor.prototype.visitChildren = function (node) { - var type, children, i, iz, j, jz, child; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - - children = this.__childVisitorKeys[type]; - if (!children) { - if (this.__fallback) { - children = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + type + '.'); - } - } - - for (i = 0, iz = children.length; i < iz; ++i) { - child = node[children[i]]; - if (child) { - if (Array.isArray(child)) { - for (j = 0, jz = child.length; j < jz; ++j) { - if (child[j]) { - if (isNode(child[j]) || isProperty(type, children[i])) { - this.visit(child[j]); - } - } - } - } else if (isNode(child)) { - this.visit(child); - } - } - } - }; - - /* Dispatching node. */ - Visitor.prototype.visit = function (node) { - var type; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - if (this.__visitor[type]) { - this.__visitor[type].call(this, node); - return; - } - this.visitChildren(node); - }; - - exports.version = require('./package.json').version; - exports.Visitor = Visitor; - exports.visit = function (node, visitor, options) { - var v = new Visitor(visitor, options); - v.visit(node); - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esrecurse/package.json b/tools/node_modules/babel-eslint/node_modules/esrecurse/package.json deleted file mode 100755 index 3b1e0519a75240..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esrecurse/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "babel": { - "presets": [ - "es2015" - ] - }, - "bugs": { - "url": "https://github.com/estools/esrecurse/issues" - }, - "bundleDependencies": false, - "dependencies": { - "estraverse": "^4.1.0" - }, - "deprecated": false, - "description": "ECMAScript AST recursive visitor", - "devDependencies": { - "babel-cli": "^6.24.1", - "babel-eslint": "^7.2.3", - "babel-preset-es2015": "^6.24.1", - "babel-register": "^6.24.1", - "chai": "^4.0.2", - "esprima": "^4.0.0", - "gulp": "^3.9.0", - "gulp-bump": "^2.7.0", - "gulp-eslint": "^4.0.0", - "gulp-filter": "^5.0.0", - "gulp-git": "^2.4.1", - "gulp-mocha": "^4.3.1", - "gulp-tag-version": "^1.2.1", - "jsdoc": "^3.3.0-alpha10", - "minimist": "^1.1.0" - }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/esrecurse", - "license": "BSD-2-Clause", - "main": "esrecurse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "https://github.com/Constellation" - } - ], - "name": "esrecurse", - "repository": { - "type": "git", - "url": "git+https://github.com/estools/esrecurse.git" - }, - "scripts": { - "lint": "gulp lint", - "test": "gulp travis", - "unit-test": "gulp test" - }, - "version": "4.2.1" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/estraverse/LICENSE.BSD b/tools/node_modules/babel-eslint/node_modules/estraverse/LICENSE.BSD deleted file mode 100644 index 3e580c355a96e5..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/estraverse/LICENSE.BSD +++ /dev/null @@ -1,19 +0,0 @@ -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. - -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 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. diff --git a/tools/node_modules/babel-eslint/node_modules/estraverse/estraverse.js b/tools/node_modules/babel-eslint/node_modules/estraverse/estraverse.js deleted file mode 100644 index 09ae4783247f0c..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/estraverse/estraverse.js +++ /dev/null @@ -1,849 +0,0 @@ -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - 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. - - 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 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. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - isArray, - VisitorOption, - VisitorKeys, - objectCreate, - objectKeys, - BREAK, - SKIP, - REMOVE; - - function ignoreJSHintError() { } - - isArray = Array.isArray; - if (!isArray) { - isArray = function isArray(array) { - return Object.prototype.toString.call(array) === '[object Array]'; - }; - } - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - function shallowCopy(obj) { - var ret = {}, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - ignoreJSHintError(shallowCopy); - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - function lowerBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - i = current + 1; - len -= diff + 1; - } else { - len = diff; - } - } - return i; - } - ignoreJSHintError(lowerBound); - - objectCreate = Object.create || (function () { - function F() { } - - return function (o) { - F.prototype = o; - return new F(); - }; - })(); - - objectKeys = Object.keys || function (o) { - var keys = [], key; - for (key in o) { - keys.push(key); - } - return keys; - }; - - function extend(to, from) { - var keys = objectKeys(from), key, i, len; - for (i = 0, len = keys.length; i < len; i += 1) { - key = keys[i]; - to[key] = from[key]; - } - return to; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = objectKeys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = extend(objectCreate(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.version = require('./package.json').version; - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/estraverse/package.json b/tools/node_modules/babel-eslint/node_modules/estraverse/package.json deleted file mode 100644 index 18c895263916d4..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/estraverse/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/estools/estraverse/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ECMAScript JS AST traversal functions", - "devDependencies": { - "babel-preset-es2015": "^6.3.13", - "babel-register": "^6.3.13", - "chai": "^2.1.1", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.2.1", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/estools/estraverse", - "license": "BSD-2-Clause", - "main": "estraverse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "estraverse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" - }, - "scripts": { - "lint": "jshint estraverse.js", - "test": "npm run-script lint && npm run-script unit-test", - "unit-test": "mocha --compilers js:babel-register" - }, - "version": "4.2.0" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/README.md b/tools/node_modules/babel-eslint/node_modules/esutils/README.md index 610d8bde66ff81..517526cfb99b97 100644 --- a/tools/node_modules/babel-eslint/node_modules/esutils/README.md +++ b/tools/node_modules/babel-eslint/node_modules/esutils/README.md @@ -98,8 +98,8 @@ respectively. If the `strict` flag is truthy, this function additionally checks Returns `true` if provided identifier string is a Keyword or Future Reserved Word in ECMA262 edition 6. They are formally defined in ECMA262 sections -[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and -[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words), +[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and +[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), respectively. If the `strict` flag is truthy, this function additionally checks whether `id` is a Keyword or Future Reserved Word under strict mode. @@ -113,7 +113,7 @@ is a Reserved Word under strict mode. #### keyword.isReservedWordES6(id, strict) Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. -They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words). +They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). If the `strict` flag is truthy, this function additionally checks whether `id` is a Reserved Word under strict mode. @@ -121,13 +121,18 @@ is a Reserved Word under strict mode. Returns `true` if provided identifier string is one of `eval` or `arguments`. They are restricted in strict mode code throughout ECMA262 edition 5.1 and -in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors). +in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). -#### keyword.isIdentifierName(id) +#### keyword.isIdentifierNameES5(id) Return true if provided identifier string is an IdentifierName as specified in ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). +#### keyword.isIdentifierNameES6(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). + #### keyword.isIdentifierES5(id, strict) Return true if provided identifier string is an Identifier as specified in @@ -138,7 +143,7 @@ under strict mode. #### keyword.isIdentifierES6(id, strict) Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers). +ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). If the `strict` flag is truthy, this function additionally checks whether `id` is an Identifier under strict mode. diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js b/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js index 2a7c19d63c89b3..23136af91f9fbc 100644 --- a/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js +++ b/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js @@ -30,17 +30,17 @@ // See `tools/generate-identifier-regex.js`. ES5Regex = { - // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, - // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ }; ES6Regex = { - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; function isDecimalDigit(ch) { @@ -60,7 +60,7 @@ // 7.2 White Space NON_ASCII_WHITESPACES = [ - 0x1680, 0x180E, + 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/package.json b/tools/node_modules/babel-eslint/node_modules/esutils/package.json index 84df59656f12e8..cffa439c8dafce 100644 --- a/tools/node_modules/babel-eslint/node_modules/esutils/package.json +++ b/tools/node_modules/babel-eslint/node_modules/esutils/package.json @@ -10,8 +10,8 @@ "coffee-script": "~1.6.3", "jshint": "2.6.3", "mocha": "~2.2.1", - "regenerate": "~1.2.1", - "unicode-7.0.0": "^0.1.5" + "regenerate": "~1.3.1", + "unicode-9.0.0": "~0.7.0" }, "directories": { "lib": "./lib" @@ -25,12 +25,7 @@ "lib" ], "homepage": "https://github.com/estools/esutils", - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/estools/esutils/raw/master/LICENSE.BSD" - } - ], + "license": "BSD-2-Clause", "main": "lib/utils.js", "maintainers": [ { @@ -50,5 +45,5 @@ "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers coffee:coffee-script -R spec" }, - "version": "2.0.2" + "version": "2.0.3" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/LICENSE b/tools/node_modules/babel-eslint/node_modules/lodash/LICENSE index c6f2f6145e79b8..77c42f1408a38a 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/LICENSE +++ b/tools/node_modules/babel-eslint/node_modules/lodash/LICENSE @@ -1,4 +1,4 @@ -Copyright JS Foundation and other contributors +Copyright OpenJS Foundation and other contributors Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/README.md b/tools/node_modules/babel-eslint/node_modules/lodash/README.md index ba111a5a54ff20..292832fef2ff16 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/README.md +++ b/tools/node_modules/babel-eslint/node_modules/lodash/README.md @@ -1,4 +1,4 @@ -# lodash v4.17.11 +# lodash v4.17.15 The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. @@ -28,12 +28,12 @@ var at = require('lodash/at'); var curryN = require('lodash/fp/curryN'); ``` -See the [package source](https://github.com/lodash/lodash/tree/4.17.11-npm) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.17.15-npm) for more details. **Note:**
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. ## Support -Tested in Chrome 68-69, Firefox 61-62, IE 11, Edge 17, Safari 10-11, Node.js 6-10, & PhantomJS 2.1.1.
+Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js b/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js index 6f73684f2a6084..290de9275def00 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js @@ -140,16 +140,10 @@ function baseClone(value, bitmask, customizer, key, object, stack) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); - - return result; - } - - if (isMap(value)) { + } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); - - return result; } var keysFunc = isFull diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js b/tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js index c5868f04c5ea3d..c98b5eb0b6acc0 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js @@ -22,8 +22,8 @@ function baseMerge(object, source, srcIndex, customizer, stack) { return; } baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); if (isObject(srcValue)) { - stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js b/tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js index bf9b713fcb2b79..88be5df396b61c 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js @@ -1,9 +1,11 @@ -var toInteger = require('./toInteger'), +var root = require('./_root'), + toInteger = require('./toInteger'), toNumber = require('./toNumber'), toString = require('./toString'); /* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +var nativeIsFinite = root.isFinite, + nativeMin = Math.min; /** * Creates a function like `_.round`. @@ -17,7 +19,7 @@ function createRound(methodName) { return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision) { + if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js b/tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js index 411b062053fc65..b070897db29cac 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js @@ -1,5 +1,5 @@ /** - * Gets the value at `key`, unless `key` is "__proto__". + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. @@ -7,6 +7,10 @@ * @returns {*} Returns the property value. */ function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + if (key == '__proto__') { return; } diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/core.js b/tools/node_modules/babel-eslint/node_modules/lodash/core.js index e333c15b986734..89c77ded06308d 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/core.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/core.js @@ -2,7 +2,7 @@ * @license * Lodash (Custom Build) * Build: `lodash core -o ./dist/lodash.core.js` - * Copyright JS Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.11'; + var VERSION = '4.17.15'; /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js b/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js index bd1e5453f3617b..bb543ff54abc0a 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js @@ -25,5 +25,5 @@ return G(2,n)},o.pick=$n,o.slice=function(n,t,r){var e=null==n?0:n.length;return return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return M(n)?n.length?A(n):[]:W(n)},o.values=W,o.extend=Bn,Y(o,o),o.clone=function(n){return V(n)?Nn(n)?A(n):k(n,_n(n)):n},o.escape=function(n){return(n=Q(n))&&rn.test(n)?n.replace(tn,fn):n},o.every=function(n,t,r){return t=r?Z:t,f(n,g(t))},o.find=An,o.forEach=z,o.has=function(n,t){return null!=n&&pn.call(n,t)},o.head=q,o.identity=X,o.indexOf=P,o.isArguments=n,o.isArray=Nn,o.isBoolean=function(n){return true===n||false===n||H(n)&&"[object Boolean]"==hn.call(n); },o.isDate=function(n){return H(n)&&"[object Date]"==hn.call(n)},o.isEmpty=function(t){return M(t)&&(Nn(t)||L(t)||U(t.splice)||n(t))?!t.length:!_n(t).length},o.isEqual=function(n,t){return b(n,t)},o.isFinite=function(n){return typeof n=="number"&&gn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return H(n)&&"[object RegExp]"==hn.call(n)},o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){ var t=null==n?0:n.length;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?a(n,X,v):Z},o.min=function(n){return n&&n.length?a(n,X,_):Z},o.noConflict=function(){return on._===this&&(on._=vn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=M(n)?n:_n(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,E(n,g(t))},o.uniqueId=function(n){var t=++sn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){ -var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.11",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:an)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Nn(u)?u:[],n)}return this[r](function(r){return t.apply(Nn(r)?r:[],n); +var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.15",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:an)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Nn(u)?u:[],n)}return this[r](function(r){return t.apply(Nn(r)?r:[],n); })}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/debounce.js b/tools/node_modules/babel-eslint/node_modules/lodash/debounce.js index 205e49f342480e..8f751d53d11886 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/debounce.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/debounce.js @@ -173,6 +173,7 @@ function debounce(func, wait, options) { } if (maxing) { // Handle invocations in a tight loop. + clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js b/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js index cb139dd81ebee6..9b95dfefe87f73 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js @@ -1,7 +1,7 @@ /** * @license * Lodash - * Copyright JS Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.11'; + var VERSION = '4.17.15'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -2671,16 +2671,10 @@ value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); - - return result; - } - - if (isMap(value)) { + } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); - - return result; } var keysFunc = isFull @@ -3604,8 +3598,8 @@ return; } baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); if (isObject(srcValue)) { - stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { @@ -5422,7 +5416,7 @@ return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision) { + if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), @@ -6605,7 +6599,7 @@ } /** - * Gets the value at `key`, unless `key` is "__proto__". + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. @@ -6613,6 +6607,10 @@ * @returns {*} Returns the property value. */ function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + if (key == '__proto__') { return; } @@ -10413,6 +10411,7 @@ } if (maxing) { // Handle invocations in a tight loop. + clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } @@ -14799,9 +14798,12 @@ , 'g'); // Use a sourceURL for easier debugging. + // The sourceURL gets injected into the source that's eval-ed, so be careful + // with lookup (in case of e.g. prototype pollution), and strip newlines if any. + // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. var sourceURL = '//# sourceURL=' + - ('sourceURL' in options - ? options.sourceURL + (hasOwnProperty.call(options, 'sourceURL') + ? (options.sourceURL + '').replace(/[\r\n]/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; @@ -14834,7 +14836,9 @@ // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. - var variable = options.variable; + // Like with sourceURL, we take care to not check the option's prototype, + // as this configuration is a code injection vector. + var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } @@ -17039,10 +17043,11 @@ baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { - var key = (lodashFunc.name + ''), - names = realNames[key] || (realNames[key] = []); - - names.push({ 'name': methodName, 'func': lodashFunc }); + var key = lodashFunc.name + ''; + if (!hasOwnProperty.call(realNames, key)) { + realNames[key] = []; + } + realNames[key].push({ 'name': methodName, 'func': lodashFunc }); } }); diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.min.js b/tools/node_modules/babel-eslint/node_modules/lodash/lodash.min.js index c911263442db41..13ec307dac5a6f 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.min.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/lodash.min.js @@ -6,132 +6,132 @@ return true}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,kn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",En=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kn+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Un={}; -Un["[object Float32Array]"]=Un["[object Float64Array]"]=Un["[object Int8Array]"]=Un["[object Int16Array]"]=Un["[object Int32Array]"]=Un["[object Uint8Array]"]=Un["[object Uint8ClampedArray]"]=Un["[object Uint16Array]"]=Un["[object Uint32Array]"]=true,Un["[object Arguments]"]=Un["[object Array]"]=Un["[object ArrayBuffer]"]=Un["[object Boolean]"]=Un["[object DataView]"]=Un["[object Date]"]=Un["[object Error]"]=Un["[object Function]"]=Un["[object Map]"]=Un["[object Number]"]=Un["[object Object]"]=Un["[object RegExp]"]=Un["[object Set]"]=Un["[object String]"]=Un["[object WeakMap]"]=false; -var Bn={};Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object DataView]"]=Bn["[object Boolean]"]=Bn["[object Date]"]=Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object Symbol]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true, -Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object WeakMap]"]=false;var Ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){ -try{var n=Nn&&Nn.require&&Nn.require("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e", -"\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a", -"\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I", -"\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r", -"\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ", -"\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Ln)){if(n instanceof On)return n;if(oi.call(n,"__wrapped__"))return Fe(n)}return new On(n)}function kn(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Ln(n){ -this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!du(n))return n;if(u=ff(n)){if(f=me(n),!c)return Lr(n,f)}else{var s=vo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(af(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Bn[s])return i?n:{};f=ke(n,s,c)}}if(o||(o=new Zn), -i=o.get(n))return i;if(o.set(n,f),pf(n))return n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}),f;if(sf(n))return n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))}),f;var a=l?a?ve:_e:a?Uu:Wu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=Wu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Qu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ti("Expected a function"); -return bo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,E(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&oi.call(n,t)}function zt(n,t){return null!=n&&t in Qu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Ku(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,E(t))),s=Ci(p.length,s), -l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:Et(t,hr(r,0,-1)),r=null==t?t:t[Me(Ve(r))],null==r?T:n(r,t,e)}function Lt(n){return yu(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ -return yu(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return yu(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)return true;if(null==n||null==t||!yu(n)&&!yu(t))return n!==n&&t!==t;n:{var i=ff(n),o=ff(t),f=i?"[object Array]":vo(n),c=o?"[object Array]":vo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&af(n)){if(!af(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Zn),t=i||_f(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ +}function A(n,t){for(var r=-1,e=Array(n);++r"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,En="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",kn=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+En+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Bn={}; +Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false; +var Ln={};Ln["[object Arguments]"]=Ln["[object Array]"]=Ln["[object ArrayBuffer]"]=Ln["[object DataView]"]=Ln["[object Boolean]"]=Ln["[object Date]"]=Ln["[object Float32Array]"]=Ln["[object Float64Array]"]=Ln["[object Int8Array]"]=Ln["[object Int16Array]"]=Ln["[object Int32Array]"]=Ln["[object Map]"]=Ln["[object Number]"]=Ln["[object Object]"]=Ln["[object RegExp]"]=Ln["[object Set]"]=Ln["[object String]"]=Ln["[object Symbol]"]=Ln["[object Uint8Array]"]=Ln["[object Uint8ClampedArray]"]=Ln["[object Uint16Array]"]=Ln["[object Uint32Array]"]=true, +Ln["[object Error]"]=Ln["[object Function]"]=Ln["[object WeakMap]"]=false;var Un={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){ +try{var n=Nn&&Nn.f&&Nn.f("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I", +"\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C", +"\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i", +"\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r", +"\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij", +"\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(oi.call(n,"__wrapped__"))return Fe(n)}return new On(n)}function En(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Un(n){this.__wrapped__=n, +this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!du(n))return n;if(u=ff(n)){if(f=me(n),!c)return Ur(n,f)}else{var s=vo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(af(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Ln[s])return i?n:{};f=Ee(n,s,c)}}if(o||(o=new Zn), +i=o.get(n))return i;o.set(n,f),pf(n)?n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}):sf(n)&&n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))});var a=l?a?ve:_e:a?Bu:Wu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=Wu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Qu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ti("Expected a function"); +return bo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,k(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&oi.call(n,t)}function zt(n,t){return null!=n&&t in Qu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Ku(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,k(t))),s=Ci(p.length,s), +l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:kt(t,hr(r,0,-1)),r=null==t?t:t[Me(Ve(r))],null==r?T:n(r,t,e)}function Ut(n){return yu(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ +return yu(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return yu(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!yu(n)&&!yu(t))t=n!==n&&t!==t;else n:{var i=ff(n),o=ff(t),f=i?"[object Array]":vo(n),c=o?"[object Array]":vo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&af(n)){if(!af(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Zn),t=i||_f(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ if(!(1&r)&&(i=a&&oi.call(n,"__wrapped__"),f=o&&oi.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Zn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Zn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:oi.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++at?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[$u],E(ye())),n=Gt(n,function(n,r,u){return{a:c(t,function(t){return t(n)}), -b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f){e=c;break n}e=c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return zu(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ku(u);++e=u){for(;e>>1,o=n[i];null!==o&&!wu(o)&&(r?o<=t:ot.length?n:Et(n,hr(t,0,-1)),null==n||delete n[Me(Ve(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Ku(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=gi?gi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new vi(t).set(new vi(n)),t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length); -}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=wu(n),o=t!==T,f=null===t,c=t===t,a=wu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Qu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:B(f,a),o-=c.length,or?r?or(t,n):t:(r=or(t,Oi(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Ku(l+c),h=this&&this!==$n&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Ur(e,r,h[4]):r,i[4]=e?B(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Br(e,r,h[6]):r,i[6]=e?B(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ci(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1], -r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Li(i[9]-a,0),!f&&24&t&&(t&=-25),c=t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),Le((h?co:yo)(c,i),n,t)}function ce(n,t,r,e){return n===T||lu(n,ei[r])&&!oi.call(e,r)?t:n}function ae(n,t,r,e,u,i){return du(n)&&du(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return xu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t; +}else{if(f=new Zn,e)var s=e(a,l,c,n,t,f);if(s===T?!Mt(l,a,3,e,f):!s)return false}}return true}function Ft(n){return!(!du(n)||ci&&ci in n)&&(_u(n)?hi:dn).test(Te(n))}function Nt(n){return yu(n)&&"[object RegExp]"==Ot(n)}function Pt(n){return yu(n)&&"[object Set]"==vo(n)}function Zt(n){return yu(n)&&gu(n.length)&&!!Bn[Ot(n)]}function qt(n){return typeof n=="function"?n:null==n?$u:typeof n=="object"?ff(n)?Jt(n[0],n[1]):Ht(n):Zu(n)}function Vt(n){if(!ze(n))return Li(n);var t,r=[];for(t in Qu(n))oi.call(n,t)&&"constructor"!=t&&r.push(t); +return r}function Kt(n,t){return nt?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[$u],k(ye())),n=Gt(n,function(n){return{ +a:c(t,function(t){return t(n)}),b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return zu(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ku(u);++e=u){for(;e>>1,o=n[i];null!==o&&!wu(o)&&(r?o<=t:ot.length?n:kt(n,hr(t,0,-1)),null==n||delete n[Me(Ve(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Ku(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=gi?gi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new vi(t).set(new vi(n)), +t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length)}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=wu(n),o=t!==T,f=null===t,c=t===t,a=wu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Qu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:L(f,a), +o-=c.length,or?r?or(t,n):t:(r=or(t,Oi(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Ku(l+c),h=this&&this!==$n&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?L(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?L(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ci(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0], +t=i[1],r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Ui(i[9]-a,0),!f&&24&t&&(t&=-25),Ue((h?co:yo)(t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),i),n,t)}function ce(n,t,r,e){return n===T||lu(n,ei[r])&&!oi.call(e,r)?t:n}function ae(n,t,r,e,u,i){return du(n)&&du(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return xu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t; var c=-1,a=true,l=2&r?new Nn:T;for(i.set(n,t),i.set(t,n);++cr&&(r=Li(e+r,0)),_(n,ye(t,3),r)):-1}function Pe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=ku(r),u=0>r?Li(e+u,0):Ci(u,e-1)),_(n,ye(t,3),u,true)}function Ze(n){return(null==n?0:n.length)?wt(n,1):[]; -}function qe(n){return n&&n.length?n[0]:T}function Ve(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ke(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ge(n){return null==n?n:$i.call(n)}function He(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(hu(n))return t=Li(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function Je(t,r){if(!t||!t.length)return[];var e=He(t);return null==r?e:c(e,function(t){return n(r,T,t)})}function Ye(n){return n=An(n),n.__chain__=true,n; -}function Qe(n,t){return t(n)}function Xe(){return this}function nu(n,t){return(ff(n)?r:uo)(n,ye(t,3))}function tu(n,t){return(ff(n)?e:io)(n,ye(t,3))}function ru(n,t){return(ff(n)?c:Gt)(n,ye(t,3))}function eu(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function uu(n,t){var r;if(typeof t!="function")throw new ti("Expected a function");return n=ku(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T),r}}function iu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=iu.placeholder, -n}function ou(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=ou.placeholder,n}function fu(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Go();if(u(n))return o(n);var r,e=bo;r=n-_,n=t-(n-p),r=g?Ci(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Go(),r=u(n);if(c=arguments,a=this,p=n,r){if(h===T)return _=n=p,h=bo(i,t),v?e(n):s;if(g)return h=bo(i,t),e(p)}return h===T&&(h=bo(i,t)), -s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ti("Expected a function");return t=Su(t)||0,du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Li(Su(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&lo(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Go())},f}function cu(n,t){if(typeof n!="function"||null!=t&&typeof t!="function")throw new ti("Expected a function");var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e), -r.cache=i.set(u,e)||i,e)};return r.cache=new(cu.Cache||Fn),r}function au(n){if(typeof n!="function")throw new ti("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function lu(n,t){return n===t||n!==n&&t!==t}function su(n){return null!=n&&gu(n.length)&&!_u(n)}function hu(n){return yu(n)&&su(n)}function pu(n){if(!yu(n))return false; -var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!xu(n)}function _u(n){return!!du(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function vu(n){return typeof n=="number"&&n==ku(n)}function gu(n){return typeof n=="number"&&-1=n}function du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function yu(n){return null!=n&&typeof n=="object"; -}function bu(n){return typeof n=="number"||yu(n)&&"[object Number]"==Ot(n)}function xu(n){return!(!yu(n)||"[object Object]"!=Ot(n))&&(n=di(n),null===n||(n=oi.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ii.call(n)==li))}function ju(n){return typeof n=="string"||!ff(n)&&yu(n)&&"[object String]"==Ot(n)}function wu(n){return typeof n=="symbol"||yu(n)&&"[object Symbol]"==Ot(n)}function mu(n){if(!n)return[];if(su(n))return ju(n)?M(n):Lr(n);if(wi&&n[wi]){n=n[wi]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value); -return r}return t=vo(n),("[object Map]"==t?W:"[object Set]"==t?L:Lu)(n)}function Au(n){return n?(n=Su(n),n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function ku(n){n=Au(n);var t=n%1;return n===n?t?n-t:n:0}function Eu(n){return n?pt(ku(n),0,4294967295):0}function Su(n){if(typeof n=="number")return n;if(wu(n))return F;if(du(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=du(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n; -}function Ou(n){return Cr(n,Uu(n))}function Iu(n){return null==n?"":yr(n)}function Ru(n,t,r){return n=null==n?T:Et(n,t),n===T?r:n}function zu(n,t){return null!=n&&we(n,t,zt)}function Wu(n){return su(n)?qn(n):Vt(n)}function Uu(n){if(su(n))n=qn(n,true);else if(du(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&oi.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in Qu(n))t.push(r);n=t}return n}function Bu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){ -return t(n,r[0])})}function Lu(n){return null==n?[]:S(n,Wu(n))}function Cu(n){return $f(Iu(n).toLowerCase())}function Du(n){return(n=Iu(n))&&n.replace(xn,Xn).replace(Sn,"")}function Mu(n,t,r){return n=Iu(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Tu(n){return function(){return n}}function $u(n){return n}function Fu(n){return qt(typeof n=="function"?n:_t(n,1))}function Nu(n,t,e){var u=Wu(t),i=kt(t,u);null!=e||du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=kt(t,Wu(t))); -var o=!(du(e)&&"chain"in e&&!e.chain),f=_u(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Lr(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pu(){}function Zu(n){return Ie(n)?b(Me(n)):rr(n)}function qu(){return[]}function Vu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Ku=mn.Array,Gu=mn.Date,Hu=mn.Error,Ju=mn.Function,Yu=mn.Math,Qu=mn.Object,Xu=mn.RegExp,ni=mn.String,ti=mn.TypeError,ri=Ku.prototype,ei=Qu.prototype,ui=mn["__core-js_shared__"],ii=Ju.prototype.toString,oi=ei.hasOwnProperty,fi=0,ci=function(){ -var n=/[^.]+$/.exec(ui&&ui.keys&&ui.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ai=ei.toString,li=ii.call(Qu),si=$n._,hi=Xu("^"+ii.call(oi).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pi=Pn?mn.Buffer:T,_i=mn.Symbol,vi=mn.Uint8Array,gi=pi?pi.allocUnsafe:T,di=U(Qu.getPrototypeOf,Qu),yi=Qu.create,bi=ei.propertyIsEnumerable,xi=ri.splice,ji=_i?_i.isConcatSpreadable:T,wi=_i?_i.iterator:T,mi=_i?_i.toStringTag:T,Ai=function(){try{var n=je(Qu,"defineProperty"); -return n({},"",{}),n}catch(n){}}(),ki=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,Ei=Gu&&Gu.now!==$n.Date.now&&Gu.now,Si=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Oi=Yu.ceil,Ii=Yu.floor,Ri=Qu.getOwnPropertySymbols,zi=pi?pi.isBuffer:T,Wi=mn.isFinite,Ui=ri.join,Bi=U(Qu.keys,Qu),Li=Yu.max,Ci=Yu.min,Di=Gu.now,Mi=mn.parseInt,Ti=Yu.random,$i=ri.reverse,Fi=je(mn,"DataView"),Ni=je(mn,"Map"),Pi=je(mn,"Promise"),Zi=je(mn,"Set"),qi=je(mn,"WeakMap"),Vi=je(Qu,"create"),Ki=qi&&new qi,Gi={},Hi=Te(Fi),Ji=Te(Ni),Yi=Te(Pi),Qi=Te(Zi),Xi=Te(qi),no=_i?_i.prototype:T,to=no?no.valueOf:T,ro=no?no.toString:T,eo=function(){ -function n(){}return function(t){return du(t)?yi?yi(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=kn.prototype,An.prototype.constructor=An,On.prototype=eo(kn.prototype),On.prototype.constructor=On,Ln.prototype=eo(kn.prototype),Ln.prototype.constructor=Ln,Mn.prototype.clear=function(){this.__data__=Vi?Vi(null):{},this.size=0},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], +return typeof n.constructor!="function"||ze(n)?{}:eo(di(n))}function Ee(n,t,r){var e=n.constructor;switch(t){case"[object ArrayBuffer]":return Rr(n);case"[object Boolean]":case"[object Date]":return new e(+n);case"[object DataView]":return t=r?Rr(n.buffer):n.buffer,new n.constructor(t,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]": +case"[object Uint16Array]":case"[object Uint32Array]":return zr(n,r);case"[object Map]":return new e;case"[object Number]":case"[object String]":return new e(n);case"[object RegExp]":return t=new n.constructor(n.source,_n.exec(n)),t.lastIndex=n.lastIndex,t;case"[object Set]":return new e;case"[object Symbol]":return to?Qu(to.call(n)):{}}}function ke(n){return ff(n)||of(n)||!!(ji&&n&&n[ji])}function Se(n,t){var r=typeof n;return t=null==t?9007199254740991:t,!!t&&("number"==r||"symbol"!=r&&bn.test(n))&&-1r&&(r=Ui(e+r,0)),_(n,ye(t,3),r)):-1}function Pe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=Eu(r),u=0>r?Ui(e+u,0):Ci(u,e-1)), +_(n,ye(t,3),u,true)}function Ze(n){return(null==n?0:n.length)?wt(n,1):[]}function qe(n){return n&&n.length?n[0]:T}function Ve(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ke(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ge(n){return null==n?n:$i.call(n)}function He(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(hu(n))return t=Ui(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function Je(t,r){if(!t||!t.length)return[];var e=He(t);return null==r?e:c(e,function(t){ +return n(r,T,t)})}function Ye(n){return n=An(n),n.__chain__=true,n}function Qe(n,t){return t(n)}function Xe(){return this}function nu(n,t){return(ff(n)?r:uo)(n,ye(t,3))}function tu(n,t){return(ff(n)?e:io)(n,ye(t,3))}function ru(n,t){return(ff(n)?c:Gt)(n,ye(t,3))}function eu(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function uu(n,t){var r;if(typeof t!="function")throw new ti("Expected a function");return n=Eu(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T), +r}}function iu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=iu.placeholder,n}function ou(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=ou.placeholder,n}function fu(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Go();if(u(n))return o(n);var r,e=bo;r=n-_,n=t-(n-p),r=g?Ci(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Go(),r=u(n);if(c=arguments, +a=this,p=n,r){if(h===T)return _=n=p,h=bo(i,t),v?e(n):s;if(g)return lo(h),h=bo(i,t),e(p)}return h===T&&(h=bo(i,t)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ti("Expected a function");return t=Su(t)||0,du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ui(Su(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&lo(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Go())},f}function cu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache; +return i.has(u)?i.get(u):(e=n.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ti("Expected a function");return r.cache=new(cu.Cache||Fn),r}function au(n){if(typeof n!="function")throw new ti("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function lu(n,t){return n===t||n!==n&&t!==t; +}function su(n){return null!=n&&gu(n.length)&&!_u(n)}function hu(n){return yu(n)&&su(n)}function pu(n){if(!yu(n))return false;var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!xu(n)}function _u(n){return!!du(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function vu(n){return typeof n=="number"&&n==Eu(n)}function gu(n){return typeof n=="number"&&-1=n; +}function du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function yu(n){return null!=n&&typeof n=="object"}function bu(n){return typeof n=="number"||yu(n)&&"[object Number]"==Ot(n)}function xu(n){return!(!yu(n)||"[object Object]"!=Ot(n))&&(n=di(n),null===n||(n=oi.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ii.call(n)==li))}function ju(n){return typeof n=="string"||!ff(n)&&yu(n)&&"[object String]"==Ot(n)}function wu(n){return typeof n=="symbol"||yu(n)&&"[object Symbol]"==Ot(n); +}function mu(n){if(!n)return[];if(su(n))return ju(n)?M(n):Ur(n);if(wi&&n[wi]){n=n[wi]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=vo(n),("[object Map]"==t?W:"[object Set]"==t?U:Uu)(n)}function Au(n){return n?(n=Su(n),n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Eu(n){n=Au(n);var t=n%1;return n===n?t?n-t:n:0}function ku(n){return n?pt(Eu(n),0,4294967295):0}function Su(n){if(typeof n=="number")return n;if(wu(n))return F;if(du(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n, +n=du(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n}function Ou(n){return Cr(n,Bu(n))}function Iu(n){return null==n?"":yr(n)}function Ru(n,t,r){return n=null==n?T:kt(n,t),n===T?r:n}function zu(n,t){return null!=n&&we(n,t,zt)}function Wu(n){return su(n)?qn(n):Vt(n)}function Bu(n){if(su(n))n=qn(n,true);else if(du(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&oi.call(n,t))&&e.push(t);n=e}else{if(t=[], +null!=n)for(r in Qu(n))t.push(r);n=t}return n}function Lu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){return t(n,r[0])})}function Uu(n){return null==n?[]:S(n,Wu(n))}function Cu(n){return $f(Iu(n).toLowerCase())}function Du(n){return(n=Iu(n))&&n.replace(xn,Xn).replace(Sn,"")}function Mu(n,t,r){return n=Iu(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Tu(n){return function(){return n}}function $u(n){return n; +}function Fu(n){return qt(typeof n=="function"?n:_t(n,1))}function Nu(n,t,e){var u=Wu(t),i=Et(t,u);null!=e||du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=Et(t,Wu(t)));var o=!(du(e)&&"chain"in e&&!e.chain),f=_u(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pu(){} +function Zu(n){return Ie(n)?b(Me(n)):rr(n)}function qu(){return[]}function Vu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Ku=mn.Array,Gu=mn.Date,Hu=mn.Error,Ju=mn.Function,Yu=mn.Math,Qu=mn.Object,Xu=mn.RegExp,ni=mn.String,ti=mn.TypeError,ri=Ku.prototype,ei=Qu.prototype,ui=mn["__core-js_shared__"],ii=Ju.prototype.toString,oi=ei.hasOwnProperty,fi=0,ci=function(){var n=/[^.]+$/.exec(ui&&ui.keys&&ui.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ai=ei.toString,li=ii.call(Qu),si=$n._,hi=Xu("^"+ii.call(oi).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pi=Pn?mn.Buffer:T,_i=mn.Symbol,vi=mn.Uint8Array,gi=pi?pi.g:T,di=B(Qu.getPrototypeOf,Qu),yi=Qu.create,bi=ei.propertyIsEnumerable,xi=ri.splice,ji=_i?_i.isConcatSpreadable:T,wi=_i?_i.iterator:T,mi=_i?_i.toStringTag:T,Ai=function(){ +try{var n=je(Qu,"defineProperty");return n({},"",{}),n}catch(n){}}(),Ei=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,ki=Gu&&Gu.now!==$n.Date.now&&Gu.now,Si=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Oi=Yu.ceil,Ii=Yu.floor,Ri=Qu.getOwnPropertySymbols,zi=pi?pi.isBuffer:T,Wi=mn.isFinite,Bi=ri.join,Li=B(Qu.keys,Qu),Ui=Yu.max,Ci=Yu.min,Di=Gu.now,Mi=mn.parseInt,Ti=Yu.random,$i=ri.reverse,Fi=je(mn,"DataView"),Ni=je(mn,"Map"),Pi=je(mn,"Promise"),Zi=je(mn,"Set"),qi=je(mn,"WeakMap"),Vi=je(Qu,"create"),Ki=qi&&new qi,Gi={},Hi=Te(Fi),Ji=Te(Ni),Yi=Te(Pi),Qi=Te(Zi),Xi=Te(qi),no=_i?_i.prototype:T,to=no?no.valueOf:T,ro=no?no.toString:T,eo=function(){ +function n(){}return function(t){return du(t)?yi?yi(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=En.prototype,An.prototype.constructor=An,On.prototype=eo(En.prototype),On.prototype.constructor=On,Un.prototype=eo(En.prototype),Un.prototype.constructor=Un,Mn.prototype.clear=function(){this.__data__=Vi?Vi(null):{},this.size=0},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], this.size-=n?1:0,n},Mn.prototype.get=function(n){var t=this.__data__;return Vi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):oi.call(t,n)?t[n]:T},Mn.prototype.has=function(n){var t=this.__data__;return Vi?t[n]!==T:oi.call(t,n)},Mn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Vi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():xi.call(t,n,1), --this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return-1e?(++this.size,r.push([n,t])):r[e][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(Ni||Tn),string:new Mn}},Fn.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},Fn.prototype.get=function(n){return be(this,n).get(n); },Fn.prototype.has=function(n){return be(this,n).has(n)},Fn.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.clear=function(){this.__data__=new Tn,this.size=0},Zn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Zn.prototype.get=function(n){ -return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Ni||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e)}return r.set(n,t),this.size=r.size,this};var uo=Fr(mt),io=Fr(At,true),oo=Nr(),fo=Nr(true),co=Ki?function(n,t){return Ki.set(n,t),n}:$u,ao=Ai?function(n,t){return Ai(n,"toString",{configurable:true,enumerable:false,value:Tu(t),writable:true})}:$u,lo=ki||function(n){ -return $n.clearTimeout(n)},so=Zi&&1/L(new Zi([,-0]))[1]==$?function(n){return new Zi(n)}:Pu,ho=Ki?function(n){return Ki.get(n)}:Pu,po=Ri?function(n){return null==n?[]:(n=Qu(n),i(Ri(n),function(t){return bi.call(n,t)}))}:qu,_o=Ri?function(n){for(var t=[];n;)a(t,po(n)),n=di(n);return t}:qu,vo=Ot;(Fi&&"[object DataView]"!=vo(new Fi(new ArrayBuffer(1)))||Ni&&"[object Map]"!=vo(new Ni)||Pi&&"[object Promise]"!=vo(Pi.resolve())||Zi&&"[object Set]"!=vo(new Zi)||qi&&"[object WeakMap]"!=vo(new qi))&&(vo=function(n){ +return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Ni||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e)}return r.set(n,t),this.size=r.size,this};var uo=Fr(mt),io=Fr(At,true),oo=Nr(),fo=Nr(true),co=Ki?function(n,t){return Ki.set(n,t),n}:$u,ao=Ai?function(n,t){return Ai(n,"toString",{configurable:true,enumerable:false,value:Tu(t),writable:true})}:$u,lo=Ei||function(n){ +return $n.clearTimeout(n)},so=Zi&&1/U(new Zi([,-0]))[1]==$?function(n){return new Zi(n)}:Pu,ho=Ki?function(n){return Ki.get(n)}:Pu,po=Ri?function(n){return null==n?[]:(n=Qu(n),i(Ri(n),function(t){return bi.call(n,t)}))}:qu,_o=Ri?function(n){for(var t=[];n;)a(t,po(n)),n=di(n);return t}:qu,vo=Ot;(Fi&&"[object DataView]"!=vo(new Fi(new ArrayBuffer(1)))||Ni&&"[object Map]"!=vo(new Ni)||Pi&&"[object Promise]"!=vo(Pi.resolve())||Zi&&"[object Set]"!=vo(new Zi)||qi&&"[object WeakMap]"!=vo(new qi))&&(vo=function(n){ var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Te(n):"")switch(n){case Hi:return"[object DataView]";case Ji:return"[object Map]";case Yi:return"[object Promise]";case Qi:return"[object Set]";case Xi:return"[object WeakMap]"}return t});var go=ui?_u:Vu,yo=Ce(co),bo=Si||function(n,t){return $n.setTimeout(n,t)},xo=Ce(ao),jo=function(n){n=cu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){ -t.push(e?u.replace(hn,"$1"):r||n)}),t}),wo=fr(function(n,t){return hu(n)?yt(n,wt(t,1,hu,true)):[]}),mo=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),ye(r,2)):[]}),Ao=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),T,r):[]}),ko=fr(function(n){var t=c(n,kr);return t.length&&t[0]===n[0]?Wt(t):[]}),Eo=fr(function(n){var t=Ve(n),r=c(n,kr);return t===Ve(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),So=fr(function(n){var t=Ve(n),r=c(n,kr);return(t=typeof t=="function"?t:T)&&r.pop(), -r.length&&r[0]===n[0]?Wt(r,T,t):[]}),Oo=fr(Ke),Io=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Ro=fr(function(n){return br(wt(n,1,hu,true))}),zo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T),br(wt(n,1,hu,true),ye(t,2))}),Wo=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return br(wt(n,1,hu,true),T,t)}),Uo=fr(function(n,t){return hu(n)?yt(n,t):[]}),Bo=fr(function(n){return mr(i(n,hu))}),Lo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T), -mr(i(n,hu),ye(t,2))}),Co=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return mr(i(n,hu),T,t)}),Do=fr(He),Mo=fr(function(n){var t=n.length,t=1=t}),of=Lt(function(){return arguments}())?Lt:function(n){return yu(n)&&oi.call(n,"callee")&&!bi.call(n,"callee")},ff=Ku.isArray,cf=Vn?E(Vn):Ct,af=zi||Vu,lf=Kn?E(Kn):Dt,sf=Gn?E(Gn):Tt,hf=Hn?E(Hn):Nt,pf=Jn?E(Jn):Pt,_f=Yn?E(Yn):Zt,vf=ee(Kt),gf=ee(function(n,t){return n<=t}),df=$r(function(n,t){ -if(ze(t)||su(t))Cr(t,Wu(t),n);else for(var r in t)oi.call(t,r)&&ot(n,r,t[r])}),yf=$r(function(n,t){Cr(t,Uu(t),n)}),bf=$r(function(n,t,r,e){Cr(t,Uu(t),n,e)}),xf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),jf=pe(ht),wf=fr(function(n,t){n=Qu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=eu,An.assign=df,An.assignIn=yf,An.assignInWith=bf,An.assignWith=xf,An.at=jf,An.before=uu,An.bind=Ho,An.bindAll=Nf,An.bindKey=Jo,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return ff(n)?n:[n]},An.chain=Ye,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Li(ku(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Ku(Oi(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:ku(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; -},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=ku(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:ku(e),0>e&&(e+=u),e=r>e?0:Eu(e);r>>0,r?(n=Iu(n))&&(typeof t=="string"||null!=t&&!hf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ti("Expected a function");return r=null==r?0:Li(ku(r),0), -fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:ku(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:ku(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), -n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ti("Expected a function");return du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),fu(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Qe,An.toArray=mu,An.toPairs=zf,An.toPairsIn=Wf,An.toPath=function(n){return ff(n)?c(n,Me):wu(n)?[n]:Lr(jo(Iu(n)))},An.toPlainObject=Ou,An.transform=function(n,t,e){var u=ff(n),i=u||af(n)||_f(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:du(n)&&_u(o)?eo(di(n)):{}; -}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return eu(n,1)},An.union=Ro,An.unionBy=zo,An.unionWith=Wo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=He,An.unzipWith=Je,An.update=function(n,t,r){return null!=n&&(r=Er(r),n=lr(n,t,r(Et(n,t)),void 0)),n},An.updateWith=function(n,t,r,e){ -return e=typeof e=="function"?e:T,null!=n&&(r=Er(r),n=lr(n,t,r(Et(n,t)),e)),n},An.values=Lu,An.valuesIn=function(n){return null==n?[]:S(n,Uu(n))},An.without=Uo,An.words=Mu,An.wrap=function(n,t){return nf(Er(t),n)},An.xor=Bo,An.xorBy=Lo,An.xorWith=Co,An.zip=Do,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Mo,An.entries=zf,An.entriesIn=Wf,An.extend=yf,An.extendWith=bf,Nu(An,An),An.add=Qf,An.attempt=Ff,An.camelCase=Uf,An.capitalize=Cu, +t.push(e?u.replace(hn,"$1"):r||n)}),t}),wo=fr(function(n,t){return hu(n)?yt(n,wt(t,1,hu,true)):[]}),mo=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),ye(r,2)):[]}),Ao=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),T,r):[]}),Eo=fr(function(n){var t=c(n,Er);return t.length&&t[0]===n[0]?Wt(t):[]}),ko=fr(function(n){var t=Ve(n),r=c(n,Er);return t===Ve(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),So=fr(function(n){var t=Ve(n),r=c(n,Er);return(t=typeof t=="function"?t:T)&&r.pop(), +r.length&&r[0]===n[0]?Wt(r,T,t):[]}),Oo=fr(Ke),Io=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Ro=fr(function(n){return br(wt(n,1,hu,true))}),zo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T),br(wt(n,1,hu,true),ye(t,2))}),Wo=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return br(wt(n,1,hu,true),T,t)}),Bo=fr(function(n,t){return hu(n)?yt(n,t):[]}),Lo=fr(function(n){return mr(i(n,hu))}),Uo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T), +mr(i(n,hu),ye(t,2))}),Co=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return mr(i(n,hu),T,t)}),Do=fr(He),Mo=fr(function(n){var t=n.length,t=1=t}),of=Ut(function(){return arguments}())?Ut:function(n){return yu(n)&&oi.call(n,"callee")&&!bi.call(n,"callee")},ff=Ku.isArray,cf=Vn?k(Vn):Ct,af=zi||Vu,lf=Kn?k(Kn):Dt,sf=Gn?k(Gn):Tt,hf=Hn?k(Hn):Nt,pf=Jn?k(Jn):Pt,_f=Yn?k(Yn):Zt,vf=ee(Kt),gf=ee(function(n,t){return n<=t}),df=$r(function(n,t){ +if(ze(t)||su(t))Cr(t,Wu(t),n);else for(var r in t)oi.call(t,r)&&ot(n,r,t[r])}),yf=$r(function(n,t){Cr(t,Bu(t),n)}),bf=$r(function(n,t,r,e){Cr(t,Bu(t),n,e)}),xf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),jf=pe(ht),wf=fr(function(n,t){n=Qu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=eu,An.assign=df,An.assignIn=yf,An.assignInWith=bf,An.assignWith=xf,An.at=jf,An.before=uu,An.bind=Ho,An.bindAll=Nf,An.bindKey=Jo,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return ff(n)?n:[n]},An.chain=Ye,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Ui(Eu(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Ku(Oi(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; +},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=Eu(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Eu(e),0>e&&(e+=u),e=r>e?0:ku(e);r>>0,r?(n=Iu(n))&&(typeof t=="string"||null!=t&&!hf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ti("Expected a function");return r=null==r?0:Ui(Eu(r),0), +fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:Eu(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), +n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ti("Expected a function");return du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),fu(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Qe,An.toArray=mu,An.toPairs=zf,An.toPairsIn=Wf,An.toPath=function(n){return ff(n)?c(n,Me):wu(n)?[n]:Ur(jo(Iu(n)))},An.toPlainObject=Ou,An.transform=function(n,t,e){var u=ff(n),i=u||af(n)||_f(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:du(n)&&_u(o)?eo(di(n)):{}; +}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return eu(n,1)},An.union=Ro,An.unionBy=zo,An.unionWith=Wo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=He,An.unzipWith=Je,An.update=function(n,t,r){return null==n?n:lr(n,t,kr(r)(kt(n,t)),void 0)},An.updateWith=function(n,t,r,e){ +return e=typeof e=="function"?e:T,null!=n&&(n=lr(n,t,kr(r)(kt(n,t)),e)),n},An.values=Uu,An.valuesIn=function(n){return null==n?[]:S(n,Bu(n))},An.without=Bo,An.words=Mu,An.wrap=function(n,t){return nf(kr(t),n)},An.xor=Lo,An.xorBy=Uo,An.xorWith=Co,An.zip=Do,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Mo,An.entries=zf,An.entriesIn=Wf,An.extend=yf,An.extendWith=bf,Nu(An,An),An.add=Qf,An.attempt=Ff,An.camelCase=Bf,An.capitalize=Cu, An.ceil=Xf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=Su(r),r=r===r?r:0),t!==T&&(t=Su(t),t=t===t?t:0),pt(Su(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,Wu(t))},An.deburr=Du,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=nc,An.endsWith=function(n,t,r){ -n=Iu(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(ku(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=lu,An.escape=function(n){return(n=Iu(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return(n=Iu(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=ff(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=Fo,An.findIndex=Ne,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=No,An.findLastIndex=Pe,An.findLastKey=function(n,t){return p(n,ye(t,3),At); -},An.floor=tc,An.forEach=nu,An.forEachRight=tu,An.forIn=function(n,t){return null==n?n:oo(n,ye(t,3),Uu)},An.forInRight=function(n,t){return null==n?n:fo(n,ye(t,3),Uu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Ru,An.gt=ef,An.gte=uf,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=zu,An.head=qe,An.identity=$u,An.includes=function(n,t,r,e){return n=su(n)?n:Lu(n),r=r&&!e?ku(r):0,e=n.length,0>r&&(r=Li(e+r,0)),ju(n)?r<=e&&-1r&&(r=Li(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=Au(t),r===T?(r=t,t=0):r=Au(r),n=Su(n),n>=Ci(t,r)&&nr&&(r=Ui(e+r,0)),ju(n)?r<=e&&-1r&&(r=Ui(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=Au(t),r===T?(r=t,t=0):r=Au(r),n=Su(n),n>=Ci(t,r)&&n=n},An.isSet=pf,An.isString=ju,An.isSymbol=wu,An.isTypedArray=_f,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return yu(n)&&"[object WeakMap]"==vo(n)},An.isWeakSet=function(n){return yu(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Ui.call(n,t)},An.kebabCase=Bf,An.last=Ve,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=ku(r),u=0>u?Li(e+u,0):Ci(u,e-1)), -t===t)n:{for(r=u+1;r--;)if(n[r]===t){n=r;break n}n=r}else n=_(n,d,u,true);return n},An.lowerCase=Lf,An.lowerFirst=Cf,An.lt=vf,An.lte=gf,An.max=function(n){return n&&n.length?xt(n,$u,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,$u)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,$u,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=qu,An.stubFalse=Vu,An.stubObject=function(){ -return{}},An.stubString=function(){return""},An.stubTrue=function(){return true},An.multiply=rc,An.nth=function(n,t){return n&&n.length?Qt(n,ku(t)):T},An.noConflict=function(){return $n._===this&&($n._=si),this},An.noop=Pu,An.now=Go,An.pad=function(n,t,r){n=Iu(n);var e=(t=ku(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Ii(t),r)+n+ne(Oi(t),r))},An.padEnd=function(n,t,r){n=Iu(n);var e=(t=ku(t))?D(n):0;return t&&et){var e=n;n=t,t=e}return r||n%1||t%1?(r=Ti(),Ci(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=ff(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,uo)},An.reduceRight=function(n,t,r){ -var e=ff(n)?s:j,u=3>arguments.length;return e(n,ye(t,4),r,u,io)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:ku(t),or(Iu(n),t)},An.replace=function(){var n=arguments,t=Iu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),hf(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=Xu(u.source,Iu(_n.exec(u))+"g")), -u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Ln.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Ln.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ -iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Ln.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ln.prototype[n]=function(){return this.__filtered__?new Ln(this):this[r](1)}}),Ln.prototype.compact=function(){return this.filter($u)},Ln.prototype.find=function(n){return this.filter(n).head()},Ln.prototype.findLast=function(n){return this.reverse().find(n); -},Ln.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Ln(this):this.map(function(r){return Bt(r,n,t)})}),Ln.prototype.reject=function(n){return this.filter(au(ye(n)))},Ln.prototype.slice=function(n,t){n=ku(n);var r=this;return r.__filtered__&&(0t)?new Ln(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=ku(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Ln.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295); -},mt(Ln.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ln,c=o[0],l=f||ff(t),s=function(n){return n=u.apply(An,a([n],o)),e&&h?n[0]:n};l&&r&&typeof c=="function"&&1!=c.length&&(f=l=false);var h=this.__chain__,p=!!this.__actions__.length,c=i&&!h,f=f&&!p;return!i&&l?(t=f?t:new Ln(this),t=n.apply(t,o),t.__actions__.push({ -func:Qe,args:[s],thisArg:T}),new On(t,h)):c&&f?n.apply(this,o):(t=this.thru(s),c?e?t.value()[0]:t.value():t)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ri[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(ff(u)?u:[],n)}return this[r](function(r){return t.apply(ff(r)?r:[],n)})}}),mt(Ln.prototype,function(n,t){var r=An[t];if(r){var e=r.name+""; -(Gi[e]||(Gi[e]=[])).push({name:t,func:r})}}),Gi[Jr(T,2).name]=[{name:"wrapper",func:T}],Ln.prototype.clone=function(){var n=new Ln(this.__wrapped__);return n.__actions__=Lr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Lr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Lr(this.__views__),n},Ln.prototype.reverse=function(){if(this.__filtered__){var n=new Ln(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n; -},Ln.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=0;for(var o=i,f=this.__views__,c=-1,a=f.length;++c=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){for(var t,r=this;r instanceof kn;){ -var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Ln?(this.__actions__.length&&(n=new Ln(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,wi&&(An.prototype[wi]=Xe), -An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this); \ No newline at end of file +An.isSafeInteger=function(n){return vu(n)&&-9007199254740991<=n&&9007199254740991>=n},An.isSet=pf,An.isString=ju,An.isSymbol=wu,An.isTypedArray=_f,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return yu(n)&&"[object WeakMap]"==vo(n)},An.isWeakSet=function(n){return yu(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Bi.call(n,t)},An.kebabCase=Lf,An.last=Ve,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=Eu(r),u=0>u?Ui(e+u,0):Ci(u,e-1)), +t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=_(n,d,u,true);return n},An.lowerCase=Uf,An.lowerFirst=Cf,An.lt=vf,An.lte=gf,An.max=function(n){return n&&n.length?xt(n,$u,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,$u)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,$u,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=qu,An.stubFalse=Vu,An.stubObject=function(){return{}},An.stubString=function(){ +return""},An.stubTrue=function(){return true},An.multiply=rc,An.nth=function(n,t){return n&&n.length?Qt(n,Eu(t)):T},An.noConflict=function(){return $n._===this&&($n._=si),this},An.noop=Pu,An.now=Go,An.pad=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Ii(t),r)+n+ne(Oi(t),r))},An.padEnd=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return t&&et){var e=n;n=t,t=e}return r||n%1||t%1?(r=Ti(),Ci(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=ff(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,uo)},An.reduceRight=function(n,t,r){var e=ff(n)?s:j,u=3>arguments.length; +return e(n,ye(t,4),r,u,io)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Eu(t),or(Iu(n),t)},An.replace=function(){var n=arguments,t=Iu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),hf(u)){if(n.slice(i).search(u)){ +var f=r;for(u.global||(u=Xu(u.source,Iu(_n.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Un.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){ +var r=t+1,e=1==r||3==r;Un.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Un.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Un.prototype[n]=function(){return this.__filtered__?new Un(this):this[r](1)}}),Un.prototype.compact=function(){return this.filter($u)},Un.prototype.find=function(n){ +return this.filter(n).head()},Un.prototype.findLast=function(n){return this.reverse().find(n)},Un.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Un(this):this.map(function(r){return Lt(r,n,t)})}),Un.prototype.reject=function(n){return this.filter(au(ye(n)))},Un.prototype.slice=function(n,t){n=Eu(n);var r=this;return r.__filtered__&&(0t)?new Un(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=Eu(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Un.prototype.takeRightWhile=function(n){ +return this.reverse().takeWhile(n).reverse()},Un.prototype.toArray=function(){return this.take(4294967295)},mt(Un.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){function t(n){return n=u.apply(An,a([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Un,l=f[0],s=c||ff(o);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=i&&!h,c=c&&!p; +return!i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({func:Qe,args:[t],thisArg:T}),new On(o,h)):l&&c?n.apply(this,f):(o=this.thru(t),l?e?o.value()[0]:o.value():o)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ri[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(ff(u)?u:[],n)}return this[r](function(r){return t.apply(ff(r)?r:[],n)}); +}}),mt(Un.prototype,function(n,t){var r=An[t];if(r){var e=r.name+"";oi.call(Gi,e)||(Gi[e]=[]),Gi[e].push({name:t,func:r})}}),Gi[Jr(T,2).name]=[{name:"wrapper",func:T}],Un.prototype.clone=function(){var n=new Un(this.__wrapped__);return n.__actions__=Ur(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ur(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ur(this.__views__),n},Un.prototype.reverse=function(){if(this.__filtered__){var n=new Un(this); +n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){ +for(var t,r=this;r instanceof En;){var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head, +wi&&(An.prototype[wi]=Xe),An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/package.json b/tools/node_modules/babel-eslint/node_modules/lodash/package.json index 73236b6290042b..ccf80be0796354 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/package.json +++ b/tools/node_modules/babel-eslint/node_modules/lodash/package.json @@ -1,8 +1,7 @@ { "author": { "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" + "email": "john.david.dalton@gmail.com" }, "bugs": { "url": "https://github.com/lodash/lodash/issues" @@ -11,13 +10,11 @@ "contributors": [ { "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" + "email": "john.david.dalton@gmail.com" }, { "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" + "email": "mathias@qiwi.be" } ], "deprecated": false, @@ -39,5 +36,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" }, - "version": "4.17.11" + "version": "4.17.15" } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/template.js b/tools/node_modules/babel-eslint/node_modules/lodash/template.js index 16539eec2f78d6..f71d13024982f0 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/template.js +++ b/tools/node_modules/babel-eslint/node_modules/lodash/template.js @@ -27,6 +27,12 @@ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -162,7 +168,14 @@ function template(string, options, guard) { , 'g'); // Use a sourceURL for easier debugging. - var sourceURL = 'sourceURL' in options ? '//# sourceURL=' + options.sourceURL + '\n' : ''; + // The sourceURL gets injected into the source that's eval-ed, so be careful + // with lookup (in case of e.g. prototype pollution), and strip newlines if any. + // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. + var sourceURL = hasOwnProperty.call(options, 'sourceURL') + ? ('//# sourceURL=' + + (options.sourceURL + '').replace(/[\r\n]/g, ' ') + + '\n') + : ''; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); @@ -193,7 +206,9 @@ function template(string, options, guard) { // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. - var variable = options.variable; + // Like with sourceURL, we take care to not check the option's prototype, + // as this configuration is a code injection vector. + var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE b/tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE new file mode 100644 index 00000000000000..810f3dbea83b53 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Javier Blanco + +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/babel-eslint/node_modules/path-parse/README.md b/tools/node_modules/babel-eslint/node_modules/path-parse/README.md new file mode 100644 index 00000000000000..05097f86aef364 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/path-parse/README.md @@ -0,0 +1,42 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/index.js b/tools/node_modules/babel-eslint/node_modules/path-parse/index.js new file mode 100644 index 00000000000000..3b7601fe494eed --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/path-parse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/package.json b/tools/node_modules/babel-eslint/node_modules/path-parse/package.json new file mode 100644 index 00000000000000..49b06b414272ce --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/path-parse/package.json @@ -0,0 +1,38 @@ +{ + "author": { + "name": "Javier Blanco", + "email": "http://jbgutierrez.info" + }, + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js path.parse() ponyfill", + "homepage": "https://github.com/jbgutierrez/path-parse#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "path-parse", + "repository": { + "type": "git", + "url": "git+https://github.com/jbgutierrez/path-parse.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.6" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/LICENSE b/tools/node_modules/babel-eslint/node_modules/resolve/LICENSE new file mode 100644 index 00000000000000..ff4fce28af33a4 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 James Halliday + +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/babel-eslint/node_modules/resolve/index.js b/tools/node_modules/babel-eslint/node_modules/resolve/index.js new file mode 100644 index 00000000000000..eb6ba89e6c210c --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/index.js @@ -0,0 +1,8 @@ +var core = require('./lib/core'); +var async = require('./lib/async'); +async.core = core; +async.isCore = function isCore(x) { return core[x]; }; +async.sync = require('./lib/sync'); + +exports = async; +module.exports = async; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js new file mode 100644 index 00000000000000..004b2798baf0c2 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js @@ -0,0 +1,271 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) { + if (opts && opts.preserveSymlinks === false) { + fs.realpath(x, function (realPathErr, realPath) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); + else cb(null, realPathErr ? x : realPath); + }); + } else { + cb(null, x); + } +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var isDirectory = opts.isDirectory || defaultIsDir; + var readFile = opts.readFile || fs.readFile; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + maybeUnwrapSymlink( + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (core[x]) return cb(null, x); + else if (n) { + return maybeUnwrapSymlink(n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeUnwrapSymlink(d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + var pkgfile = path.join(dir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + var pkgfile = path.join(x, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(dir, isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + var file = path.join(dir, x); + loadAsFile(file, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(path.join(dir, x), opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + processDirs(cb, nodeModulesPaths(start, opts, x)); + } +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js new file mode 100644 index 00000000000000..b14a2804ae828a --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js new file mode 100644 index 00000000000000..0877650ccad4e8 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js @@ -0,0 +1,53 @@ +var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; + +function specifierIncluded(specifier) { + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = Number(current[i] || 0); + var ver = Number(versionParts[i] || 0); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } else if (op === '>=') { + return cur >= ver; + } else { + return false; + } + } + return op === '>='; +} + +function matchesRange(range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { return false; } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(specifiers[i])) { return false; } + } + return true; +} + +function versionIncluded(specifierValue) { + if (typeof specifierValue === 'boolean') { return specifierValue; } + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(specifierValue[i])) { return true; } + } + return false; + } + return matchesRange(specifierValue); +} + +var data = require('./core.json'); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = versionIncluded(data[mod]); + } +} +module.exports = core; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json b/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json new file mode 100644 index 00000000000000..12a6ac7e6c364b --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json @@ -0,0 +1,74 @@ +{ + "assert": true, + "async_hooks": ">= 8", + "buffer_ieee754": "< 0.9.7", + "buffer": true, + "child_process": true, + "cluster": true, + "console": true, + "constants": true, + "crypto": true, + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "dns": true, + "domain": true, + "events": true, + "freelist": "< 6", + "fs": true, + "fs/promises": ">= 10 && < 10.1", + "_http_agent": ">= 0.11.1", + "_http_client": ">= 0.11.1", + "_http_common": ">= 0.11.1", + "_http_incoming": ">= 0.11.1", + "_http_outgoing": ">= 0.11.1", + "_http_server": ">= 0.11.1", + "http": true, + "http2": ">= 8.8", + "https": true, + "inspector": ">= 8.0.0", + "_linklist": "< 8", + "module": true, + "net": true, + "node-inspect/lib/_inspect": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12", + "os": true, + "path": true, + "perf_hooks": ">= 8.5", + "process": ">= 1", + "punycode": true, + "querystring": true, + "readline": true, + "repl": true, + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "_stream_transform": ">= 0.9.4", + "_stream_wrap": ">= 1.4.1", + "_stream_passthrough": ">= 0.9.4", + "_stream_readable": ">= 0.9.4", + "_stream_writable": ">= 0.9.4", + "stream": true, + "string_decoder": true, + "sys": true, + "timers": true, + "_tls_common": ">= 0.11.13", + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "tls": true, + "trace_events": ">= 10", + "tty": true, + "url": true, + "util": true, + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8": ">= 1", + "vm": true, + "worker_threads": ">= 11.7", + "zlib": true +} diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 00000000000000..2b43813a7a561b --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js new file mode 100644 index 00000000000000..4b56904eaea72b --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js @@ -0,0 +1,10 @@ +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js b/tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js new file mode 100644 index 00000000000000..e8d83de5b6d3b2 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js @@ -0,0 +1,172 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); +}; + +var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) { + if (opts && opts.preserveSymlinks === false) { + try { + return fs.realpathSync(x); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + } + return x; +}; + +module.exports = function (x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + var isDirectory = opts.isDirectory || defaultIsDir; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = maybeUnwrapSymlink(path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeUnwrapSymlink(m, opts); + } else if (core[x]) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeUnwrapSymlink(n, opts); + } + + if (core[x]) return x; + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(dir, 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, dir); + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(x, '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + } catch (e) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + if (isDirectory(dir)) { + var m = loadAsFileSync(path.join(dir, '/', x)); + if (m) return m; + var n = loadAsDirectorySync(path.join(dir, '/', x)); + if (n) return n; + } + } + } +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/package.json b/tools/node_modules/babel-eslint/node_modules/resolve/package.json new file mode 100644 index 00000000000000..95353241e58cad --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/package.json @@ -0,0 +1,49 @@ +{ + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/browserify/resolve/issues" + }, + "bundleDependencies": false, + "dependencies": { + "path-parse": "^1.0.6" + }, + "deprecated": false, + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "devDependencies": { + "@ljharb/eslint-config": "^13.1.1", + "eslint": "^5.16.0", + "object-keys": "^1.1.1", + "safe-publish-latest": "^1.1.2", + "tap": "0.4.13", + "tape": "^4.11.0" + }, + "homepage": "https://github.com/browserify/resolve#readme", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "license": "MIT", + "main": "index.js", + "name": "resolve", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "scripts": { + "lint": "eslint .", + "posttest": "npm run test:multirepo", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", + "test": "npm run --silent tests-only", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test", + "tests-only": "tape test/*.js" + }, + "version": "1.12.0" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown b/tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown new file mode 100644 index 00000000000000..f1b27063901cb3 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown @@ -0,0 +1,201 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](https://nodejs.org/api/modules.html#modules_all_together) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/browserify/node-resolve.png)](http://travis-ci.org/browserify/node-resolve) + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +``` + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.isDirectory - function to asynchronously test whether a directory exists + +* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * pkgfile - path to package.json + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + isDirectory: function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* opts.isDirectory - function to synchronously test whether a directory exists + +* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + isDirectory: function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +```sh +npm install resolve +``` + +# license + +MIT diff --git a/tools/node_modules/babel-eslint/package.json b/tools/node_modules/babel-eslint/package.json index 296e9f51f410b1..fae7c72dbbf113 100644 --- a/tools/node_modules/babel-eslint/package.json +++ b/tools/node_modules/babel-eslint/package.json @@ -12,8 +12,8 @@ "@babel/parser": "^7.0.0", "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" }, "deprecated": false, "description": "Custom parser for ESLint", @@ -63,5 +63,5 @@ "test": "npm run lint && npm run test-only", "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js" }, - "version": "10.0.2" + "version": "10.0.3" } \ No newline at end of file From 3802da790b89f8f1328f4b4533bdefffaff2ef9b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 25 Aug 2019 23:54:42 -0400 Subject: [PATCH 49/84] tools: update ESLint to 6.2.2 Update ESLint to 6.2.2 PR-URL: https://github.com/nodejs/node/pull/29320 Reviewed-By: Rich Trott Reviewed-By: Daniel Bevenius Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat Reviewed-By: Roman Reiss --- tools/node_modules/eslint/README.md | 11 +- .../node_modules/eslint/conf/config-schema.js | 1 + .../node_modules/eslint/conf/environments.js | 87 ++++-- .../lib/cli-engine/config-array-factory.js | 2 + .../cli-engine/config-array/config-array.js | 7 + .../config-array/extracted-config.js | 17 +- .../node_modules/eslint/lib/init/npm-utils.js | 4 +- .../code-path-analysis/code-path-analyzer.js | 1 + .../node_modules/eslint/lib/linter/linter.js | 63 +++-- .../eslint/lib/rules/accessor-pairs.js | 230 +++++++++++++--- .../lib/rules/class-methods-use-this.js | 13 +- .../eslint/lib/rules/dot-notation.js | 8 +- .../eslint/lib/rules/func-call-spacing.js | 50 ++-- .../eslint/lib/rules/func-names.js | 4 + .../rules/function-call-argument-newline.js | 120 +++++++++ .../lib/rules/function-paren-newline.js | 56 ++-- tools/node_modules/eslint/lib/rules/indent.js | 15 +- tools/node_modules/eslint/lib/rules/index.js | 1 + .../node_modules/eslint/lib/rules/new-cap.js | 3 +- .../eslint/lib/rules/no-dupe-keys.js | 2 +- .../eslint/lib/rules/no-duplicate-case.js | 18 +- .../eslint/lib/rules/no-extra-bind.js | 1 + .../eslint/lib/rules/no-extra-boolean-cast.js | 49 +++- .../eslint/lib/rules/no-extra-parens.js | 76 ++++-- .../eslint/lib/rules/no-mixed-operators.js | 61 ++++- .../eslint/lib/rules/no-restricted-syntax.js | 4 +- .../eslint/lib/rules/no-unused-vars.js | 2 +- .../eslint/lib/rules/prefer-template.js | 11 +- .../eslint/lib/rules/sort-keys.js | 14 +- .../eslint/lib/rules/utils/ast-utils.js | 21 +- tools/node_modules/eslint/lib/rules/yoda.js | 2 +- tools/node_modules/eslint/lib/shared/types.js | 2 + .../node_modules/acorn-jsx/package.json | 6 +- .../eslint/node_modules/acorn/README.md | 5 +- .../eslint/node_modules/acorn/dist/acorn.js | 71 ++--- .../eslint/node_modules/acorn/dist/acorn.mjs | 71 ++--- .../eslint/node_modules/acorn/package.json | 2 +- .../cross-spawn/node_modules/semver/README.md | 23 +- .../node_modules/semver/package.json | 2 +- .../eslint/node_modules/eslint-utils/index.js | 132 ++++++++-- .../node_modules/eslint-utils/index.mjs | 132 ++++++++-- .../node_modules/eslint-utils/package.json | 2 +- .../eslint-visitor-keys/lib/visitor-keys.json | 3 + .../eslint-visitor-keys/package.json | 11 +- .../eslint/node_modules/espree/README.md | 2 +- .../eslint/node_modules/espree/espree.js | 2 +- .../eslint/node_modules/espree/lib/espree.js | 44 ++-- .../eslint/node_modules/espree/package.json | 28 +- .../eslint/node_modules/estraverse/README.md | 153 +++++++++++ .../node_modules/estraverse/estraverse.js | 83 +----- .../node_modules/estraverse/package.json | 8 +- .../eslint/node_modules/esutils/README.md | 17 +- .../eslint/node_modules/esutils/lib/code.js | 18 +- .../eslint/node_modules/esutils/package.json | 13 +- .../eslint/node_modules/extend/.jscs.json | 1 + .../node_modules/external-editor/README.md | 2 +- .../eslint/node_modules/inquirer/README.md | 8 +- .../eslint/node_modules/inquirer/package.json | 4 +- .../eslint/node_modules/is-glob/README.md | 14 +- .../eslint/node_modules/semver/README.md | 2 +- .../node_modules/semver/bin/.semver.js.swp | Bin 16384 -> 0 bytes .../eslint/node_modules/semver/package.json | 2 +- .../eslint/node_modules/semver/semver.js | 247 +++++++++--------- .../node_modules/table/dist/alignString.js | 10 +- .../table/dist/calculateCellHeight.js | 4 +- .../table/dist/calculateRowHeightIndex.js | 12 +- .../node_modules/table/dist/createStream.js | 24 +- .../table/dist/createStream.js.flow | 9 +- .../node_modules/table/dist/drawBorder.js | 8 +- .../table/dist/drawBorder.js.flow | 8 +- .../node_modules/table/dist/makeConfig.js | 16 +- .../table/dist/makeStreamConfig.js | 14 +- .../table/dist/mapDataUsingRowHeightIndex.js | 9 +- .../table/dist/truncateTableData.js | 4 +- .../eslint/node_modules/table/package.json | 3 +- .../eslint/node_modules/tmp/README.md | 6 +- .../eslint/node_modules/tmp/lib/tmp.js | 2 +- .../eslint/node_modules/tslib/README.md | 26 +- .../eslint/node_modules/tslib/tslib.es6.js | 72 ++--- .../eslint/node_modules/tslib/tslib.js | 124 ++++----- .../node_modules/v8-compile-cache/README.md | 2 +- .../v8-compile-cache/package.json | 2 +- .../v8-compile-cache/v8-compile-cache.js | 4 +- .../eslint/node_modules/xtend/README.md | 2 +- tools/node_modules/eslint/package.json | 10 +- 85 files changed, 1692 insertions(+), 743 deletions(-) create mode 100644 tools/node_modules/eslint/lib/rules/function-call-argument-newline.js create mode 100644 tools/node_modules/eslint/node_modules/estraverse/README.md delete mode 100644 tools/node_modules/eslint/node_modules/semver/bin/.semver.js.swp diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index 18d15249fe478c..7ed0416c33d403 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -59,8 +59,6 @@ After that, you can run ESLint on any file or directory like this: $ ./node_modules/.bin/eslint yourfile.js ``` -It is also possible to install ESLint globally rather than locally (using `npm install eslint --global`). However, any plugins or shareable configs that you use must be installed locally in either case. - ## Configuration After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this: @@ -246,6 +244,11 @@ The people who review and fix bugs and help triage issues.
Pig Fang + + +
+Milos Djermanovic +
@@ -258,9 +261,9 @@ The following companies, organizations, and individuals support ESLint's ongoing

Gold Sponsors

-

Shopify Salesforce Badoo Airbnb Facebook Open Source

Silver Sponsors

+

Shopify Salesforce Badoo Airbnb Facebook Open Source

Silver Sponsors

AMP Project

Bronze Sponsors

-

clay Discord ThemeIsle TekHattan Marfeel Fire Stick Tricks JSHeroes Faithlife

+

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

## Technology Sponsors diff --git a/tools/node_modules/eslint/conf/config-schema.js b/tools/node_modules/eslint/conf/config-schema.js index 36f3c27de6007e..d89bf0f58c5ffb 100644 --- a/tools/node_modules/eslint/conf/config-schema.js +++ b/tools/node_modules/eslint/conf/config-schema.js @@ -20,6 +20,7 @@ const baseConfigProperties = { processor: { type: "string" }, rules: { type: "object" }, settings: { type: "object" }, + noInlineConfig: { type: "boolean" }, ecmaFeatures: { type: "object" } // deprecated; logs a warning when used }; diff --git a/tools/node_modules/eslint/conf/environments.js b/tools/node_modules/eslint/conf/environments.js index f77340cea27c75..10e6fdaa70fca5 100644 --- a/tools/node_modules/eslint/conf/environments.js +++ b/tools/node_modules/eslint/conf/environments.js @@ -10,15 +10,76 @@ const globals = require("globals"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has differentce. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false +}; + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ /** @type {Map} */ module.exports = new Map(Object.entries({ + + // Language builtin: { globals: globals.es5 }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + + // Platforms browser: { globals: globals.browser }, @@ -30,6 +91,17 @@ module.exports = new Map(Object.entries({ } } }, + "shared-node-browser": { + globals: globals["shared-node-browser"] + }, + worker: { + globals: globals.worker + }, + serviceworker: { + globals: globals.serviceworker + }, + + // Frameworks commonjs: { globals: globals.commonjs, parserOptions: { @@ -38,12 +110,6 @@ module.exports = new Map(Object.entries({ } } }, - "shared-node-browser": { - globals: globals["shared-node-browser"] - }, - worker: { - globals: globals.worker - }, amd: { globals: globals.amd }, @@ -86,9 +152,6 @@ module.exports = new Map(Object.entries({ nashorn: { globals: globals.nashorn }, - serviceworker: { - globals: globals.serviceworker - }, atomtest: { globals: globals.atomtest }, @@ -98,12 +161,6 @@ module.exports = new Map(Object.entries({ webextensions: { globals: globals.webextensions }, - es6: { - globals: globals.es2015, - parserOptions: { - ecmaVersion: 6 - } - }, greasemonkey: { globals: globals.greasemonkey } 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 95430c358df754..0b2ed07b6a04a9 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 @@ -526,6 +526,7 @@ class ConfigArrayFactory { env, extends: extend, globals, + noInlineConfig, parser: parserName, parserOptions, plugins: pluginList, @@ -567,6 +568,7 @@ class ConfigArrayFactory { criteria: null, env, globals, + noInlineConfig, parser, parserOptions, plugins, 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 5c7aaa334000ca..0859868d824568 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 @@ -54,6 +54,7 @@ const { ExtractedConfig } = require("./extracted-config"); * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. * @property {Record|undefined} env The environment settings. * @property {Record|undefined} globals The global variable settings. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. * @property {DependentParser|undefined} parser The parser loader. * @property {Object|undefined} parserOptions The parser options. * @property {Record|undefined} plugins The plugin loaders. @@ -250,6 +251,12 @@ function createConfig(instance, indices) { config.processor = element.processor; } + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + // Merge others. mergeWithoutOverwrite(config.env, element.env); mergeWithoutOverwrite(config.globals, element.globals); diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js b/tools/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js index 377cc0fa91589c..53208c16e46e72 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js @@ -29,6 +29,12 @@ class ExtractedConfig { constructor() { + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + /** * Environments. * @type {Record} @@ -41,6 +47,12 @@ class ExtractedConfig { */ this.globals = {}; + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + /** * Parser definition. * @type {DependentParser|null} @@ -84,7 +96,10 @@ class ExtractedConfig { */ toCompatibleObjectAsConfigFileContent() { const { - processor: _ignore, // eslint-disable-line no-unused-vars + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ ...config } = this; diff --git a/tools/node_modules/eslint/lib/init/npm-utils.js b/tools/node_modules/eslint/lib/init/npm-utils.js index 26e78406fdcdc6..3a680aae924950 100644 --- a/tools/node_modules/eslint/lib/init/npm-utils.js +++ b/tools/node_modules/eslint/lib/init/npm-utils.js @@ -135,7 +135,7 @@ function check(packages, opt) { * Check whether node modules are included in the dependencies of a project's * package.json. * - * Convienience wrapper around check(). + * Convenience wrapper around check(). * * @param {string[]} packages Array of node modules to check. * @param {string} rootDir The directory contianing a package.json @@ -150,7 +150,7 @@ function checkDeps(packages, rootDir) { * Check whether node modules are included in the devDependencies of a project's * package.json. * - * Convienience wrapper around check(). + * Convenience wrapper around check(). * * @param {string[]} packages Array of node modules to check. * @returns {Object} An object whose keys are the module names 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 c1f4a600451846..821477aef9933c 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 @@ -526,6 +526,7 @@ function processCodePathToExit(analyzer, node) { break; case "CallExpression": + case "ImportExpression": case "MemberExpression": case "NewExpression": state.makeFirstThrowablePathInTryBlock(); diff --git a/tools/node_modules/eslint/lib/linter/linter.js b/tools/node_modules/eslint/lib/linter/linter.js index a49d850859b392..d367cef6cb41da 100644 --- a/tools/node_modules/eslint/lib/linter/linter.js +++ b/tools/node_modules/eslint/lib/linter/linter.js @@ -198,14 +198,20 @@ function createMissingRuleMessage(ruleId) { /** * creates a linting problem * @param {Object} options to create linting error - * @param {string} options.ruleId the ruleId to report - * @param {Object} options.loc the loc to report - * @param {string} options.message the error message to report - * @returns {Problem} created problem, returns a missing-rule problem if only provided ruleId. + * @param {string} [options.ruleId] the ruleId to report + * @param {Object} [options.loc] the loc to report + * @param {string} [options.message] the error message to report + * @param {string} [options.severity] the error message to report + * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. * @private */ function createLintingProblem(options) { - const { ruleId, loc = DEFAULT_ERROR_LOC, message = createMissingRuleMessage(options.ruleId) } = options; + const { + ruleId = null, + loc = DEFAULT_ERROR_LOC, + message = createMissingRuleMessage(options.ruleId), + severity = 2 + } = options; return { ruleId, @@ -214,7 +220,7 @@ function createLintingProblem(options) { column: loc.start.column + 1, endLine: loc.end.line, endColumn: loc.end.column + 1, - severity: 2, + severity, nodeType: null }; } @@ -257,10 +263,11 @@ function createDisableDirectives(options) { * @param {string} filename The file being checked. * @param {ASTNode} ast The top node of the AST. * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}} * A collection of the directive comments that were found, along with any problems that occurred when parsing */ -function getDirectiveComments(filename, ast, ruleMapper) { +function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { const configuredRules = {}; const enabledGlobals = Object.create(null); const exportedVariables = {}; @@ -269,16 +276,29 @@ function getDirectiveComments(filename, ast, ruleMapper) { ast.comments.filter(token => token.type !== "Shebang").forEach(comment => { const trimmedCommentText = comment.value.trim(); - const match = /^(eslint(-\w+){0,3}|exported|globals?)(\s|$)/u.exec(trimmedCommentText); + const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText); if (!match) { return; } + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(match[1]); + + if (warnInlineConfig && (lineCommentSupported || comment.type === "Block")) { + const kind = comment.type === "Block" ? `/*${match[1]}*/` : `//${match[1]}`; + + problems.push(createLintingProblem({ + ruleId: null, + message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`, + loc: comment.loc, + severity: 1 + })); + return; + } const directiveValue = trimmedCommentText.slice(match.index + match[1].length); let directiveType = ""; - if (/^eslint-disable-(next-)?line$/u.test(match[1])) { + if (lineCommentSupported) { if (comment.loc.start.line === comment.loc.end.line) { directiveType = match[1].slice("eslint-".length); } else { @@ -441,16 +461,27 @@ function normalizeFilename(filename) { return index === -1 ? filename : parts.slice(index).join(path.sep); } +// eslint-disable-next-line valid-jsdoc /** * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a * consistent shape. * @param {VerifyOptions} providedOptions Options - * @returns {Required} Normalized options + * @param {ConfigData} config Config. + * @returns {Required & { warnInlineConfig: string|null }} Normalized options */ -function normalizeVerifyOptions(providedOptions) { +function normalizeVerifyOptions(providedOptions, config) { + const disableInlineConfig = config.noInlineConfig === true; + const ignoreInlineConfig = providedOptions.allowInlineConfig === false; + const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig + ? ` (${config.configNameOfNoInlineConfig})` + : ""; + return { filename: normalizeFilename(providedOptions.filename || ""), - allowInlineConfig: providedOptions.allowInlineConfig !== false, + allowInlineConfig: !ignoreInlineConfig, + warnInlineConfig: disableInlineConfig && !ignoreInlineConfig + ? `your config${configNameOfNoInlineConfig}` + : null, reportUnusedDisableDirectives: Boolean(providedOptions.reportUnusedDisableDirectives), disableFixes: Boolean(providedOptions.disableFixes) }; @@ -984,7 +1015,7 @@ class Linter { _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { const slots = internalSlotsMap.get(this); const config = providedConfig || {}; - const options = normalizeVerifyOptions(providedOptions); + const options = normalizeVerifyOptions(providedOptions, config); let text; // evaluate arguments @@ -1019,7 +1050,9 @@ class Linter { } // search and apply "eslint-env *". - const envInFile = findEslintEnv(text); + const envInFile = options.allowInlineConfig && !options.warnInlineConfig + ? findEslintEnv(text) + : {}; const resolvedEnvConfig = Object.assign({ builtin: true }, config.env, envInFile); const enabledEnvs = Object.keys(resolvedEnvConfig) .filter(envName => resolvedEnvConfig[envName]) @@ -1062,7 +1095,7 @@ class Linter { const sourceCode = slots.lastSourceCode; const commentDirectives = options.allowInlineConfig - ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId)) + ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; // augment global scope with declared global variables diff --git a/tools/node_modules/eslint/lib/rules/accessor-pairs.js b/tools/node_modules/eslint/lib/rules/accessor-pairs.js index aca231848633ad..9c78bdc70e015c 100644 --- a/tools/node_modules/eslint/lib/rules/accessor-pairs.js +++ b/tools/node_modules/eslint/lib/rules/accessor-pairs.js @@ -5,10 +5,87 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + /** * Checks whether or not a given node is an `Identifier` node which was named a given name. * @param {ASTNode} node - A node to check. @@ -97,69 +174,152 @@ module.exports = { }], messages: { - getter: "Getter is not present.", - setter: "Setter is not present." + missingGetterInPropertyDescriptor: "Getter is not present in property descriptor.", + missingSetterInPropertyDescriptor: "Setter is not present in property descriptor.", + missingGetterInObjectLiteral: "Getter is not present for {{ name }}.", + missingSetterInObjectLiteral: "Setter is not present for {{ name }}." } }, create(context) { const config = context.options[0] || {}; const checkGetWithoutSet = config.getWithoutSet === true; const checkSetWithoutGet = config.setWithoutGet !== false; + const sourceCode = context.getSourceCode(); /** - * Checks a object expression to see if it has setter and getter both present or none. - * @param {ASTNode} node The node to check. + * Reports the given node. + * @param {ASTNode} node The node to report. + * @param {string} messageKind "missingGetter" or "missingSetter". * @returns {void} * @private */ - function checkLonelySetGet(node) { - let isSetPresent = false; - let isGetPresent = false; - const isDescriptor = isPropertyDescriptor(node); + function report(node, messageKind) { + if (node.type === "Property") { + context.report({ + node, + messageId: `${messageKind}InObjectLiteral`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else { + context.report({ + node, + messageId: `${messageKind}InPropertyDescriptor` + }); + } + } - for (let i = 0, end = node.properties.length; i < end; i++) { - const property = node.properties[i]; + /** + * Reports each of the nodes in the given list using the same messageId. + * @param {ASTNode[]} nodes Nodes to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function reportList(nodes, messageKind) { + for (const node of nodes) { + report(node, messageKind); + } + } - let propToCheck = ""; + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); - if (property.kind === "init") { - if (isDescriptor && !property.computed) { - propToCheck = property.key.name; - } - } else { - propToCheck = property.kind; - } + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } - switch (propToCheck) { - case "set": - isSetPresent = true; - break; + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); - case "get": - isGetPresent = true; - break; + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } - default: + return accessors; + } - // Do nothing - } + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @returns {void} + * @private + */ + function checkList(nodes) { + const accessors = nodes + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); - if (isSetPresent && isGetPresent) { - break; + for (const { getters, setters } of accessors) { + if (checkSetWithoutGet && setters.length && !getters.length) { + reportList(setters, "missingGetter"); + } + if (checkGetWithoutSet && getters.length && !setters.length) { + reportList(getters, "missingSetter"); } } + } - if (checkSetWithoutGet && isSetPresent && !isGetPresent) { - context.report({ node, messageId: "getter" }); - } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) { - context.report({ node, messageId: "setter" }); + /** + * Checks accessor pairs in an object literal. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectLiteral(node) { + checkList(node.properties.filter(p => p.type === "Property")); + } + + /** + * Checks accessor pairs in a property descriptor. + * @param {ASTNode} node Property descriptor `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkPropertyDescriptor(node) { + const namesToCheck = node.properties + .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) + .map(({ key }) => key.name); + + const hasGetter = namesToCheck.includes("get"); + const hasSetter = namesToCheck.includes("set"); + + if (checkSetWithoutGet && hasSetter && !hasGetter) { + report(node, "missingGetter"); + } + if (checkGetWithoutSet && hasGetter && !hasSetter) { + report(node, "missingSetter"); } } return { ObjectExpression(node) { if (checkSetWithoutGet || checkGetWithoutSet) { - checkLonelySetGet(node); + checkObjectLiteral(node); + if (isPropertyDescriptor(node)) { + checkPropertyDescriptor(node); + } } } }; 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 0eb1da87f4c227..4bf17090abcb87 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 @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -34,7 +40,7 @@ module.exports = { }], messages: { - missingThis: "Expected 'this' to be used by class method '{{name}}'." + missingThis: "Expected 'this' to be used by class {{name}}." } }, create(context) { @@ -70,7 +76,8 @@ module.exports = { * @private */ function isIncludedInstanceMethod(node) { - return isInstanceMethod(node) && !exceptMethods.has(node.key.name); + return isInstanceMethod(node) && + (node.computed || !exceptMethods.has(node.key.name)); } /** @@ -89,7 +96,7 @@ module.exports = { node, messageId: "missingThis", data: { - name: node.parent.key.name + name: astUtils.getFunctionNameWithKind(node) } }); } diff --git a/tools/node_modules/eslint/lib/rules/dot-notation.js b/tools/node_modules/eslint/lib/rules/dot-notation.js index 61184ddcd1a14c..2e8fff8b90e77d 100644 --- a/tools/node_modules/eslint/lib/rules/dot-notation.js +++ b/tools/node_modules/eslint/lib/rules/dot-notation.js @@ -9,13 +9,16 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; -const keywords = require("./utils/keywords"); + +// `null` literal must be handled separately. +const literalTypesToCheck = new Set(["string", "boolean"]); module.exports = { meta: { @@ -115,7 +118,8 @@ module.exports = { MemberExpression(node) { if ( node.computed && - node.property.type === "Literal" + node.property.type === "Literal" && + (literalTypesToCheck.has(typeof node.property.value) || astUtils.isNullLiteral(node.property)) ) { checkComputedProperty(node, node.property.value); } diff --git a/tools/node_modules/eslint/lib/rules/func-call-spacing.js b/tools/node_modules/eslint/lib/rules/func-call-spacing.js index f9c8e780577a6b..e2edd4282da578 100644 --- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js @@ -78,21 +78,13 @@ module.exports = { /** * Check if open space is present in a function name * @param {ASTNode} node node to evaluate + * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee. + * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments. * @returns {void} * @private */ - function checkSpacing(node) { - const lastToken = sourceCode.getLastToken(node); - const lastCalleeToken = sourceCode.getLastToken(node.callee); - const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); - const prevToken = parenToken && sourceCode.getTokenBefore(parenToken); - - // Parens in NewExpression are optional - if (!(parenToken && parenToken.range[1] < node.range[1])) { - return; - } - - const textBetweenTokens = text.slice(prevToken.range[1], parenToken.range[0]).replace(/\/\*.*?\*\//gu, ""); + function checkSpacing(node, leftToken, rightToken) { + const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, ""); const hasWhitespace = /\s/u.test(textBetweenTokens); const hasNewline = hasWhitespace && astUtils.LINEBREAK_MATCHER.test(textBetweenTokens); @@ -123,7 +115,7 @@ module.exports = { if (never && hasWhitespace) { context.report({ node, - loc: lastCalleeToken.loc.start, + loc: leftToken.loc.start, messageId: "unexpected", fix(fixer) { @@ -132,7 +124,7 @@ module.exports = { * https://github.com/eslint/eslint/issues/7787 */ if (!hasNewline) { - return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); } return null; @@ -141,27 +133,45 @@ module.exports = { } else if (!never && !hasWhitespace) { context.report({ node, - loc: lastCalleeToken.loc.start, + loc: leftToken.loc.start, messageId: "missing", fix(fixer) { - return fixer.insertTextBefore(parenToken, " "); + return fixer.insertTextBefore(rightToken, " "); } }); } else if (!never && !allowNewlines && hasNewline) { context.report({ node, - loc: lastCalleeToken.loc.start, + loc: leftToken.loc.start, messageId: "unexpected", fix(fixer) { - return fixer.replaceTextRange([prevToken.range[1], parenToken.range[0]], " "); + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " "); } }); } } return { - CallExpression: checkSpacing, - NewExpression: checkSpacing + "CallExpression, NewExpression"(node) { + const lastToken = sourceCode.getLastToken(node); + const lastCalleeToken = sourceCode.getLastToken(node.callee); + const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); + const prevToken = parenToken && sourceCode.getTokenBefore(parenToken); + + // Parens in NewExpression are optional + if (!(parenToken && parenToken.range[1] < node.range[1])) { + return; + } + + checkSpacing(node, prevToken, parenToken); + }, + + ImportExpression(node) { + const leftToken = sourceCode.getFirstToken(node); + const rightToken = sourceCode.getTokenAfter(leftToken); + + checkSpacing(node, leftToken, rightToken); + } }; } diff --git a/tools/node_modules/eslint/lib/rules/func-names.js b/tools/node_modules/eslint/lib/rules/func-names.js index 01beb9e2ed3f42..ff3a1f4b5bf890 100644 --- a/tools/node_modules/eslint/lib/rules/func-names.js +++ b/tools/node_modules/eslint/lib/rules/func-names.js @@ -69,6 +69,8 @@ module.exports = { create(context) { + const sourceCode = context.getSourceCode(); + /** * Returns the config option for the given node. * @param {ASTNode} node - A node to get the config for. @@ -130,6 +132,7 @@ module.exports = { context.report({ node, messageId: "unnamed", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), data: { name: astUtils.getFunctionNameWithKind(node) } }); } @@ -143,6 +146,7 @@ module.exports = { context.report({ node, messageId: "named", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), data: { name: astUtils.getFunctionNameWithKind(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 new file mode 100644 index 00000000000000..8bf31f7c713d5d --- /dev/null +++ b/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to enforce line breaks between arguments of a function call + * @author Alexey Gonchar + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks between arguments of a function call", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-call-argument-newline" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "consistent"] + } + ], + + messages: { + unexpectedLineBreak: "There should be no line break here.", + missingLineBreak: "There should be a line break after this argument." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const checkers = { + unexpected: { + messageId: "unexpectedLineBreak", + check: (prevToken, currentToken) => prevToken.loc.start.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, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") + } + }; + + /** + * Check all arguments for line breaks in the CallExpression + * @param {CallExpression} node node to evaluate + * @param {{ messageId: string, check: Function }} checker selected checker + * @returns {void} + * @private + */ + function checkArguments(node, checker) { + for (let i = 1; i < node.arguments.length; i++) { + const prevArgToken = sourceCode.getFirstToken(node.arguments[i - 1]); + const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); + + if (checker.check(prevArgToken, currentArgToken)) { + const tokenBefore = sourceCode.getTokenBefore( + currentArgToken, + { includeComments: true } + ); + + context.report({ + node, + loc: { + start: tokenBefore.loc.end, + end: currentArgToken.loc.start + }, + messageId: checker.messageId, + fix: checker.createFix(currentArgToken, tokenBefore) + }); + } + } + } + + /** + * Check if open space is present in a function name + * @param {CallExpression} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if (node.arguments.length < 2) { + return; + } + + const option = context.options[0] || "always"; + + if (option === "never") { + checkArguments(node, checkers.unexpected); + } else if (option === "always") { + checkArguments(node, checkers.missing); + } else if (option === "consistent") { + const firstArgToken = sourceCode.getFirstToken(node.arguments[0]); + const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); + + if (firstArgToken.loc.start.line === secondArgToken.loc.start.line) { + checkArguments(node, checkers.unexpected); + } else { + checkArguments(node, checkers.missing); + } + } + } + + return { + CallExpression: check, + NewExpression: check + }; + } +}; diff --git a/tools/node_modules/eslint/lib/rules/function-paren-newline.js b/tools/node_modules/eslint/lib/rules/function-paren-newline.js index 0a0b57a372a354..c9f09fdefa71cf 100644 --- a/tools/node_modules/eslint/lib/rules/function-paren-newline.js +++ b/tools/node_modules/eslint/lib/rules/function-paren-newline.js @@ -232,25 +232,15 @@ module.exports = { }; } - default: - throw new TypeError(`unexpected node with type ${node.type}`); - } - } - - /** - * Validates the parentheses for a node - * @param {ASTNode} node The node with parens - * @returns {void} - */ - function validateNode(node) { - const parens = getParenTokens(node); - - if (parens) { - validateParens(parens, astUtils.isFunction(node) ? node.params : node.arguments); + case "ImportExpression": { + const leftParen = sourceCode.getFirstToken(node, 1); + const rightParen = sourceCode.getLastToken(node); - if (multilineArgumentsOption) { - validateArguments(parens, astUtils.isFunction(node) ? node.params : node.arguments); + return { leftParen, rightParen }; } + + default: + throw new TypeError(`unexpected node with type ${node.type}`); } } @@ -259,11 +249,33 @@ module.exports = { //---------------------------------------------------------------------- return { - ArrowFunctionExpression: validateNode, - CallExpression: validateNode, - FunctionDeclaration: validateNode, - FunctionExpression: validateNode, - NewExpression: validateNode + [[ + "ArrowFunctionExpression", + "CallExpression", + "FunctionDeclaration", + "FunctionExpression", + "ImportExpression", + "NewExpression" + ]](node) { + const parens = getParenTokens(node); + let params; + + if (node.type === "ImportExpression") { + params = [node.source]; + } else if (astUtils.isFunction(node)) { + params = node.params; + } else { + params = node.arguments; + } + + if (parens) { + validateParens(parens, params); + + if (multilineArgumentsOption) { + validateArguments(parens, params); + } + } + } }; } }; diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js index 345c69e81c1e3b..79b1063137e0cd 100644 --- a/tools/node_modules/eslint/lib/rules/indent.js +++ b/tools/node_modules/eslint/lib/rules/indent.js @@ -99,7 +99,8 @@ const KNOWN_NODES = new Set([ "ImportDeclaration", "ImportSpecifier", "ImportDefaultSpecifier", - "ImportNamespaceSpecifier" + "ImportNamespaceSpecifier", + "ImportExpression" ]); /* @@ -1109,7 +1110,6 @@ module.exports = { CallExpression: addFunctionCallIndent, - "ClassDeclaration[superClass], ClassExpression[superClass]"(node) { const classToken = sourceCode.getFirstToken(node); const extendsToken = sourceCode.getTokenBefore(node.superClass, astUtils.isNotOpeningParenToken); @@ -1236,6 +1236,17 @@ module.exports = { } }, + ImportExpression(node) { + const openingParen = sourceCode.getFirstToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + + addElementListIndent([node.source], openingParen, closingParen, options.CallExpression.arguments); + }, + "MemberExpression, JSXMemberExpression, MetaProperty"(node) { const object = node.type === "MetaProperty" ? node.meta : node.object; const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, astUtils.isNotClosingParenToken); diff --git a/tools/node_modules/eslint/lib/rules/index.js b/tools/node_modules/eslint/lib/rules/index.js index 45045904bb4787..c42ae41d6cbaf4 100644 --- a/tools/node_modules/eslint/lib/rules/index.js +++ b/tools/node_modules/eslint/lib/rules/index.js @@ -46,6 +46,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ "func-name-matching": () => require("./func-name-matching"), "func-names": () => require("./func-names"), "func-style": () => require("./func-style"), + "function-call-argument-newline": () => require("./function-call-argument-newline"), "function-paren-newline": () => require("./function-paren-newline"), "generator-star-spacing": () => require("./generator-star-spacing"), "getter-return": () => require("./getter-return"), diff --git a/tools/node_modules/eslint/lib/rules/new-cap.js b/tools/node_modules/eslint/lib/rules/new-cap.js index dcae238d9b9efd..cee979310ea7cc 100644 --- a/tools/node_modules/eslint/lib/rules/new-cap.js +++ b/tools/node_modules/eslint/lib/rules/new-cap.js @@ -23,7 +23,8 @@ const CAPS_ALLOWED = [ "Object", "RegExp", "String", - "Symbol" + "Symbol", + "BigInt" ]; /** 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 d0751b4a2da226..1b7f69cfaca655 100644 --- a/tools/node_modules/eslint/lib/rules/no-dupe-keys.js +++ b/tools/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -120,7 +120,7 @@ module.exports = { } // Skip if the name is not static. - if (!name) { + if (name === null) { return; } diff --git a/tools/node_modules/eslint/lib/rules/no-duplicate-case.js b/tools/node_modules/eslint/lib/rules/no-duplicate-case.js index 93c8548f91ad75..c8a0fa9da3c025 100644 --- a/tools/node_modules/eslint/lib/rules/no-duplicate-case.js +++ b/tools/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -33,17 +33,19 @@ module.exports = { return { SwitchStatement(node) { - const mapping = {}; + const previousKeys = new Set(); - node.cases.forEach(switchCase => { - const key = sourceCode.getText(switchCase.test); + for (const switchCase of node.cases) { + if (switchCase.test) { + const key = sourceCode.getText(switchCase.test); - if (mapping[key]) { - context.report({ node: switchCase, messageId: "unexpected" }); - } else { - mapping[key] = switchCase; + if (previousKeys.has(key)) { + context.report({ node: switchCase, messageId: "unexpected" }); + } else { + previousKeys.add(key); + } } - }); + } } }; } 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 5380cf217f4f15..cc0b1f84372049 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-bind.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-bind.js @@ -98,6 +98,7 @@ module.exports = { grandparent.type === "CallExpression" && grandparent.callee === parent && grandparent.arguments.length === 1 && + grandparent.arguments[0].type !== "SpreadElement" && parent.type === "MemberExpression" && parent.object === node && astUtils.getStaticPropertyName(parent) === "bind" 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 8dd526477d4bd1..9ae9b5be61fd05 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 @@ -50,8 +50,8 @@ module.exports = { /** * Check if a node is in a context where its value would be coerced to a boolean at runtime. * - * @param {Object} node The node - * @param {Object} parent Its parent + * @param {ASTNode} node The node + * @param {ASTNode} parent Its parent * @returns {boolean} If it is in a boolean context */ function isInBooleanContext(node, parent) { @@ -65,6 +65,15 @@ module.exports = { ); } + /** + * Check if a node has comments inside. + * + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if it has comments inside. + */ + function hasCommentsInside(node) { + return Boolean(sourceCode.getCommentsInside(node).length); + } return { UnaryExpression(node) { @@ -89,7 +98,12 @@ module.exports = { context.report({ node, messageId: "unexpectedNegation", - fix: fixer => fixer.replaceText(parent, sourceCode.getText(node.argument)) + fix: fixer => { + if (hasCommentsInside(parent)) { + return null; + } + return fixer.replaceText(parent, sourceCode.getText(node.argument)); + } }); } }, @@ -106,10 +120,35 @@ module.exports = { messageId: "unexpectedCall", fix: fixer => { if (!node.arguments.length) { - return fixer.replaceText(parent, "true"); + if (parent.type === "UnaryExpression" && parent.operator === "!") { + + // !Boolean() -> true + + if (hasCommentsInside(parent)) { + return null; + } + + const replacement = "true"; + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + + if (tokenBefore && tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement)) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + replacement); + } + + // Boolean() -> false + if (hasCommentsInside(node)) { + return null; + } + return fixer.replaceText(node, "false"); } - if (node.arguments.length > 1 || node.arguments[0].type === "SpreadElement") { + if (node.arguments.length > 1 || node.arguments[0].type === "SpreadElement" || + hasCommentsInside(node)) { return null; } 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 6c3198b5f02bd1..aa455c6a2543c7 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-parens.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-parens.js @@ -8,6 +8,7 @@ // Rule Definition //------------------------------------------------------------------------------ +const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); const astUtils = require("./utils/ast-utils.js"); module.exports = { @@ -68,7 +69,6 @@ module.exports = { const sourceCode = context.getSourceCode(); const tokensToIgnore = new WeakSet(); - const isParenthesised = astUtils.isParenthesised.bind(astUtils, sourceCode); const precedence = astUtils.getPrecedence; const ALL_NODES = context.options[0] !== "functions"; const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; @@ -118,6 +118,16 @@ module.exports = { return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; } + /** + * Determines if a node is surrounded by parentheses. + * @param {ASTNode} node - The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ + function isParenthesised(node) { + return isParenthesizedRaw(1, node, sourceCode); + } + /** * Determines if a node is surrounded by parentheses twice. * @param {ASTNode} node - The node to be checked. @@ -125,12 +135,7 @@ module.exports = { * @private */ function isParenthesisedTwice(node) { - const previousToken = sourceCode.getTokenBefore(node, 1), - nextToken = sourceCode.getTokenAfter(node, 1); - - return isParenthesised(node) && previousToken && nextToken && - astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && - astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + return isParenthesizedRaw(2, node, sourceCode); } /** @@ -406,15 +411,9 @@ module.exports = { report(node.callee); } } - if (node.arguments.length === 1) { - if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) { - report(node.arguments[0]); - } - } else { - node.arguments - .filter(arg => hasExcessParens(arg) && precedence(arg) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) - .forEach(report); - } + node.arguments + .filter(arg => hasExcessParens(arg) && precedence(arg) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) + .forEach(report); } /** @@ -686,6 +685,13 @@ module.exports = { CallExpression: checkCallNew, + ClassBody(node) { + node.body + .filter(member => member.type === "MethodDefinition" && member.computed && + member.key && hasExcessParens(member.key) && precedence(member.key) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) + .forEach(member => report(member.key)); + }, + ConditionalExpression(node) { if (isReturnAssignException(node)) { return; @@ -705,7 +711,7 @@ module.exports = { }, DoWhileStatement(node) { - if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, @@ -830,11 +836,23 @@ module.exports = { }, IfStatement(node) { - if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, + ImportExpression(node) { + const { source } = node; + + if (source.type === "SequenceExpression") { + if (hasDoubleExcessParens(source)) { + report(source); + } + } else if (hasExcessParens(source)) { + report(source); + } + }, + LogicalExpression: checkBinaryLogical, MemberExpression(node) { @@ -917,7 +935,7 @@ module.exports = { }, SwitchStatement(node) { - if (hasDoubleExcessParens(node.discriminant)) { + if (hasExcessParens(node.discriminant)) { report(node.discriminant); } }, @@ -945,13 +963,13 @@ module.exports = { }, WhileStatement(node) { - if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, WithStatement(node) { - if (hasDoubleExcessParens(node.object)) { + if (hasExcessParens(node.object)) { report(node.object); } }, @@ -973,7 +991,21 @@ module.exports = { SpreadElement: checkSpreadOperator, SpreadProperty: checkSpreadOperator, - ExperimentalSpreadProperty: checkSpreadOperator + ExperimentalSpreadProperty: checkSpreadOperator, + + TemplateLiteral(node) { + node.expressions + .filter(e => e && hasExcessParens(e)) + .forEach(report); + }, + + AssignmentPattern(node) { + const { right } = node; + + if (right && hasExcessParens(right) && precedence(right) >= PRECEDENCE_OF_ASSIGNMENT_EXPR) { + report(right); + } + } }; } 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 21e1d95c684552..8d1c7a6af43975 100644 --- a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js +++ b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -20,12 +20,14 @@ const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; const LOGICAL_OPERATORS = ["&&", "||"]; const RELATIONAL_OPERATORS = ["in", "instanceof"]; +const TERNARY_OPERATOR = ["?:"]; const ALL_OPERATORS = [].concat( ARITHMETIC_OPERATORS, BITWISE_OPERATORS, COMPARISON_OPERATORS, LOGICAL_OPERATORS, - RELATIONAL_OPERATORS + RELATIONAL_OPERATORS, + TERNARY_OPERATOR ); const DEFAULT_GROUPS = [ ARITHMETIC_OPERATORS, @@ -34,7 +36,7 @@ const DEFAULT_GROUPS = [ LOGICAL_OPERATORS, RELATIONAL_OPERATORS ]; -const TARGET_NODE_TYPE = /^(?:Binary|Logical)Expression$/u; +const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; /** * Normalizes options. @@ -65,6 +67,18 @@ function includesBothInAGroup(groups, left, right) { return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); } +/** + * 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. + * This parent node can be BinaryExpression, LogicalExpression + * , or a ConditionalExpression node + * @returns {ASTNode} node the appropriate node(left or test). + */ +function getChildNode(node) { + return node.type === "ConditionalExpression" ? node.test : node.left; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -121,7 +135,7 @@ module.exports = { const b = node.parent; return ( - !includesBothInAGroup(options.groups, a.operator, b.operator) || + !includesBothInAGroup(options.groups, a.operator, b.type === "ConditionalExpression" ? "?:" : b.operator) || ( options.allowSamePrecedence && astUtils.getPrecedence(a) === astUtils.getPrecedence(b) @@ -139,12 +153,25 @@ module.exports = { * @returns {boolean} `true` if the node was mixed. */ function isMixedWithParent(node) { + return ( node.operator !== node.parent.operator && !astUtils.isParenthesised(sourceCode, node) ); } + /** + * 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 + * expression node + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithConditionalParent(node) { + return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test); + } + /** * Gets the operator token of a given node. * @@ -153,7 +180,7 @@ module.exports = { * @returns {Token} The operator token of the node. */ function getOperatorToken(node) { - return sourceCode.getTokenAfter(node.left, astUtils.isNotClosingParenToken); + return sourceCode.getTokenAfter(getChildNode(node), astUtils.isNotClosingParenToken); } /** @@ -167,13 +194,13 @@ module.exports = { */ function reportBothOperators(node) { const parent = node.parent; - const left = (parent.left === node) ? node : parent; - const right = (parent.left !== node) ? node : parent; + const left = (getChildNode(parent) === node) ? node : parent; + const right = (getChildNode(parent) !== node) ? node : parent; const message = "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'."; const data = { - leftOperator: left.operator, - rightOperator: right.operator + leftOperator: left.operator || "?:", + rightOperator: right.operator || "?:" }; context.report({ @@ -198,17 +225,25 @@ module.exports = { * @returns {void} */ function check(node) { - if (TARGET_NODE_TYPE.test(node.parent.type) && - isMixedWithParent(node) && - !shouldIgnore(node) - ) { - reportBothOperators(node); + if (TARGET_NODE_TYPE.test(node.parent.type)) { + if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) { + reportBothOperators(node); + } else { + if (TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); + } + } } + } return { BinaryExpression: check, LogicalExpression: check + }; } }; diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js b/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js index 74eea1478911aa..41aa9fa390a88d 100644 --- a/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js +++ b/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -21,7 +21,7 @@ module.exports = { schema: { type: "array", - items: [{ + items: { oneOf: [ { type: "string" @@ -36,7 +36,7 @@ module.exports = { additionalProperties: false } ] - }], + }, uniqueItems: true, minItems: 0 } 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 48df3aa3cc1b18..8094de57c731fb 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js @@ -507,7 +507,7 @@ module.exports = { const childScopes = scope.childScopes; let i, l; - if (scope.type !== "TDZ" && (scope.type !== "global" || config.vars === "all")) { + if (scope.type !== "global" || config.vars === "all") { for (i = 0, l = variables.length; i < l; ++i) { const variable = variables[i]; diff --git a/tools/node_modules/eslint/lib/rules/prefer-template.js b/tools/node_modules/eslint/lib/rules/prefer-template.js index f73ac34f837034..a2507d452c68eb 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-template.js +++ b/tools/node_modules/eslint/lib/rules/prefer-template.js @@ -52,16 +52,7 @@ function isOctalEscapeSequence(node) { return false; } - const match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-7]{1,3})/u); - - if (match) { - - // \0 is actually not considered an octal - if (match[2] !== "0" || typeof match[3] !== "undefined") { - return true; - } - } - return false; + return astUtils.hasOctalEscapeSequence(node.raw); } /** diff --git a/tools/node_modules/eslint/lib/rules/sort-keys.js b/tools/node_modules/eslint/lib/rules/sort-keys.js index beda42f1e3e301..c314d4a63611b6 100644 --- a/tools/node_modules/eslint/lib/rules/sort-keys.js +++ b/tools/node_modules/eslint/lib/rules/sort-keys.js @@ -29,7 +29,13 @@ const astUtils = require("./utils/ast-utils"), * @private */ function getPropertyName(node) { - return astUtils.getStaticPropertyName(node) || node.key.name || null; + const staticName = astUtils.getStaticPropertyName(node); + + if (staticName !== null) { + return staticName; + } + + return node.key.name || null; } /** @@ -151,9 +157,11 @@ module.exports = { const numKeys = stack.numKeys; const thisName = getPropertyName(node); - stack.prevName = thisName || prevName; + if (thisName !== null) { + stack.prevName = thisName; + } - if (!prevName || !thisName || numKeys < minKeys) { + if (prevName === null || thisName === null || numKeys < minKeys) { return; } 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 78ae7bc015778f..f0b926e3298f86 100644 --- a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -38,6 +38,7 @@ const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); const DECIMAL_INTEGER_PATTERN = /^(0|[1-9]\d*)$/u; +const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u; /** * Checks reference if is non initializer and writable. @@ -847,6 +848,7 @@ module.exports = { return 17; case "CallExpression": + case "ImportExpression": return 18; case "NewExpression": @@ -1101,7 +1103,7 @@ module.exports = { } else { const name = module.exports.getStaticPropertyName(parent); - if (name) { + if (name !== null) { tokens.push(`'${name}'`); } } @@ -1301,7 +1303,7 @@ module.exports = { * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020 */ - return node.type === "Literal" && node.value === null && !node.regex; + return node.type === "Literal" && node.value === null && !node.regex && !node.bigint; }, /** @@ -1373,5 +1375,20 @@ module.exports = { "/*".length + (match ? match.index + 1 : 0) ); + }, + + /** + * Determines whether the given raw string contains an octal escape sequence. + * + * "\1", "\2" ... "\7" + * "\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. + */ + hasOctalEscapeSequence(rawString) { + return OCTAL_ESCAPE_PATTERN.test(rawString); } }; diff --git a/tools/node_modules/eslint/lib/rules/yoda.js b/tools/node_modules/eslint/lib/rules/yoda.js index 43783c193bd5dd..89c4a8afd11346 100644 --- a/tools/node_modules/eslint/lib/rules/yoda.js +++ b/tools/node_modules/eslint/lib/rules/yoda.js @@ -119,7 +119,7 @@ function same(a, b) { const nameA = astUtils.getStaticPropertyName(a); // x.y = x["y"] - if (nameA) { + if (nameA !== null) { return ( same(a.object, b.object) && nameA === astUtils.getStaticPropertyName(b) diff --git a/tools/node_modules/eslint/lib/shared/types.js b/tools/node_modules/eslint/lib/shared/types.js index d8357799944827..8a889d21db98fa 100644 --- a/tools/node_modules/eslint/lib/shared/types.js +++ b/tools/node_modules/eslint/lib/shared/types.js @@ -30,6 +30,7 @@ module.exports = {}; * @property {Record} [env] The environment settings. * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. * @property {string} [parser] The path to a parser or the package name of a parser. * @property {ParserOptions} [parserOptions] The parser options. @@ -47,6 +48,7 @@ module.exports = {}; * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. * @property {string | string[]} files The glob pattarns for target files. * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. * @property {string} [parser] The path to a parser or the package name of a parser. * @property {ParserOptions} [parserOptions] The parser options. 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 89d06d6900deaa..a8f903e4aacede 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -6,7 +6,7 @@ "deprecated": false, "description": "Alternative, faster React.js JSX parser", "devDependencies": { - "acorn": "^6.0.0" + "acorn": "^7.0.0" }, "homepage": "https://github.com/RReverser/acorn-jsx", "license": "MIT", @@ -19,7 +19,7 @@ ], "name": "acorn-jsx", "peerDependencies": { - "acorn": "^6.0.0" + "acorn": "^6.0.0 || ^7.0.0" }, "repository": { "type": "git", @@ -28,5 +28,5 @@ "scripts": { "test": "node test/run.js" }, - "version": "5.0.1" + "version": "5.0.2" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/acorn/README.md b/tools/node_modules/eslint/node_modules/acorn/README.md index fa372ee6821bab..9b7c0badb1084d 100644 --- a/tools/node_modules/eslint/node_modules/acorn/README.md +++ b/tools/node_modules/eslint/node_modules/acorn/README.md @@ -54,7 +54,7 @@ an object containing any of these fields: - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial support). This influences support for strict mode, the set of - reserved words, and support for new syntax features. Default is 9. + reserved words, and support for new syntax features. Default is 10. **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being implemented by Acorn. Other proposed new features can be implemented @@ -64,6 +64,9 @@ an object containing any of these fields: either `"script"` or `"module"`. This influences global strict mode and parsing of `import` and `export` declarations. + **NOTE**: If set to `"module"`, then static `import` / `export` syntax + will be valid, even if `ecmaVersion` is less than 6. + - **onInsertedSemicolon**: If given a callback, that callback will be called whenever a missing semicolon is inserted by the parser. The callback will be given the character offset of the point where the diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js index ae755fa230043f..e4d9e76eb7b5d5 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js @@ -20,6 +20,7 @@ var keywords = { 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" }; @@ -319,8 +320,8 @@ // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 // (2019). This influences support for strict mode, the set of // reserved words, and support for new syntax features. The default - // is 9. - ecmaVersion: 9, + // is 10. + ecmaVersion: 10, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. @@ -467,7 +468,7 @@ var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { for (var v = options.ecmaVersion;; v--) @@ -754,9 +755,7 @@ } } this.adaptDirectivePrologue(node.body); this.next(); - if (this.options.ecmaVersion >= 6) { - node.sourceType = this.options.sourceType; - } + node.sourceType = this.options.sourceType; return this.finishNode(node, "Program") }; @@ -2113,7 +2112,7 @@ if (computed || this.eat(types.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = computed ? this.parseExpression() : this.parseIdent(true); + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); node.computed = !!computed; if (computed) { this.expect(types.bracketR); } base = this.finishNode(node, "MemberExpression"); @@ -2122,7 +2121,7 @@ this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors); + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); @@ -2140,16 +2139,6 @@ var node$1 = this.startNodeAt(startPos, startLoc); node$1.callee = base; node$1.arguments = exprList; - if (node$1.callee.type === "Import") { - if (node$1.arguments.length !== 1) { - this.raise(node$1.start, "import() requires exactly one argument"); - } - - var importArg = node$1.arguments[0]; - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); - } - } base = this.finishNode(node$1, "CallExpression"); } else if (this.type === types.backQuote) { var node$2 = this.startNodeAt(startPos, startLoc); @@ -2261,8 +2250,8 @@ return this.parseTemplate() case types._import: - if (this.options.ecmaVersion > 10) { - return this.parseDynamicImport() + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport() } else { return this.unexpected() } @@ -2272,13 +2261,34 @@ } }; - pp$3.parseDynamicImport = function() { + pp$3.parseExprImport = function() { var node = this.startNode(); - this.next(); - if (this.type !== types.parenL) { + this.next(); // skip `import` + switch (this.type) { + case types.parenL: + return this.parseDynamicImport(node) + default: this.unexpected(); } - return this.finishNode(node, "Import") + }; + + pp$3.parseDynamicImport = function(node) { + this.next(); // skip `(` + + // Parse node.source. + node.source = this.parseMaybeAssign(); + + // Verify ending. + if (!this.eat(types.parenR)) { + var errorPos = this.start; + if (this.eat(types.comma) && this.eat(types.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + + return this.finishNode(node, "ImportExpression") }; pp$3.parseLiteral = function(value) { @@ -2388,12 +2398,12 @@ { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc; + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - if (this.options.ecmaVersion > 10 && node.callee.type === "Import") { - this.raise(node.callee.start, "Cannot use new with import(...)"); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } else { node.arguments = empty$1; } return this.finishNode(node, "NewExpression") }; @@ -2580,7 +2590,7 @@ prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. @@ -2760,7 +2770,6 @@ pp$3.parseIdent = function(liberal, isBinding) { var node = this.startNode(); - if (liberal && this.options.allowReserved === "never") { liberal = false; } if (this.type === types.name) { node.name = this.value; } else if (this.type.keyword) { @@ -4914,7 +4923,7 @@ // Acorn is a tiny, fast JavaScript parser written in JavaScript. - var version = "6.2.1"; + var version = "7.0.0"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs index 18d0c72eb0d556..3e8e6f19fa4dcd 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs @@ -14,6 +14,7 @@ var ecma5AndLessKeywords = "break case catch continue debugger default do else f var keywords = { 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" }; @@ -313,8 +314,8 @@ var defaultOptions = { // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 // (2019). This influences support for strict mode, the set of // reserved words, and support for new syntax features. The default - // is 9. - ecmaVersion: 9, + // is 10. + ecmaVersion: 10, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. @@ -461,7 +462,7 @@ var var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { for (var v = options.ecmaVersion;; v--) @@ -748,9 +749,7 @@ pp$1.parseTopLevel = function(node) { } } this.adaptDirectivePrologue(node.body); this.next(); - if (this.options.ecmaVersion >= 6) { - node.sourceType = this.options.sourceType; - } + node.sourceType = this.options.sourceType; return this.finishNode(node, "Program") }; @@ -2107,7 +2106,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro if (computed || this.eat(types.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = computed ? this.parseExpression() : this.parseIdent(true); + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); node.computed = !!computed; if (computed) { this.expect(types.bracketR); } base = this.finishNode(node, "MemberExpression"); @@ -2116,7 +2115,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && base.type !== "Import", false, refDestructuringErrors); + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); @@ -2134,16 +2133,6 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro var node$1 = this.startNodeAt(startPos, startLoc); node$1.callee = base; node$1.arguments = exprList; - if (node$1.callee.type === "Import") { - if (node$1.arguments.length !== 1) { - this.raise(node$1.start, "import() requires exactly one argument"); - } - - var importArg = node$1.arguments[0]; - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); - } - } base = this.finishNode(node$1, "CallExpression"); } else if (this.type === types.backQuote) { var node$2 = this.startNodeAt(startPos, startLoc); @@ -2255,8 +2244,8 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { return this.parseTemplate() case types._import: - if (this.options.ecmaVersion > 10) { - return this.parseDynamicImport() + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport() } else { return this.unexpected() } @@ -2266,13 +2255,34 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { } }; -pp$3.parseDynamicImport = function() { +pp$3.parseExprImport = function() { var node = this.startNode(); - this.next(); - if (this.type !== types.parenL) { + this.next(); // skip `import` + switch (this.type) { + case types.parenL: + return this.parseDynamicImport(node) + default: this.unexpected(); } - return this.finishNode(node, "Import") +}; + +pp$3.parseDynamicImport = function(node) { + this.next(); // skip `(` + + // Parse node.source. + node.source = this.parseMaybeAssign(); + + // Verify ending. + if (!this.eat(types.parenR)) { + var errorPos = this.start; + if (this.eat(types.comma) && this.eat(types.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + + return this.finishNode(node, "ImportExpression") }; pp$3.parseLiteral = function(value) { @@ -2382,12 +2392,12 @@ pp$3.parseNew = function() { { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc; + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - if (this.options.ecmaVersion > 10 && node.callee.type === "Import") { - this.raise(node.callee.start, "Cannot use new with import(...)"); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8 && node.callee.type !== "Import", false); } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } else { node.arguments = empty$1; } return this.finishNode(node, "NewExpression") }; @@ -2574,7 +2584,7 @@ pp$3.parsePropertyName = function(prop) { prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. @@ -2754,7 +2764,6 @@ pp$3.checkUnreserved = function(ref) { pp$3.parseIdent = function(liberal, isBinding) { var node = this.startNode(); - if (liberal && this.options.allowReserved === "never") { liberal = false; } if (this.type === types.name) { node.name = this.value; } else if (this.type.keyword) { @@ -4908,7 +4917,7 @@ pp$9.readWord = function() { // Acorn is a tiny, fast JavaScript parser written in JavaScript. -var version = "6.2.1"; +var version = "7.0.0"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/tools/node_modules/eslint/node_modules/acorn/package.json b/tools/node_modules/eslint/node_modules/acorn/package.json index fc2adc76cd5a20..46baa1e126513a 100644 --- a/tools/node_modules/eslint/node_modules/acorn/package.json +++ b/tools/node_modules/eslint/node_modules/acorn/package.json @@ -39,5 +39,5 @@ "scripts": { "prepare": "cd ..; npm run build:main && npm run build:bin" }, - "version": "6.2.1" + "version": "7.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/README.md index e5ccececf4808f..f8dfa5a0df5fc4 100644 --- a/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/README.md +++ b/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/README.md @@ -398,14 +398,15 @@ range, use the `satisfies(version, range)` function. * `coerce(version)`: Coerces a string to semver if possible -This aims to provide a very forgiving translation of a non-semver -string to semver. It looks for the first digit in a string, and -consumes all remaining characters which satisfy at least a partial semver -(e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters). -Longer versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). -All surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`). -Only text which lacks digits will fail coercion (`version one` is not valid). -The maximum length for any semver component considered for coercion is 16 characters; -longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`). -The maximum value for any semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; -higher value components are invalid (`9999999999999999.4.7.4` is likely invalid). +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json b/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json index c81acfc3af0d68..36a29db5674695 100644 --- a/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json +++ b/tools/node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json @@ -33,5 +33,5 @@ "tap": { "check-coverage": true }, - "version": "5.7.0" + "version": "5.7.1" } \ No newline at end of file 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 d501e86d3f9681..7805b05ef36290 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/index.js +++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.js @@ -240,10 +240,15 @@ function getFunctionHeadLocation(node, sourceCode) { } } +/* globals BigInt */ + const builtinNames = Object.freeze( new Set([ "Array", "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", "Boolean", "DataView", "Date", @@ -251,9 +256,7 @@ const builtinNames = Object.freeze( "decodeURIComponent", "encodeURI", "encodeURIComponent", - "Error", "escape", - "EvalError", "Float32Array", "Float64Array", "Function", @@ -274,26 +277,97 @@ const builtinNames = Object.freeze( "parseInt", "Promise", "Proxy", - "RangeError", - "ReferenceError", "Reflect", "RegExp", "Set", "String", "Symbol", - "SyntaxError", - "TypeError", "Uint16Array", "Uint32Array", "Uint8Array", "Uint8ClampedArray", "undefined", "unescape", - "URIError", "WeakMap", "WeakSet", ]) ); +const callAllowed = new Set( + [ + Array.isArray, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + ...Object.getOwnPropertyNames(Math) + .map(k => Math[k]) + .filter(f => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Object, + Object.entries, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + parseFloat, + parseInt, + RegExp, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + Symbol, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter(f => typeof f === "function") +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} /** * Get the element values of a given node list. @@ -413,13 +487,23 @@ const operations = Object.freeze({ if (object != null && property != null) { const receiver = object.value; const methodName = property.value; - return { value: receiver[methodName](...args) } + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } } } else { const callee = getStaticValueR(calleeNode, initialScope); if (callee != null) { const func = callee.value; - return { value: func(...args) } + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } } } } @@ -473,11 +557,11 @@ const operations = Object.freeze({ Literal(node) { //istanbul ignore if : this is implementation-specific behavior. - if (node.regex != null && node.value == null) { - // It was a RegExp literal, but Node.js didn't support it. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. return null } - return node + return { value: node.value } }, LogicalExpression(node, initialScope) { @@ -505,7 +589,11 @@ const operations = Object.freeze({ ? getStaticValueR(node.property, initialScope) : { value: node.property.name }; - if (object != null && property != null) { + if ( + object != null && + property != null && + !isGetter(object.value, property.value) + ) { return { value: object.value[property.value] } } return null @@ -517,7 +605,9 @@ const operations = Object.freeze({ if (callee != null && args != null) { const Func = callee.value; - return { value: new Func(...args) } + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } } return null @@ -576,7 +666,9 @@ const operations = Object.freeze({ const strings = node.quasi.quasis.map(q => q.value.cooked); strings.raw = node.quasi.quasis.map(q => q.value.raw); - return { value: func(strings, ...expressions) } + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } } return null @@ -660,6 +752,16 @@ function getStaticValue(node, initialScope = null) { * @returns {string|null} The value of the node, or `null`. */ function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + const evaluated = getStaticValue(node, initialScope); return evaluated && String(evaluated.value) } 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 e050ba0e1b7c52..2e6391e9b321e0 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs +++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs @@ -234,10 +234,15 @@ function getFunctionHeadLocation(node, sourceCode) { } } +/* globals BigInt */ + const builtinNames = Object.freeze( new Set([ "Array", "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", "Boolean", "DataView", "Date", @@ -245,9 +250,7 @@ const builtinNames = Object.freeze( "decodeURIComponent", "encodeURI", "encodeURIComponent", - "Error", "escape", - "EvalError", "Float32Array", "Float64Array", "Function", @@ -268,26 +271,97 @@ const builtinNames = Object.freeze( "parseInt", "Promise", "Proxy", - "RangeError", - "ReferenceError", "Reflect", "RegExp", "Set", "String", "Symbol", - "SyntaxError", - "TypeError", "Uint16Array", "Uint32Array", "Uint8Array", "Uint8ClampedArray", "undefined", "unescape", - "URIError", "WeakMap", "WeakSet", ]) ); +const callAllowed = new Set( + [ + Array.isArray, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + ...Object.getOwnPropertyNames(Math) + .map(k => Math[k]) + .filter(f => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Object, + Object.entries, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, //eslint-disable-line @mysticatea/node/no-unsupported-features/es-builtins + parseFloat, + parseInt, + RegExp, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + Symbol, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter(f => typeof f === "function") +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} /** * Get the element values of a given node list. @@ -407,13 +481,23 @@ const operations = Object.freeze({ if (object != null && property != null) { const receiver = object.value; const methodName = property.value; - return { value: receiver[methodName](...args) } + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } } } else { const callee = getStaticValueR(calleeNode, initialScope); if (callee != null) { const func = callee.value; - return { value: func(...args) } + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } } } } @@ -467,11 +551,11 @@ const operations = Object.freeze({ Literal(node) { //istanbul ignore if : this is implementation-specific behavior. - if (node.regex != null && node.value == null) { - // It was a RegExp literal, but Node.js didn't support it. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. return null } - return node + return { value: node.value } }, LogicalExpression(node, initialScope) { @@ -499,7 +583,11 @@ const operations = Object.freeze({ ? getStaticValueR(node.property, initialScope) : { value: node.property.name }; - if (object != null && property != null) { + if ( + object != null && + property != null && + !isGetter(object.value, property.value) + ) { return { value: object.value[property.value] } } return null @@ -511,7 +599,9 @@ const operations = Object.freeze({ if (callee != null && args != null) { const Func = callee.value; - return { value: new Func(...args) } + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } } return null @@ -570,7 +660,9 @@ const operations = Object.freeze({ const strings = node.quasi.quasis.map(q => q.value.cooked); strings.raw = node.quasi.quasis.map(q => q.value.raw); - return { value: func(strings, ...expressions) } + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } } return null @@ -654,6 +746,16 @@ function getStaticValue(node, initialScope = null) { * @returns {string|null} The value of the node, or `null`. */ function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + const evaluated = getStaticValue(node, initialScope); return evaluated && String(evaluated.value) } 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 b6e49c8b9d384c..bbade790ea5f1a 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/package.json @@ -62,5 +62,5 @@ "watch": "warun \"{src,test}/**/*.js\" -- nyc --reporter lcov mocha --reporter dot \"test/*.js\"" }, "sideEffects": false, - "version": "1.4.0" + "version": "1.4.2" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json index 5e07415c430a70..d31b7b29439a13 100644 --- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json @@ -128,6 +128,9 @@ "ImportDefaultSpecifier": [ "local" ], + "ImportExpression": [ + "source" + ], "ImportNamespaceSpecifier": [ "local" ], diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json index 13c7c6e90390b2..68eec940691e0b 100644 --- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json @@ -13,7 +13,7 @@ "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", - "eslint-release": "^0.10.3", + "eslint-release": "^1.0.0", "mocha": "^3.5.3", "nyc": "^11.2.1", "opener": "^1.4.3" @@ -34,12 +34,15 @@ "url": "git+https://github.com/eslint/eslint-visitor-keys.git" }, "scripts": { - "ci-release": "eslint-ci-release", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", "lint": "eslint lib tests/lib", "pretest": "npm run -s lint", - "release": "eslint-release", + "publish-release": "eslint-publish-release", "test": "nyc mocha tests/lib" }, - "version": "1.0.0" + "version": "1.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/espree/README.md b/tools/node_modules/eslint/node_modules/espree/README.md index 7e496f661987a7..a03d1c3ef402fa 100644 --- a/tools/node_modules/eslint/node_modules/espree/README.md +++ b/tools/node_modules/eslint/node_modules/espree/README.md @@ -44,7 +44,7 @@ const ast = espree.parse(code, { tokens: false, // Set to 3, 5 (default), 6, 7, 8, 9, or 10 to specify the version of ECMAScript syntax you want to use. - // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), or 2019 (same as 10) to use the year-based naming. + // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), or 2020 (same as 11) to use the year-based naming. ecmaVersion: 5, // specify which type of script you're parsing ("script" or "module") diff --git a/tools/node_modules/eslint/node_modules/espree/espree.js b/tools/node_modules/eslint/node_modules/espree/espree.js index 7c16b696563656..ce277c1867b44c 100644 --- a/tools/node_modules/eslint/node_modules/espree/espree.js +++ b/tools/node_modules/eslint/node_modules/espree/espree.js @@ -154,7 +154,7 @@ exports.Syntax = (function() { } for (name in astNodeTypes) { - if (astNodeTypes.hasOwnProperty(name)) { + if (Object.hasOwnProperty.call(astNodeTypes, name)) { types[name] = astNodeTypes[name]; } } 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 6c57a87c65e36a..cd362e71a04a5d 100644 --- a/tools/node_modules/eslint/node_modules/espree/lib/espree.js +++ b/tools/node_modules/eslint/node_modules/espree/lib/espree.js @@ -18,27 +18,30 @@ const tokTypes = Object.assign({}, acorn.tokTypes, jsx.tokTypes); * @returns {number} normalized ECMAScript version */ function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) { - if (typeof ecmaVersion === "number") { - let version = ecmaVersion; + if (typeof ecmaVersion !== "number") { + throw new Error(`ecmaVersion must be a number. Received value of type ${typeof ecmaVersion} instead.`); + } - // Calculate ECMAScript edition number from official year version starting with - // ES2015, which corresponds with ES6 (or a difference of 2009). - if (version >= 2015) { - version -= 2009; - } + let version = ecmaVersion; - switch (version) { - case 3: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - return version; - - // no default - } + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + switch (version) { + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + return version; + + // no default } throw new Error("Invalid ecmaVersion."); @@ -174,6 +177,9 @@ module.exports = () => Parser => class Espree extends Parser { this.next(); } while (this.type !== tokTypes.eof); + // Consume the final eof token + this.next(); + const extra = this[STATE]; const tokens = extra.tokens; diff --git a/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json index 942eaf488a3d8e..0a3460432a26b6 100644 --- a/tools/node_modules/eslint/node_modules/espree/package.json +++ b/tools/node_modules/eslint/node_modules/espree/package.json @@ -8,29 +8,29 @@ }, "bundleDependencies": false, "dependencies": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "acorn": "^7.0.0", + "acorn-jsx": "^5.0.2", + "eslint-visitor-keys": "^1.1.0" }, "deprecated": false, "description": "An Esprima-compatible JavaScript parser built on Acorn", "devDependencies": { - "browserify": "^7.0.0", - "chai": "^1.10.0", - "eslint": "^5.7.0", + "browserify": "^16.5.0", + "chai": "^4.2.0", + "eslint": "^6.0.1", "eslint-config-eslint": "^5.0.1", - "eslint-plugin-node": "^8.0.0", + "eslint-plugin-node": "^9.1.0", "eslint-release": "^1.0.0", "esprima": "latest", "esprima-fb": "^8001.2001.0-dev-harmony-fb", - "json-diff": "~0.3.1", - "leche": "^1.0.1", - "mocha": "^2.0.1", - "nyc": "^13.0.1", - "regenerate": "~0.5.4", + "json-diff": "^0.5.4", + "leche": "^2.3.0", + "mocha": "^6.2.0", + "nyc": "^14.1.1", + "regenerate": "^1.4.0", "shelljs": "^0.3.0", "shelljs-nodecli": "^0.1.1", - "unicode-6.3.0": "~0.1.0" + "unicode-6.3.0": "^0.7.5" }, "engines": { "node": ">=6.0.0" @@ -66,5 +66,5 @@ "publish-release": "eslint-publish-release", "test": "npm run-script lint && node Makefile.js test" }, - "version": "6.0.0" + "version": "6.1.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/estraverse/README.md b/tools/node_modules/eslint/node_modules/estraverse/README.md new file mode 100644 index 00000000000000..ccd3377f3e9449 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/estraverse/README.md @@ -0,0 +1,153 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +When `visitor.fallback` is a function, we can determine which keys to visit on each node. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Skip the `argument` property of each node + fallback: function(node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument'; + }); + } +}); +``` + +### License + +Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +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. + +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 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. diff --git a/tools/node_modules/eslint/node_modules/estraverse/estraverse.js b/tools/node_modules/eslint/node_modules/estraverse/estraverse.js index 09ae4783247f0c..b106d386a6e1af 100644 --- a/tools/node_modules/eslint/node_modules/estraverse/estraverse.js +++ b/tools/node_modules/eslint/node_modules/estraverse/estraverse.js @@ -29,24 +29,12 @@ 'use strict'; var Syntax, - isArray, VisitorOption, VisitorKeys, - objectCreate, - objectKeys, BREAK, SKIP, REMOVE; - function ignoreJSHintError() { } - - isArray = Array.isArray; - if (!isArray) { - isArray = function isArray(array) { - return Object.prototype.toString.call(array) === '[object Array]'; - }; - } - function deepCopy(obj) { var ret = {}, key, val; for (key in obj) { @@ -62,17 +50,6 @@ return ret; } - function shallowCopy(obj) { - var ret = {}, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - ignoreJSHintError(shallowCopy); - // based on LLVM libc++ upper_bound / lower_bound // MIT License @@ -95,52 +72,6 @@ return i; } - function lowerBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - i = current + 1; - len -= diff + 1; - } else { - len = diff; - } - } - return i; - } - ignoreJSHintError(lowerBound); - - objectCreate = Object.create || (function () { - function F() { } - - return function (o) { - F.prototype = o; - return new F(); - }; - })(); - - objectKeys = Object.keys || function (o) { - var keys = [], key; - for (key in o) { - keys.push(key); - } - return keys; - }; - - function extend(to, from) { - var keys = objectKeys(from), key, i, len; - for (i = 0, len = keys.length; i < len; i += 1) { - key = keys[i]; - to[key] = from[key]; - } - return to; - } - Syntax = { AssignmentExpression: 'AssignmentExpression', AssignmentPattern: 'AssignmentPattern', @@ -177,6 +108,7 @@ GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. Identifier: 'Identifier', IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', ImportDeclaration: 'ImportDeclaration', ImportDefaultSpecifier: 'ImportDefaultSpecifier', ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', @@ -251,6 +183,7 @@ GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. Identifier: [], IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], ImportDeclaration: ['specifiers', 'source'], ImportDefaultSpecifier: ['local'], ImportNamespaceSpecifier: ['local'], @@ -310,7 +243,7 @@ }; Reference.prototype.remove = function remove() { - if (isArray(this.parent)) { + if (Array.isArray(this.parent)) { this.parent.splice(this.key, 1); return true; } else { @@ -334,7 +267,7 @@ var i, iz, j, jz, result, element; function addToPath(result, path) { - if (isArray(path)) { + if (Array.isArray(path)) { for (j = 0, jz = path.length; j < jz; ++j) { result.push(path[j]); } @@ -434,14 +367,14 @@ this.__state = null; this.__fallback = null; if (visitor.fallback === 'iteration') { - this.__fallback = objectKeys; + this.__fallback = Object.keys; } else if (typeof visitor.fallback === 'function') { this.__fallback = visitor.fallback; } this.__keys = VisitorKeys; if (visitor.keys) { - this.__keys = extend(objectCreate(this.__keys), visitor.keys); + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); } }; @@ -530,7 +463,7 @@ continue; } - if (isArray(candidate)) { + if (Array.isArray(candidate)) { current2 = candidate.length; while ((current2 -= 1) >= 0) { if (!candidate[current2]) { @@ -684,7 +617,7 @@ continue; } - if (isArray(candidate)) { + if (Array.isArray(candidate)) { current2 = candidate.length; while ((current2 -= 1) >= 0) { if (!candidate[current2]) { diff --git a/tools/node_modules/eslint/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/estraverse/package.json index 18c895263916d4..8a9a242d0fd34a 100644 --- a/tools/node_modules/eslint/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/estraverse/package.json @@ -6,7 +6,7 @@ "deprecated": false, "description": "ECMAScript JS AST traversal functions", "devDependencies": { - "babel-preset-es2015": "^6.3.13", + "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", "chai": "^2.1.1", "espree": "^1.11.0", @@ -14,12 +14,12 @@ "gulp-bump": "^0.2.2", "gulp-filter": "^2.0.0", "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.2.1", + "gulp-tag-version": "^1.3.0", "jshint": "^2.5.6", "mocha": "^2.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4.0" }, "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", @@ -41,5 +41,5 @@ "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers js:babel-register" }, - "version": "4.2.0" + "version": "4.3.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/esutils/README.md b/tools/node_modules/eslint/node_modules/esutils/README.md index 610d8bde66ff81..517526cfb99b97 100644 --- a/tools/node_modules/eslint/node_modules/esutils/README.md +++ b/tools/node_modules/eslint/node_modules/esutils/README.md @@ -98,8 +98,8 @@ respectively. If the `strict` flag is truthy, this function additionally checks Returns `true` if provided identifier string is a Keyword or Future Reserved Word in ECMA262 edition 6. They are formally defined in ECMA262 sections -[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and -[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words), +[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and +[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), respectively. If the `strict` flag is truthy, this function additionally checks whether `id` is a Keyword or Future Reserved Word under strict mode. @@ -113,7 +113,7 @@ is a Reserved Word under strict mode. #### keyword.isReservedWordES6(id, strict) Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. -They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words). +They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). If the `strict` flag is truthy, this function additionally checks whether `id` is a Reserved Word under strict mode. @@ -121,13 +121,18 @@ is a Reserved Word under strict mode. Returns `true` if provided identifier string is one of `eval` or `arguments`. They are restricted in strict mode code throughout ECMA262 edition 5.1 and -in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors). +in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). -#### keyword.isIdentifierName(id) +#### keyword.isIdentifierNameES5(id) Return true if provided identifier string is an IdentifierName as specified in ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). +#### keyword.isIdentifierNameES6(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). + #### keyword.isIdentifierES5(id, strict) Return true if provided identifier string is an Identifier as specified in @@ -138,7 +143,7 @@ under strict mode. #### keyword.isIdentifierES6(id, strict) Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers). +ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). If the `strict` flag is truthy, this function additionally checks whether `id` is an Identifier under strict mode. diff --git a/tools/node_modules/eslint/node_modules/esutils/lib/code.js b/tools/node_modules/eslint/node_modules/esutils/lib/code.js index 2a7c19d63c89b3..23136af91f9fbc 100644 --- a/tools/node_modules/eslint/node_modules/esutils/lib/code.js +++ b/tools/node_modules/eslint/node_modules/esutils/lib/code.js @@ -30,17 +30,17 @@ // See `tools/generate-identifier-regex.js`. ES5Regex = { - // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, - // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ }; ES6Regex = { - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; function isDecimalDigit(ch) { @@ -60,7 +60,7 @@ // 7.2 White Space NON_ASCII_WHITESPACES = [ - 0x1680, 0x180E, + 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, diff --git a/tools/node_modules/eslint/node_modules/esutils/package.json b/tools/node_modules/eslint/node_modules/esutils/package.json index 84df59656f12e8..cffa439c8dafce 100644 --- a/tools/node_modules/eslint/node_modules/esutils/package.json +++ b/tools/node_modules/eslint/node_modules/esutils/package.json @@ -10,8 +10,8 @@ "coffee-script": "~1.6.3", "jshint": "2.6.3", "mocha": "~2.2.1", - "regenerate": "~1.2.1", - "unicode-7.0.0": "^0.1.5" + "regenerate": "~1.3.1", + "unicode-9.0.0": "~0.7.0" }, "directories": { "lib": "./lib" @@ -25,12 +25,7 @@ "lib" ], "homepage": "https://github.com/estools/esutils", - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/estools/esutils/raw/master/LICENSE.BSD" - } - ], + "license": "BSD-2-Clause", "main": "lib/utils.js", "maintainers": [ { @@ -50,5 +45,5 @@ "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers coffee:coffee-script -R spec" }, - "version": "2.0.2" + "version": "2.0.3" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/extend/.jscs.json b/tools/node_modules/eslint/node_modules/extend/.jscs.json index 0b03e0564b61ba..3cce01d7832943 100644 --- a/tools/node_modules/eslint/node_modules/extend/.jscs.json +++ b/tools/node_modules/eslint/node_modules/extend/.jscs.json @@ -172,3 +172,4 @@ "requireUseStrict": true } + diff --git a/tools/node_modules/eslint/node_modules/external-editor/README.md b/tools/node_modules/eslint/node_modules/external-editor/README.md index 9eb135b643cd56..53a8e70132500d 100644 --- a/tools/node_modules/eslint/node_modules/external-editor/README.md +++ b/tools/node_modules/eslint/node_modules/external-editor/README.md @@ -115,7 +115,7 @@ A full featured example - `mode` (number) *Optional* Which mode to create the file with. e.g. 644 - `template` (string) *Optional* A template for the filename. See [tmp](https://www.npmjs.com/package/tmp). - `dir` (string) *Optional* Which path to store the file. - + ## Errors All errors have a simple message explaining what went wrong. They all also have an `originalError` property containing diff --git a/tools/node_modules/eslint/node_modules/inquirer/README.md b/tools/node_modules/eslint/node_modules/inquirer/README.md index 70d71e12a11065..00183582c48455 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/README.md +++ b/tools/node_modules/eslint/node_modules/inquirer/README.md @@ -1,5 +1,11 @@ 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) @@ -446,4 +452,4 @@ Auto submit based on your current input, saving one extra enter [**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)
Inquirer prompt for to select a file or directory in file tree -![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif) \ No newline at end of file +![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif) diff --git a/tools/node_modules/eslint/node_modules/inquirer/package.json b/tools/node_modules/eslint/node_modules/inquirer/package.json index b0b63fdc1893d3..9c1a62d2773fe9 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/package.json +++ b/tools/node_modules/eslint/node_modules/inquirer/package.json @@ -40,7 +40,7 @@ "lib", "README.md" ], - "gitHead": "da5d0e22de84486240b12f52643fbd573f8d0d38", + "gitHead": "7d87f666042c67638d2e89bd4586d22f61e90130", "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.0" + "version": "6.5.2" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-glob/README.md b/tools/node_modules/eslint/node_modules/is-glob/README.md index 7723e931f42e15..59444ebe69a345 100644 --- a/tools/node_modules/eslint/node_modules/is-glob/README.md +++ b/tools/node_modules/eslint/node_modules/is-glob/README.md @@ -180,13 +180,13 @@ You might also be interested in these projects: ### Contributors -| **Commits** | **Contributor** | -| --- | --- | -| 47 | [jonschlinkert](https://github.com/jonschlinkert) | -| 5 | [doowb](https://github.com/doowb) | -| 1 | [phated](https://github.com/phated) | -| 1 | [danhper](https://github.com/danhper) | -| 1 | [paulmillr](https://github.com/paulmillr) | +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | ### Author diff --git a/tools/node_modules/eslint/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/semver/README.md index 7de4504d8171df..2293a14fdc3579 100644 --- a/tools/node_modules/eslint/node_modules/semver/README.md +++ b/tools/node_modules/eslint/node_modules/semver/README.md @@ -430,7 +430,7 @@ any other overlapping SemVer tuple. * `clean(version)`: Clean a string to be a valid semver if possible -This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. ex. * `s.clean(' = v 2.1.5foo')`: `null` diff --git a/tools/node_modules/eslint/node_modules/semver/bin/.semver.js.swp b/tools/node_modules/eslint/node_modules/semver/bin/.semver.js.swp deleted file mode 100644 index c22a49e3a4edda25a698b9d793b65ef605064236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeHNO^h5z6)ro0gg_FM@DpqVwHx8-!81KxgMci%wt}(9MnSf;u_ahWxVEQyrq?~) zldkTu2PXlE5EQY15E6%=z$FP%5C^1yNKQx~gdhW4do|m~&To92f5<<^@Od+1f7?COed)Ou*;|VPEK))QiXOcB zCl`eur-6uHy&8Mi2<-IaxU-`=N)E>|>ug7fz4dplp|jWMqkdd7P&2TIft%U;j<4vc ze&_NMzx}pziz?RTH3KyRH3KyRH3KyRH3KyRH3KyR|A!3Zql4_Tucq?N+0loy>4{QR*ffeB0z`KB3fm?uo-@@2c;6>mC;CbLV;G4kXz!!l>fiX}3 zAs~TMz()WdXanyA4g+riZU-3fyPFyN8Sp*e^S}k*F5m{>0Pv?bG4_4nabOp?2%HD* z0S*EGcq3yk13w3z1ik?Tz&*eL;HNh+_7w1S;B!C-+z;FftN}-W>w#C^z}T;WXMv}I zM}P#l0Ne-M1snz54qONP^+v{i0Xz#l1?&P31DAmuP{1;<1pNI5#-0Jb3gkcvYyekZ z&)C0!Ujk165wH!c0v`Yl1MdLt01g5_d>wcKz6(49d;xd_NPu42CEx|%E5M@w`Hln@e>gskcEsE5Czycch&tUJ{ED*n|7ztEQj#z3Ez~%^D^V3Oa`(ilR&zL z=alHnRc`*r!naZ*zsuLG&L?2w^w#(N?jBoDrK3p}^#?iMpg-I2Px^c_7{rClW#+oM zo8K$OVl&91QO={`DAxQ5GKQz2CS#E2BemLb|D#E>e#a3M=!#C3z6M|+jV1oG)AzO- z*1QHk>Wpu(ut)+ee<0%#_nQ0)V-GRTA8Ptxnw=KGz$>eG;}(xv{L`q!tCGh}R7V@m zGnp4z!ZGyxq-D#;58W^cTHF!`F`zf6LCutQ!pYp1T zAdpH~YD+Fd5yiR;-j-4YUtW%KZv|AE0iX&V8RwXmS(avALr*Lo2zW#iPx!Xvg@X6O zLj+e*(vPJZTz)Ca2Rup5v}rV_I+5%RjL~$s?Z8=OJx7NoR}VrIa&O5M`>{;=`Jm~> zyVRA2LRT+c!H$}OZz>G8qLI^+bt~%5i~x6PE6`hZ6h<-TM`b|ZYvdL1P43Z_eHahcc#O-@qtpUT$O3ZABS+BEzG|!?d})21ukZ&SoRQH)!>WZ~4203- zxHd9o=Y%Cfzk9r~_1Z<|mGlLv%mQ*V&$+)YsQN#teZ?_`xkR(U+GnShv$jg?KJx{J z5uVkwPhT);lOQg7@@ytEiCIWb_7q`s^LUlM$dTa>fcvJq?M#Y`jPB^; zH1kJ=8hFC_PEUrSi1SsZE8)w!C%vQeoS^am3Sg-jG*;bho1Ra9o@`77%yvuKt@BXC zN-`2v3TwxC_8P77te9^EaSI#S0bJ*M+XYiq+osw=DaN%8Nm+mFt3edzUeobqsetMw z6}rVjdDGV~cn}qdOtVo+!AcnQ7D_Q=Yg){YES1u1Tjz}tt>g{n>T$kjc>*NWraRUGrX= zs@9GwqXAQ9f0><8McSUb|hn4wGoTC~3RqR%iRxEVmv*5hZr%r(3*G+1z^{Z*D4?j)!?w z>O!*)fs9N(P(+#Z8oqCLqtIJdnZ8}DoXYD~S14bK6}kI)XXUZ;uS${i_c>KYBDjdn zI{smvCXI3>w2J8$Qc}dRRg88FXus7pzumN}6cM5L={9MaU*j#uVQr_wMKa;47>!~I zP@GDU3o=B~<0GMzR9wU{&!x(hPt8tax2MohZw^CfG=U`4rASDb;0K#IC(u((j4!p@ z%u!9mX@a;&|Eu0^N+Xy{TJ|$B^x2(DokE#E+{@E+g};P;5de+&Ey_!{sS zKr#A_00VxE{(l5q0ZsxPfOKjB^`~Z_W}s%EW}s%EW}s%EW}s%^zrp~;iCupuMR?Ts z6ygXIku`?MN<~P^yL~y%DpH-6FY+jk@(EI|*yZmOD(93)rbk2Hq&^zw-SGx8&}N^H zfB})1P=QQ(wAoLyp3GWkX#$D~%4V|pI9b^UDWPk!sq}oR2uTgoBI&iL*Mw6#Ss}+2 z#YHwfGjZ}L7%8I`ohwqUY5=02>zwUOFXh?GSrcj4US`4=#Gw=u%^b2=jgkL#3b-rc zT>Uv^5}hu9QaJ*lzT&YA!6H)F`sBp3nWLs_-PQ@a1*b|2L>f_$NwTMcD2cZ~kk?BQ zza^4chXF*pR2@>t-pmGjJ0jco~lL3w=rR>;|;7Z)p zaREs>?*^ydM{Tmmq`*|^Qm*Ajc{D@=@6I=H3z1=TnJzkW*V1>C>}$Es+mxxo(caoL z15us{x;n0#Gjw`FVYG9(q0px(|4!I$xI*u-94@$KnQ0zXf5DtrA G{eJ+#s{f4u diff --git a/tools/node_modules/eslint/node_modules/semver/package.json b/tools/node_modules/eslint/node_modules/semver/package.json index 12dd2eace77264..094a2564704760 100644 --- a/tools/node_modules/eslint/node_modules/semver/package.json +++ b/tools/node_modules/eslint/node_modules/semver/package.json @@ -33,5 +33,5 @@ "tap": { "check-coverage": true }, - "version": "6.2.0" + "version": "6.3.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/semver/semver.js b/tools/node_modules/eslint/node_modules/semver/semver.js index fd6453f49e0b13..636fa4365a175f 100644 --- a/tools/node_modules/eslint/node_modules/semver/semver.js +++ b/tools/node_modules/eslint/node_modules/semver/semver.js @@ -29,75 +29,80 @@ var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re var re = exports.re = [] var src = exports.src = [] +var t = exports.tokens = {} var R = 0 +function tok (n) { + t[n] = R++ +} + // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. -var NUMERICIDENTIFIER = R++ -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' -var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. -var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. -var MAINVERSION = R++ -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')' +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' -var MAINVERSIONLOOSE = R++ -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')' +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. -var PRERELEASEIDENTIFIER = R++ -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')' +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' -var PRERELEASEIDENTIFIERLOOSE = R++ -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')' +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. -var PRERELEASE = R++ -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' -var PRERELEASELOOSE = R++ -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. -var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. -var BUILD = R++ -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and @@ -108,131 +113,133 @@ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + // capturing group, because it should not ever be used in version // comparison. -var FULL = R++ -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?' +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' -src[FULL] = '^' + FULLPLAIN + '$' +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?' +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' -var LOOSE = R++ -src[LOOSE] = '^' + LOOSEPLAIN + '$' +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' -var GTLT = R++ -src[GTLT] = '((?:<|>)?=?)' +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++ -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -var XRANGEIDENTIFIER = R++ -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' - -var XRANGEPLAIN = R++ -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + ')?)?' -var XRANGEPLAINLOOSE = R++ -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + ')?)?' -var XRANGE = R++ -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' -var XRANGELOOSE = R++ -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver -var COERCE = R++ -src[COERCE] = '(^|[^\\d])' + +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' -var COERCERTL = R++ -re[COERCERTL] = new RegExp(src[COERCE], 'g') +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" -var LONETILDE = R++ -src[LONETILDE] = '(?:~>?)' +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' -var TILDETRIM = R++ -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') var tildeTrimReplace = '$1~' -var TILDE = R++ -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' -var TILDELOOSE = R++ -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" -var LONECARET = R++ -src[LONECARET] = '(?:\\^)' +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' -var CARETTRIM = R++ -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') var caretTrimReplace = '$1^' -var CARET = R++ -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' -var CARETLOOSE = R++ -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++ -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' -var COMPARATOR = R++ -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++ -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' // this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. -var HYPHENRANGE = R++ -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$' -var HYPHENRANGELOOSE = R++ -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$' // Star ranges basically just allow anything at all. -var STAR = R++ -src[STAR] = '(<|>)?=?\\s*\\*' +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. @@ -264,7 +271,7 @@ function parse (version, options) { return null } - var r = options.loose ? re[LOOSE] : re[FULL] + var r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } @@ -319,7 +326,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -780,7 +787,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -935,18 +942,18 @@ Range.prototype.parseRange = function (range) { var loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[COMPARATORTRIM]) + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) + range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -954,7 +961,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -1054,7 +1061,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? re[TILDELOOSE] : re[TILDE] + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -1095,7 +1102,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? re[CARETLOOSE] : re[CARET] + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -1154,7 +1161,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -1229,10 +1236,10 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], '') + return comp.trim().replace(re[t.STAR], '') } -// This function is passed to string.replace(re[HYPHENRANGE]) +// This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do @@ -1555,7 +1562,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(re[COERCE]) + match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -1566,17 +1573,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = re[COERCERTL].exec(version)) && + while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - re[COERCERTL].lastIndex = next.index + next[1].length + next[2].length + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - re[COERCERTL].lastIndex = -1 + re[t.COERCERTL].lastIndex = -1 } if (match === null) { diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js b/tools/node_modules/eslint/node_modules/table/dist/alignString.js index 24dc423f9033fe..5d986444c9d72a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/alignString.js +++ b/tools/node_modules/eslint/node_modules/table/dist/alignString.js @@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); + +var _isString2 = _interopRequireDefault(require("lodash/isString")); var _stringWidth = _interopRequireDefault(require("string-width")); @@ -61,11 +63,11 @@ const alignCenter = (subject, width) => { const alignString = (subject, containerWidth, alignment) => { - if (!_lodash.default.isString(subject)) { + if (!(0, _isString2.default)(subject)) { throw new TypeError('Subject parameter value must be a string.'); } - if (!_lodash.default.isNumber(containerWidth)) { + if (!(0, _isNumber2.default)(containerWidth)) { throw new TypeError('Container width parameter value must be a number.'); } @@ -76,7 +78,7 @@ const alignString = (subject, containerWidth, alignment) => { throw new Error('Subject parameter value width cannot be greater than the container width.'); } - if (!_lodash.default.isString(alignment)) { + if (!(0, _isString2.default)(alignment)) { throw new TypeError('Alignment parameter value must be a string.'); } diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js index 99b8100cf7e372..7c11c4f67f3ecd 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _isString2 = _interopRequireDefault(require("lodash/isString")); var _wrapCell = _interopRequireDefault(require("./wrapCell")); @@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @returns {number} */ const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { - if (!_lodash.default.isString(value)) { + if (!(0, _isString2.default)(value)) { throw new TypeError('Value must be a string.'); } diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js index ad98db4040048c..774a7555772c19 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js @@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _max2 = _interopRequireDefault(require("lodash/max")); + +var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean")); + +var _isNumber2 = _interopRequireDefault(require("lodash/isNumber")); var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight")); @@ -24,17 +28,17 @@ const calculateRowHeightIndex = (rows, config) => { rows.forEach(cells => { const cellHeightIndex = new Array(tableWidth).fill(1); cells.forEach((value, index1) => { - if (!_lodash.default.isNumber(config.columns[index1].width)) { + if (!(0, _isNumber2.default)(config.columns[index1].width)) { throw new TypeError('column[index].width must be a number.'); } - if (!_lodash.default.isBoolean(config.columns[index1].wrapWord)) { + if (!(0, _isBoolean2.default)(config.columns[index1].wrapWord)) { throw new TypeError('column[index].wrapWord must be a boolean.'); } cellHeightIndex[index1] = (0, _calculateCellHeight.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); }); - rowSpanIndex.push(_lodash.default.max(cellHeightIndex)); + rowSpanIndex.push((0, _max2.default)(cellHeightIndex)); }); return rowSpanIndex; }; diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js b/tools/node_modules/eslint/node_modules/table/dist/createStream.js index f1eb06106e4ca1..269aae93f4c7a9 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js @@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _mapValues2 = _interopRequireDefault(require("lodash/mapValues")); + +var _values2 = _interopRequireDefault(require("lodash/values")); + +var _trimEnd2 = _interopRequireDefault(require("lodash/trimEnd")); var _makeStreamConfig = _interopRequireDefault(require("./makeStreamConfig")); @@ -60,7 +64,7 @@ const create = (row, columnWidthIndex, config) => { output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); output += body; output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - output = _lodash.default.trimEnd(output); + output = (0, _trimEnd2.default)(output); process.stdout.write(output); }; /** @@ -76,12 +80,17 @@ const append = (row, columnWidthIndex, config) => { const body = rows.map(literalRow => { return (0, _drawRow.default)(literalRow, config.border); }).join(''); - let output; - output = '\r\u001B[K'; + let output = ''; + const bottom = (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); + + if (bottom !== '\n') { + output = '\r\u001B[K'; + } + output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); output += body; - output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - output = _lodash.default.trimEnd(output); + output += bottom; + output = (0, _trimEnd2.default)(output); process.stdout.write(output); }; /** @@ -93,10 +102,9 @@ const append = (row, columnWidthIndex, config) => { const createStream = (userConfig = {}) => { const config = (0, _makeStreamConfig.default)(userConfig); // @todo Use 'Object.values' when Node.js v6 support is dropped. - const columnWidthIndex = _lodash.default.values(_lodash.default.mapValues(config.columns, column => { + const columnWidthIndex = (0, _values2.default)((0, _mapValues2.default)(config.columns, column => { return column.width + column.paddingLeft + column.paddingRight; })); - let empty; empty = true; return { diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow index 1d7d00e399c4a3..fd5eac47a90275 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow @@ -73,13 +73,16 @@ const append = (row, columnWidthIndex, config) => { return drawRow(literalRow, config.border); }).join(''); - let output; + let output = ''; + const bottom = drawBorderBottom(columnWidthIndex, config.border); - output = '\r\u001B[K'; + if (bottom !== '\n') { + output = '\r\u001B[K'; + } output += drawBorderJoin(columnWidthIndex, config.border); output += body; - output += drawBorderBottom(columnWidthIndex, config.border); + output += bottom; output = _.trimEnd(output); diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js index cb7c54077a3fd1..67227e2a0792f5 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js @@ -42,12 +42,18 @@ const drawBorder = (columnSizeIndex, parts) => { exports.drawBorder = drawBorder; const drawBorderTop = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { + const border = drawBorder(columnSizeIndex, { body: parts.topBody, join: parts.topJoin, left: parts.topLeft, right: parts.topRight }); + + if (border === '\n') { + return ''; + } + + return border; }; /** * @typedef drawBorderJoin~parts diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow index 5d5f5d9ac2e90f..16b2aebf23f823 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow @@ -35,12 +35,18 @@ const drawBorder = (columnSizeIndex, parts) => { * @returns {string} */ const drawBorderTop = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { + const border = drawBorder(columnSizeIndex, { body: parts.topBody, join: parts.topJoin, left: parts.topLeft, right: parts.topRight }); + + if (border === '\n') { + return ''; + } + + return border; }; /** diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js index 2828e453d93933..17fd35d1eadefc 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js @@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); + +var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); + +var _times2 = _interopRequireDefault(require("lodash/times")); var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); @@ -37,9 +41,8 @@ const makeBorder = (border = {}) => { const makeColumns = (rows, columns = {}, columnDefault = {}) => { const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows); - - _lodash.default.times(rows[0].length, index => { - if (_lodash.default.isUndefined(columns[index])) { + (0, _times2.default)(rows[0].length, index => { + if ((0, _isUndefined2.default)(columns[index])) { columns[index] = {}; } @@ -52,7 +55,6 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => { wrapWord: false }, columnDefault, columns[index]); }); - return columns; }; /** @@ -67,9 +69,7 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => { const makeConfig = (rows, userConfig = {}) => { (0, _validateConfig.default)('config.json', userConfig); - - const config = _lodash.default.cloneDeep(userConfig); - + const config = (0, _cloneDeep2.default)(userConfig); config.border = makeBorder(config.border); config.columns = makeColumns(rows, config.columns, config.columnDefault); diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js index 131c200c01e712..bc949c5a0d9fa3 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js @@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep")); + +var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined")); + +var _times2 = _interopRequireDefault(require("lodash/times")); var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); @@ -34,8 +38,8 @@ const makeBorder = (border = {}) => { const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { - _lodash.default.times(columnCount, index => { - if (_lodash.default.isUndefined(columns[index])) { + (0, _times2.default)(columnCount, index => { + if ((0, _isUndefined2.default)(columns[index])) { columns[index] = {}; } @@ -47,7 +51,6 @@ const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { wrapWord: false }, columnDefault, columns[index]); }); - return columns; }; /** @@ -78,8 +81,7 @@ const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { const makeStreamConfig = (userConfig = {}) => { (0, _validateConfig.default)('streamConfig.json', userConfig); - - const config = _lodash.default.cloneDeep(userConfig); + const config = (0, _cloneDeep2.default)(userConfig); if (!config.columnDefault || !config.columnDefault.width) { throw new Error('Must provide config.columnDefault.width when creating a stream.'); diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js index ce65717a78f0d0..0a4d11d509c7da 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _flatten2 = _interopRequireDefault(require("lodash/flatten")); + +var _times2 = _interopRequireDefault(require("lodash/times")); var _wrapCell = _interopRequireDefault(require("./wrapCell")); @@ -20,13 +22,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { const tableWidth = unmappedRows[0].length; const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = _lodash.default.times(rowHeightIndex[index0], () => { + const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => { return new Array(tableWidth).fill(''); }); // rowHeight // [{row index within rowSaw; index2}] // [{cell index within a virtual row; index1}] - cells.forEach((value, index1) => { const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); cellLines.forEach((cellLine, index2) => { @@ -35,7 +36,7 @@ const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { }); return rowHeight; }); - return _lodash.default.flatten(mappedRows); + return (0, _flatten2.default)(mappedRows); }; var _default = mapDataUsingRowHeightIndex; diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js index 210a124bcbffe2..89e1777a07b41f 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _lodash = _interopRequireDefault(require("lodash")); +var _truncate2 = _interopRequireDefault(require("lodash/truncate")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const truncateTableData = (rows, config) => { return rows.map(cells => { return cells.map((content, index) => { - return _lodash.default.truncate(content, { + return (0, _truncate2.default)(content, { length: config.columns[index].truncate }); }); diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index 6d2a7df80c04ac..917b063eccf7c2 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -26,6 +26,7 @@ "ajv-cli": "^3.0.0", "ajv-keywords": "^3.4.1", "babel-plugin-istanbul": "^5.1.4", + "babel-plugin-lodash": "^3.3.4", "babel-plugin-transform-export-default-name": "^2.0.4", "chai": "^4.2.0", "chalk": "^2.4.2", @@ -85,5 +86,5 @@ "lint": "npm run build && eslint ./src ./test && flow", "test": "mocha --require @babel/register" }, - "version": "5.4.4" + "version": "5.4.6" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/tmp/README.md b/tools/node_modules/eslint/node_modules/tmp/README.md index 8c4a768159b28b..810b04829d1bc3 100644 --- a/tools/node_modules/eslint/node_modules/tmp/README.md +++ b/tools/node_modules/eslint/node_modules/tmp/README.md @@ -46,7 +46,7 @@ tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) { console.log('File: ', path); console.log('Filedescriptor: ', fd); - + // If we don't need the file anymore we could manually call the cleanupCallback // But that is not necessary if we didn't pass the keep option because the library // will clean after itself. @@ -64,7 +64,7 @@ var tmp = require('tmp'); var tmpobj = tmp.fileSync(); console.log('File: ', tmpobj.name); console.log('Filedescriptor: ', tmpobj.fd); - + // If we don't need the file anymore we could manually call the removeCallback // But that is not necessary if we didn't pass the keep option because the library // will clean after itself. @@ -88,7 +88,7 @@ tmp.dir(function _tempDirCreated(err, path, cleanupCallback) { if (err) throw err; console.log('Dir: ', path); - + // Manual cleanup cleanupCallback(); }); diff --git a/tools/node_modules/eslint/node_modules/tmp/lib/tmp.js b/tools/node_modules/eslint/node_modules/tmp/lib/tmp.js index adf84e0442b374..41b83dbe3a2b02 100644 --- a/tools/node_modules/eslint/node_modules/tmp/lib/tmp.js +++ b/tools/node_modules/eslint/node_modules/tmp/lib/tmp.js @@ -268,7 +268,7 @@ function fileSync(options) { const name = tmpNameSync(opts); var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); if (opts.discardDescriptor) { - fs.closeSync(fd); + fs.closeSync(fd); fd = undefined; } diff --git a/tools/node_modules/eslint/node_modules/tslib/README.md b/tools/node_modules/eslint/node_modules/tslib/README.md index 84c47cab59d0aa..452862cf24e40e 100644 --- a/tools/node_modules/eslint/node_modules/tslib/README.md +++ b/tools/node_modules/eslint/node_modules/tslib/README.md @@ -102,19 +102,19 @@ You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: For JSPM users: ```json -{ - "compilerOptions": { - "module": "system", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["jspm_packages/npm/tslib@1.10.0/tslib.d.ts"] - } - } -} -``` - - +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.10.0/tslib.d.ts"] + } + } +} +``` + + # Contribute There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js index 08d746f54c02bb..5055a74cf85a4b 100644 --- a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js +++ b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js @@ -37,22 +37,22 @@ export var __assign = function() { } return __assign.apply(this, arguments); } - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } @@ -134,26 +134,26 @@ export function __read(o, n) { return ar; } -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.js b/tools/node_modules/eslint/node_modules/tslib/tslib.js index 1eae417046f6eb..34615c14f816b9 100644 --- a/tools/node_modules/eslint/node_modules/tslib/tslib.js +++ b/tools/node_modules/eslint/node_modules/tslib/tslib.js @@ -19,19 +19,19 @@ var __rest; var __decorate; var __param; var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; var __importDefault; (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; @@ -74,22 +74,22 @@ var __importDefault; } return t; }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; @@ -171,26 +171,26 @@ var __importDefault; return ar; }; - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } @@ -238,18 +238,18 @@ var __importDefault; exporter("__decorate", __decorate); exporter("__param", __param); exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); exporter("__importDefault", __importDefault); }); diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/README.md b/tools/node_modules/eslint/node_modules/v8-compile-cache/README.md index ad0ede6188c23a..9580f6943205e1 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/README.md +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/README.md @@ -46,7 +46,7 @@ _^ Includes the overhead of loading the cache itself._ ## Acknowledgements -* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: +* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js * `mkdirpSync` is based on: diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json index 30189995283fe8..ee9b001b78754b 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json @@ -38,5 +38,5 @@ "posttest": "npm run lint", "test": "tap test/*-test.js" }, - "version": "2.0.3" + "version": "2.1.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js b/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js index e7a226b8a91063..bd755d657d9ac7 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js @@ -188,7 +188,9 @@ class NativeCompileCache { // We skip the debugger setup because by the time we run, node has already // done that itself. - const args = [mod.exports, require, mod, filename, dirname, process, global]; + // `Buffer` is included for Electron. + // See https://github.com/zertosh/v8-compile-cache/pull/10#issuecomment-518042543 + const args = [mod.exports, require, mod, filename, dirname, process, global, Buffer]; return compiledWrapper.apply(mod.exports, args); }; } diff --git a/tools/node_modules/eslint/node_modules/xtend/README.md b/tools/node_modules/eslint/node_modules/xtend/README.md index ecae00d585cbd1..4a2703cff276b1 100644 --- a/tools/node_modules/eslint/node_modules/xtend/README.md +++ b/tools/node_modules/eslint/node_modules/xtend/README.md @@ -25,7 +25,7 @@ var combination = extend({ ## Stability status: Locked -## MIT Licensed +## MIT Licensed [3]: http://ci.testling.com/Raynos/xtend.png diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 88a2141a91afa4..60fd9b41e68408 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -19,9 +19,9 @@ "doctrine": "^3.0.0", "eslint-plugin-markdown": "^1.0.0", "eslint-scope": "^5.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^6.0.0", + "eslint-utils": "^1.4.2", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.1", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -55,7 +55,7 @@ "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", - "acorn": "^6.1.1", + "acorn": "^7.0.0", "babel-loader": "^8.0.5", "chai": "^4.0.1", "cheerio": "^0.22.0", @@ -149,5 +149,5 @@ "test": "node Makefile.js test", "webpack": "node Makefile.js webpack" }, - "version": "6.1.0" + "version": "6.2.2" } \ No newline at end of file From 83fb1332676c156933ee169623a56d154d9d6b8f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 28 Aug 2019 07:17:53 -0700 Subject: [PATCH 50/84] test: fix test-benchmark-net Fix test-benchmark-net to accommodate recent benchmark additions. PR-URL: https://github.com/nodejs/node/pull/29359 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- test/benchmark/test-benchmark-net.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/benchmark/test-benchmark-net.js b/test/benchmark/test-benchmark-net.js index 5d3d283fc7903e..f51c615b5df4f0 100644 --- a/test/benchmark/test-benchmark-net.js +++ b/test/benchmark/test-benchmark-net.js @@ -12,6 +12,9 @@ runBenchmark('net', [ 'dur=0', 'len=1024', + 'recvbufgenfn=false', + 'recvbuflen=0', + 'sendchunklen=256', 'type=buf' ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); From c900762fe49f1822999e4f764e6c6d589cb05792 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 19 Aug 2019 23:25:28 -0400 Subject: [PATCH 51/84] buffer: consolidate encoding parsing PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen --- lib/buffer.js | 359 ++++++++++++++++++++++----------------------- src/node_buffer.cc | 15 +- 2 files changed, 186 insertions(+), 188 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 7753e3239feeb0..85c2df49c8ca80 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -60,6 +60,8 @@ const { const { inspect: utilInspect } = require('internal/util/inspect'); +const { encodings } = internalBinding('string_decoder'); + const { codes: { @@ -109,6 +111,10 @@ 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); +for (let i = 0; i < encodings.length; ++i) + encodingsMap[encodings[i]] = i; + function createUnsafeBuffer(size) { zeroFill[0] = 0; try { @@ -376,28 +382,16 @@ function allocate(size) { return createUnsafeBuffer(size); } -function fromString(string, encoding) { - let length; - if (typeof encoding !== 'string' || encoding.length === 0) { - if (string.length === 0) - return new FastBuffer(); - encoding = 'utf8'; - length = byteLengthUtf8(string); - } else { - length = byteLength(string, encoding, true); - if (length === -1) - throw new ERR_UNKNOWN_ENCODING(encoding); - if (string.length === 0) - return new FastBuffer(); - } +function fromStringFast(string, ops) { + const length = ops.byteLength(string); if (length >= (Buffer.poolSize >>> 1)) - return createFromString(string, encoding); + return createFromString(string, ops.encodingVal); if (length > (poolSize - poolOffset)) createPool(); let b = new FastBuffer(allocPool, poolOffset, length); - const actual = b.write(string, encoding); + const actual = ops.write(b, string, 0, length); if (actual !== length) { // byteLength() may overestimate. That's a rare case, though. b = new FastBuffer(allocPool, poolOffset, actual); @@ -407,6 +401,23 @@ function fromString(string, encoding) { return b; } +function fromString(string, encoding) { + let ops; + if (typeof encoding !== 'string' || encoding.length === 0) { + if (string.length === 0) + return new FastBuffer(); + ops = encodingOps.utf8; + encoding = undefined; + } else { + ops = getEncodingOps(encoding); + if (ops === undefined) + throw new ERR_UNKNOWN_ENCODING(encoding); + if (string.length === 0) + return new FastBuffer(); + } + return fromStringFast(string, ops); +} + function fromArrayLike(obj) { const length = obj.length; const b = allocate(length); @@ -553,64 +564,149 @@ function base64ByteLength(str, bytes) { return (bytes * 3) >>> 2; } -function byteLength(string, encoding) { - if (typeof string !== 'string') { - if (isArrayBufferView(string) || isAnyArrayBuffer(string)) { - return string.byteLength; - } - - throw new ERR_INVALID_ARG_TYPE( - 'string', ['string', 'Buffer', 'ArrayBuffer'], string - ); +const encodingOps = { + utf8: { + encoding: 'utf8', + encodingVal: encodingsMap.utf8, + byteLength: byteLengthUtf8, + write: (buf, string, offset, len) => buf.utf8Write(string, offset, len), + slice: (buf, start, end) => buf.utf8Slice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfString(buf, val, byteOffset, encodingsMap.utf8, dir) + }, + ucs2: { + encoding: 'ucs2', + encodingVal: encodingsMap.utf16le, + byteLength: (string) => string.length * 2, + write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len), + slice: (buf, start, end) => buf.ucs2Slice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir) + }, + utf16le: { + encoding: 'utf16le', + encodingVal: encodingsMap.utf16le, + byteLength: (string) => string.length * 2, + write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len), + slice: (buf, start, end) => buf.ucs2Slice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir) + }, + latin1: { + encoding: 'latin1', + encodingVal: encodingsMap.latin1, + byteLength: (string) => string.length, + write: (buf, string, offset, len) => buf.latin1Write(string, offset, len), + slice: (buf, start, end) => buf.latin1Slice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir) + }, + ascii: { + encoding: 'ascii', + encodingVal: encodingsMap.ascii, + byteLength: (string) => string.length, + write: (buf, string, offset, len) => buf.asciiWrite(string, offset, len), + slice: (buf, start, end) => buf.asciiSlice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfBuffer(buf, + fromStringFast(val, encodingOps.ascii), + byteOffset, + encodingsMap.ascii, + dir) + }, + base64: { + encoding: 'base64', + encodingVal: encodingsMap.base64, + byteLength: (string) => base64ByteLength(string, string.length), + write: (buf, string, offset, len) => buf.base64Write(string, offset, len), + slice: (buf, start, end) => buf.base64Slice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfBuffer(buf, + fromStringFast(val, encodingOps.base64), + byteOffset, + encodingsMap.base64, + dir) + }, + hex: { + encoding: 'hex', + encodingVal: encodingsMap.hex, + byteLength: (string) => string.length >>> 1, + write: (buf, string, offset, len) => buf.hexWrite(string, offset, len), + slice: (buf, start, end) => buf.hexSlice(start, end), + indexOf: (buf, val, byteOffset, dir) => + indexOfBuffer(buf, + fromStringFast(val, encodingOps.hex), + byteOffset, + encodingsMap.hex, + dir) } - - const len = string.length; - const mustMatch = (arguments.length > 2 && arguments[2] === true); - if (!mustMatch && len === 0) - return 0; - - if (!encoding) - return (mustMatch ? -1 : byteLengthUtf8(string)); - +}; +function getEncodingOps(encoding) { encoding += ''; switch (encoding.length) { case 4: - if (encoding === 'utf8') return byteLengthUtf8(string); - if (encoding === 'ucs2') return len * 2; + if (encoding === 'utf8') return encodingOps.utf8; + if (encoding === 'ucs2') return encodingOps.ucs2; encoding = encoding.toLowerCase(); - if (encoding === 'utf8') return byteLengthUtf8(string); - if (encoding === 'ucs2') return len * 2; + if (encoding === 'utf8') return encodingOps.utf8; + if (encoding === 'ucs2') return encodingOps.ucs2; break; case 5: - if (encoding === 'utf-8') return byteLengthUtf8(string); - if (encoding === 'ascii') return len; - if (encoding === 'ucs-2') return len * 2; + if (encoding === 'utf-8') return encodingOps.utf8; + if (encoding === 'ascii') return encodingOps.ascii; + if (encoding === 'ucs-2') return encodingOps.ucs2; encoding = encoding.toLowerCase(); - if (encoding === 'utf-8') return byteLengthUtf8(string); - if (encoding === 'ascii') return len; - if (encoding === 'ucs-2') return len * 2; + if (encoding === 'utf-8') return encodingOps.utf8; + if (encoding === 'ascii') return encodingOps.ascii; + if (encoding === 'ucs-2') return encodingOps.ucs2; break; case 7: if (encoding === 'utf16le' || encoding.toLowerCase() === 'utf16le') - return len * 2; + return encodingOps.utf16le; break; case 8: if (encoding === 'utf-16le' || encoding.toLowerCase() === 'utf-16le') - return len * 2; + return encodingOps.utf16le; break; case 6: - if (encoding === 'latin1' || encoding === 'binary') return len; - if (encoding === 'base64') return base64ByteLength(string, len); + if (encoding === 'latin1' || encoding === 'binary') + return encodingOps.latin1; + if (encoding === 'base64') return encodingOps.base64; encoding = encoding.toLowerCase(); - if (encoding === 'latin1' || encoding === 'binary') return len; - if (encoding === 'base64') return base64ByteLength(string, len); + if (encoding === 'latin1' || encoding === 'binary') + return encodingOps.latin1; + if (encoding === 'base64') return encodingOps.base64; break; case 3: if (encoding === 'hex' || encoding.toLowerCase() === 'hex') - return len >>> 1; + return encodingOps.hex; break; } - return (mustMatch ? -1 : byteLengthUtf8(string)); +} + +function byteLength(string, encoding) { + if (typeof string !== 'string') { + if (isArrayBufferView(string) || isAnyArrayBuffer(string)) { + return string.byteLength; + } + + throw new ERR_INVALID_ARG_TYPE( + 'string', ['string', 'Buffer', 'ArrayBuffer'], string + ); + } + + const len = string.length; + const mustMatch = (arguments.length > 2 && arguments[2] === true); + if (!mustMatch && len === 0) + return 0; + + if (!encoding) + return (mustMatch ? -1 : byteLengthUtf8(string)); + + const ops = getEncodingOps(encoding); + if (ops === undefined) + return (mustMatch ? -1 : byteLengthUtf8(string)); + return ops.byteLength(string); } Buffer.byteLength = byteLength; @@ -633,51 +729,6 @@ Object.defineProperty(Buffer.prototype, 'offset', { } }); -function stringSlice(buf, encoding, start, end) { - if (encoding === undefined) return buf.utf8Slice(start, end); - encoding += ''; - switch (encoding.length) { - case 4: - if (encoding === 'utf8') return buf.utf8Slice(start, end); - if (encoding === 'ucs2') return buf.ucs2Slice(start, end); - encoding = encoding.toLowerCase(); - if (encoding === 'utf8') return buf.utf8Slice(start, end); - if (encoding === 'ucs2') return buf.ucs2Slice(start, end); - break; - case 5: - if (encoding === 'utf-8') return buf.utf8Slice(start, end); - if (encoding === 'ascii') return buf.asciiSlice(start, end); - if (encoding === 'ucs-2') return buf.ucs2Slice(start, end); - encoding = encoding.toLowerCase(); - if (encoding === 'utf-8') return buf.utf8Slice(start, end); - if (encoding === 'ascii') return buf.asciiSlice(start, end); - if (encoding === 'ucs-2') return buf.ucs2Slice(start, end); - break; - case 6: - if (encoding === 'latin1' || encoding === 'binary') - return buf.latin1Slice(start, end); - if (encoding === 'base64') return buf.base64Slice(start, end); - encoding = encoding.toLowerCase(); - if (encoding === 'latin1' || encoding === 'binary') - return buf.latin1Slice(start, end); - if (encoding === 'base64') return buf.base64Slice(start, end); - break; - case 3: - if (encoding === 'hex' || encoding.toLowerCase() === 'hex') - return buf.hexSlice(start, end); - break; - case 7: - if (encoding === 'utf16le' || encoding.toLowerCase() === 'utf16le') - return buf.ucs2Slice(start, end); - break; - case 8: - if (encoding === 'utf-16le' || encoding.toLowerCase() === 'utf-16le') - return buf.ucs2Slice(start, end); - break; - } - throw new ERR_UNKNOWN_ENCODING(encoding); -} - Buffer.prototype.copy = function copy(target, targetStart, sourceStart, sourceEnd) { return _copy(this, target, targetStart, sourceStart, sourceEnd); @@ -708,7 +759,15 @@ Buffer.prototype.toString = function toString(encoding, start, end) { if (end <= start) return ''; - return stringSlice(this, encoding, start, end); + + if (encoding === undefined) + return this.utf8Slice(start, end); + + const ops = getEncodingOps(encoding); + if (ops === undefined) + throw new ERR_UNKNOWN_ENCODING(encoding); + + return ops.slice(this, start, end); }; Buffer.prototype.equals = function equals(otherBuffer) { @@ -826,15 +885,25 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { } dir = !!dir; // Cast to bool. - if (typeof val === 'string') { - if (encoding === undefined) { - return indexOfString(buffer, val, byteOffset, encoding, dir); - } - return slowIndexOf(buffer, val, byteOffset, encoding, dir); - } else if (isUint8Array(val)) { - return indexOfBuffer(buffer, val, byteOffset, encoding, dir); - } else if (typeof val === 'number') { + if (typeof val === 'number') return indexOfNumber(buffer, val >>> 0, byteOffset, dir); + + let ops; + if (encoding === undefined) + ops = encodingOps.utf8; + else + ops = getEncodingOps(encoding); + + if (typeof val === 'string') { + if (ops === undefined) + throw new ERR_UNKNOWN_ENCODING(encoding); + return ops.indexOf(buffer, val, byteOffset, dir); + } + + if (isUint8Array(val)) { + const encodingVal = + (ops === undefined ? encodingsMap.utf8 : ops.encodingVal); + return indexOfBuffer(buffer, val, byteOffset, encodingVal, dir); } throw new ERR_INVALID_ARG_TYPE( @@ -842,37 +911,6 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { ); } -function slowIndexOf(buffer, val, byteOffset, encoding, dir) { - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'utf8': - case 'utf-8': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - case 'latin1': - case 'binary': - return indexOfString(buffer, val, byteOffset, encoding, dir); - - case 'base64': - case 'ascii': - case 'hex': - return indexOfBuffer( - buffer, Buffer.from(val, encoding), byteOffset, encoding, dir); - - default: - if (loweredCase) { - throw new ERR_UNKNOWN_ENCODING(encoding); - } - - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } -} - Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true); }; @@ -985,49 +1023,10 @@ Buffer.prototype.write = function write(string, offset, length, encoding) { if (!encoding) return this.utf8Write(string, offset, length); - encoding += ''; - switch (encoding.length) { - case 4: - if (encoding === 'utf8') return this.utf8Write(string, offset, length); - if (encoding === 'ucs2') return this.ucs2Write(string, offset, length); - encoding = encoding.toLowerCase(); - if (encoding === 'utf8') return this.utf8Write(string, offset, length); - if (encoding === 'ucs2') return this.ucs2Write(string, offset, length); - break; - case 5: - if (encoding === 'utf-8') return this.utf8Write(string, offset, length); - if (encoding === 'ascii') return this.asciiWrite(string, offset, length); - if (encoding === 'ucs-2') return this.ucs2Write(string, offset, length); - encoding = encoding.toLowerCase(); - if (encoding === 'utf-8') return this.utf8Write(string, offset, length); - if (encoding === 'ascii') return this.asciiWrite(string, offset, length); - if (encoding === 'ucs-2') return this.ucs2Write(string, offset, length); - break; - case 7: - if (encoding === 'utf16le' || encoding.toLowerCase() === 'utf16le') - return this.ucs2Write(string, offset, length); - break; - case 8: - if (encoding === 'utf-16le' || encoding.toLowerCase() === 'utf-16le') - return this.ucs2Write(string, offset, length); - break; - case 6: - if (encoding === 'latin1' || encoding === 'binary') - return this.latin1Write(string, offset, length); - if (encoding === 'base64') - return this.base64Write(string, offset, length); - encoding = encoding.toLowerCase(); - if (encoding === 'latin1' || encoding === 'binary') - return this.latin1Write(string, offset, length); - if (encoding === 'base64') - return this.base64Write(string, offset, length); - break; - case 3: - if (encoding === 'hex' || encoding.toLowerCase() === 'hex') - return this.hexWrite(string, offset, length); - break; - } - throw new ERR_UNKNOWN_ENCODING(encoding); + const ops = getEncodingOps(encoding); + if (ops === undefined) + throw new ERR_UNKNOWN_ENCODING(encoding); + return ops.write(this, string, offset, length); }; Buffer.prototype.toJSON = function toJSON() { diff --git a/src/node_buffer.cc b/src/node_buffer.cc index e6a88f649895e8..7332b0b34b035e 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -63,6 +63,7 @@ using v8::Context; using v8::EscapableHandleScope; using v8::FunctionCallbackInfo; using v8::Global; +using v8::Int32; using v8::Integer; using v8::Isolate; using v8::Just; @@ -446,11 +447,9 @@ namespace { void CreateFromString(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); - CHECK(args[1]->IsString()); + CHECK(args[1]->IsInt32()); - enum encoding enc = ParseEncoding(args.GetIsolate(), - args[1].As(), - UTF8); + enum encoding enc = static_cast(args[1].As()->Value()); Local buf; if (New(args.GetIsolate(), args[0].As(), enc).ToLocal(&buf)) args.GetReturnValue().Set(buf); @@ -786,9 +785,10 @@ void IndexOfString(const FunctionCallbackInfo& args) { CHECK(args[1]->IsString()); CHECK(args[2]->IsNumber()); + CHECK(args[3]->IsInt32()); CHECK(args[4]->IsBoolean()); - enum encoding enc = ParseEncoding(isolate, args[3], UTF8); + enum encoding enc = static_cast(args[3].As()->Value()); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); ArrayBufferViewContents buffer(args[0]); @@ -900,11 +900,10 @@ void IndexOfString(const FunctionCallbackInfo& args) { void IndexOfBuffer(const FunctionCallbackInfo& args) { CHECK(args[1]->IsObject()); CHECK(args[2]->IsNumber()); + CHECK(args[3]->IsInt32()); CHECK(args[4]->IsBoolean()); - enum encoding enc = ParseEncoding(args.GetIsolate(), - args[3], - UTF8); + enum encoding enc = static_cast(args[3].As()->Value()); THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[1]); From 71aaf590c13d597add3d34f41c8fe70e909ba385 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 19 Aug 2019 23:26:11 -0400 Subject: [PATCH 52/84] buffer: correct indexOf() error message PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen --- lib/buffer.js | 2 +- test/parallel/test-bootstrap-modules.js | 1 + test/parallel/test-buffer-includes.js | 2 +- test/parallel/test-buffer-indexof.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 85c2df49c8ca80..ce2d7c63b5b911 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -907,7 +907,7 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { } throw new ERR_INVALID_ARG_TYPE( - 'value', ['string', 'Buffer', 'Uint8Array'], val + 'value', ['number', 'string', 'Buffer', 'Uint8Array'], val ); } diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index 24ba7d34f57981..69aae7f9b7044d 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -22,6 +22,7 @@ const expectedModules = new Set([ 'Internal Binding native_module', 'Internal Binding options', 'Internal Binding process_methods', + 'Internal Binding string_decoder', 'Internal Binding task_queue', 'Internal Binding timers', 'Internal Binding trace_events', diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index ca5b94f9d9fa46..794822f13ac873 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -282,7 +282,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "value" argument must be one of type string, ' + + message: 'The "value" argument must be one of type number, string, ' + `Buffer, or Uint8Array. Received type ${typeof val}` } ); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 44787d73aab298..3059e13780e5bd 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -357,7 +357,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "value" argument must be one of type string, ' + + message: 'The "value" argument must be one of type number, string, ' + `Buffer, or Uint8Array. Received type ${typeof val}` } ); From 5abbd51c609d4c814276e09e1bac9721ccc62a93 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 25 Aug 2019 21:44:59 +0200 Subject: [PATCH 53/84] util: do not throw when inspecting detached ArrayBuffer PR-URL: https://github.com/nodejs/node/pull/29318 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Jeremiah Senkpiel Reviewed-By: Gus Caplan --- lib/internal/util/inspect.js | 7 ++++++- test/parallel/test-util-inspect.js | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 20bdc33786054f..0319697d3270d0 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1164,7 +1164,12 @@ function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) { } function formatArrayBuffer(ctx, value) { - const buffer = new Uint8Array(value); + let buffer; + try { + buffer = new Uint8Array(value); + } catch { + return [ctx.stylize('(detached)', 'special')]; + } if (hexSlice === undefined) hexSlice = uncurryThis(require('buffer').Buffer.prototype.hexSlice); let str = hexSlice(buffer, 0, Math.min(ctx.maxArrayLength, buffer.length)) diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index f4f76a4981488f..4cb8224c541f45 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -28,6 +28,7 @@ const util = require('util'); const vm = require('vm'); const { previewEntries } = internalBinding('util'); const { inspect } = util; +const { MessageChannel } = require('worker_threads'); assert.strictEqual(util.inspect(1), '1'); assert.strictEqual(util.inspect(false), 'false'); @@ -198,6 +199,15 @@ assert(!/Object/.test( ' y: 1337\n}'); } +{ + const ab = new ArrayBuffer(42); + assert.strictEqual(ab.byteLength, 42); + new MessageChannel().port1.postMessage(ab, [ ab ]); + assert.strictEqual(ab.byteLength, 0); + assert.strictEqual(util.inspect(ab), + 'ArrayBuffer { (detached), byteLength: 0 }'); +} + // Now do the same checks but from a different context. { const showHidden = false; From d6b6a0578b513cde2b2d348a30580b83c61afeac Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 25 Aug 2019 16:49:46 +0100 Subject: [PATCH 54/84] build: integrate DragonFlyBSD into gyp build PR-URL: https://github.com/nodejs/node/pull/29313 Reviewed-By: Richard Lau Reviewed-By: Ben Noordhuis --- tools/gyp/pylib/gyp/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/gyp/pylib/gyp/common.py b/tools/gyp/pylib/gyp/common.py index cfee9d45923b65..e6280d2476cf67 100644 --- a/tools/gyp/pylib/gyp/common.py +++ b/tools/gyp/pylib/gyp/common.py @@ -421,6 +421,8 @@ def GetFlavor(params): return 'solaris' if sys.platform.startswith('freebsd'): return 'freebsd' + if sys.platform.startswith('dragonfly'): + return 'freebsd' if sys.platform.startswith('openbsd'): return 'openbsd' if sys.platform.startswith('netbsd'): From 5c3e49d84e4d89205e2c4d30fa790b81e8e1e507 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 26 Aug 2019 12:18:50 -0700 Subject: [PATCH 55/84] crypto: don't expose openssl internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/29325 Reviewed-By: Ujjwal Sharma Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Tobias Nießen --- src/node_crypto.cc | 15 ++++++++++----- src/node_crypto.h | 2 +- src/node_errors.h | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 6786c598c1def2..e32cdac70c99b0 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -5200,7 +5200,7 @@ template & args) { const node::Utf8Value oaep_str(env->isolate(), args[offset + 2]); const char* oaep_hash = args[offset + 2]->IsString() ? *oaep_str : nullptr; + const EVP_MD* digest = nullptr; + if (oaep_hash != nullptr) { + digest = EVP_get_digestbyname(oaep_hash); + if (digest == nullptr) + return THROW_ERR_OSSL_EVP_INVALID_DIGEST(env); + } AllocatedBuffer out; @@ -5265,7 +5270,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { env, pkey, padding, - oaep_hash, + digest, buf.data(), buf.length(), &out); diff --git a/src/node_crypto.h b/src/node_crypto.h index a121c8229595ca..99e6c481177c19 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -713,7 +713,7 @@ class PublicKeyCipher { static bool Cipher(Environment* env, const ManagedEVPPKey& pkey, int padding, - const char* oaep_hash, + const EVP_MD* digest, const unsigned char* data, int len, AllocatedBuffer* out); diff --git a/src/node_errors.h b/src/node_errors.h index 939f93a4899f59..261c6077bb8054 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -42,6 +42,7 @@ void PrintErrorString(const char* format, ...); V(ERR_CONSTRUCT_CALL_REQUIRED, TypeError) \ V(ERR_CONSTRUCT_CALL_INVALID, TypeError) \ V(ERR_INVALID_ARG_VALUE, TypeError) \ + V(ERR_OSSL_EVP_INVALID_DIGEST, Error) \ V(ERR_INVALID_ARG_TYPE, TypeError) \ V(ERR_INVALID_MODULE_SPECIFIER, TypeError) \ V(ERR_INVALID_PACKAGE_CONFIG, SyntaxError) \ @@ -89,6 +90,7 @@ void PrintErrorString(const char* format, ...); V(ERR_CONSTRUCT_CALL_REQUIRED, "Cannot call constructor without `new`") \ V(ERR_INVALID_TRANSFER_OBJECT, "Found invalid object in transferList") \ V(ERR_MEMORY_ALLOCATION_FAILED, "Failed to allocate memory") \ + V(ERR_OSSL_EVP_INVALID_DIGEST, "Invalid digest used") \ V(ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST, \ "MessagePort was found in message but not listed in transferList") \ V(ERR_MISSING_PLATFORM_FOR_WORKER, \ From bb72217faf08d336307d551f26b591383c1fe5af Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 27 Aug 2019 00:07:14 -0400 Subject: [PATCH 56/84] doc: heading levels should only increment by one These are flagged by Markdownlint MD001 rule. PR-URL: https://github.com/nodejs/node/pull/29331 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- CHANGELOG.md | 2 +- doc/guides/node-postmortem-support.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e6ecf89047f0..02273c6b60958f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,7 +105,7 @@ release. -### Notes +## Notes * The [Node.js Long Term Support plan](https://github.com/nodejs/Release) covers LTS releases. diff --git a/doc/guides/node-postmortem-support.md b/doc/guides/node-postmortem-support.md index 9a4370016ce64a..bc9ff51949284e 100644 --- a/doc/guides/node-postmortem-support.md +++ b/doc/guides/node-postmortem-support.md @@ -6,14 +6,14 @@ when analyzing its memory (either on a running process or a core dump). Node.js provides this metadata in its builds for V8 and Node.js internal structures. -### V8 Postmortem metadata +## V8 Postmortem metadata V8 prefixes all postmortem constants with `v8dbg_`, and they allow inspection of objects on the heap as well as object properties and references. V8 generates those symbols with a script (`deps/v8/tools/gen-postmortem-metadata.py`), and Node.js always includes these constants in the final build. -### Node.js Debug Symbols +## Node.js Debug Symbols Node.js prefixes all postmortem constants with `nodedbg_`, and they complement V8 constants by providing ways to inspect Node.js-specific structures, like @@ -22,7 +22,7 @@ V8 constants by providing ways to inspect Node.js-specific structures, like `src/node_postmortem_metadata.cc`, and most of them are calculated at compile time. -#### Calculating offset of class members +### Calculating offset of class members Node.js constants referring to the offset of class members in memory are calculated at compile time. From 43797d9427383f3f9cef7d3119509ee6e47a1f58 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 26 Aug 2019 23:56:15 -0400 Subject: [PATCH 57/84] doc: inconsistent indentation for list items Items at same level should have consistent indentation level. Addresses Markdownlint MD005 errors. PR-URL: https://github.com/nodejs/node/pull/29330 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/changelogs/CHANGELOG_IOJS.md | 2 +- doc/changelogs/CHANGELOG_V4.md | 4 ++-- doc/guides/diagnostic-tooling-support-tiers.md | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/changelogs/CHANGELOG_IOJS.md b/doc/changelogs/CHANGELOG_IOJS.md index b8e346b76bad55..7e5d9f54f16ad9 100644 --- a/doc/changelogs/CHANGELOG_IOJS.md +++ b/doc/changelogs/CHANGELOG_IOJS.md @@ -2241,7 +2241,7 @@ _Note: version **1.4.0** was tagged and built but not released. A libuv bug was [#7226](https://github.com/npm/npm/issues/7226) Ensure that all request settings are copied onto the agent. ([@othiym23](https://github.com/othiym23)) - - [npm/fec4c96](https://github.com/npm/npm/commit/fec4c967ee235030bf31393e8605e9e2811f4a39) + - [npm/fec4c96](https://github.com/npm/npm/commit/fec4c967ee235030bf31393e8605e9e2811f4a39) Allow `--no-proxy` to override `HTTP_PROXY` setting in environment. ([@othiym23](https://github.com/othiym23)) - [npm/9d61e96](https://github.com/npm/npm/commit/9d61e96fb1f48687a85c211e4e0cd44c7f95a38e) diff --git a/doc/changelogs/CHANGELOG_V4.md b/doc/changelogs/CHANGELOG_V4.md index a28e0451ad5d3a..9ec422f98f6703 100644 --- a/doc/changelogs/CHANGELOG_V4.md +++ b/doc/changelogs/CHANGELOG_V4.md @@ -1283,8 +1283,8 @@ Semver Patch: Semver Minor: * **buffer**: - * backport new buffer constructor APIs to v4.x (Сковорода Никита Андреевич) [#7562](https://github.com/nodejs/node/pull/7562) - * backport --zero-fill-buffers cli option (James M Snell) [#5745](https://github.com/nodejs/node/pull/5745) + * backport new buffer constructor APIs to v4.x (Сковорода Никита Андреевич) [#7562](https://github.com/nodejs/node/pull/7562) + * backport --zero-fill-buffers cli option (James M Snell) [#5745](https://github.com/nodejs/node/pull/5745) * **build**: * add Intel Vtune profiling support (Chunyang Dai) [#5527](https://github.com/nodejs/node/pull/5527) * **repl**: diff --git a/doc/guides/diagnostic-tooling-support-tiers.md b/doc/guides/diagnostic-tooling-support-tiers.md index 17c342fabe16bd..87a8b9dd67e3b4 100644 --- a/doc/guides/diagnostic-tooling-support-tiers.md +++ b/doc/guides/diagnostic-tooling-support-tiers.md @@ -43,14 +43,14 @@ the following tiers. organization or website; * The tool must be open source. - * Tier 3 - If possible its test suite - will be run at least nightly in the Node.js CI and issues opened for - failures. Does not block shipping a release. +* Tier 3 - If possible its test suite + will be run at least nightly in the Node.js CI and issues opened for + failures. Does not block shipping a release. - * Tier 4 - Does not block shipping a release. +* Tier 4 - Does not block shipping a release. - * Unclassified - tool/API is new or does not have the required testing in the - Node.js CI in order to qualify for a higher tier. +* Unclassified - tool/API is new or does not have the required testing in the + Node.js CI in order to qualify for a higher tier. The choice of which tier a particular tool will be assigned to, will be a collaborative decision between Diagnostics WG and Release WG. Some of the From a94afedc9b5ef5f2a1448f2b2e4c65531dc0b5dc Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 29 Aug 2019 21:05:17 +0100 Subject: [PATCH 58/84] doc: add devnexen to collaborators PR-URL: https://github.com/nodejs/node/pull/29370 Reviewed-By: Rich Trott Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0efc6b30f04c37..4bb70abceee59e 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,8 @@ For information about the governance of the Node.js project, see **David Cai** <davidcai1993@yahoo.com> (he/him) * [davisjam](https://github.com/davisjam) - **Jamie Davis** <davisjam@vt.edu> (he/him) +* [devnexen](https://github.com/devnexen) - +**David Carlier** <devnexen@gmail.com> * [devsnek](https://github.com/devsnek) - **Gus Caplan** <me@gus.host> (he/him) * [digitalinfinity](https://github.com/digitalinfinity) - From ae810cc8d5d3dcb04b30db0c229422cc5b3ec873 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 24 Aug 2019 18:16:48 -0700 Subject: [PATCH 59/84] doc,crypto: add extends for derived classes PR-URL: https://github.com/nodejs/node/pull/29302 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 12 ++++++++++++ tools/doc/type-parser.js | 1 + 2 files changed, 13 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 9dadac3946447d..6db84e4af7362e 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -169,6 +169,8 @@ console.log(cert.verifySpkac(Buffer.from(spkac))); added: v0.1.94 --> +* Extends: {stream.Transform} + Instances of the `Cipher` class are used to encrypt data. The class can be used in one of two ways: @@ -354,6 +356,8 @@ The `cipher.update()` method can be called multiple times with new data until added: v0.1.94 --> +* Extends: {stream.Transform} + Instances of the `Decipher` class are used to decrypt data. The class can be used in one of two ways: @@ -950,6 +954,8 @@ console.log(aliceSecret === bobSecret); added: v0.1.92 --> +* Extends: {stream.Transform} + The `Hash` class is a utility for creating hash digests of data. It can be used in one of two ways: @@ -1044,6 +1050,8 @@ This can be called many times with new data as it is streamed. added: v0.1.94 --> +* Extends: {stream.Transform} + The `Hmac` class is a utility for creating cryptographic HMAC digests. It can be used in one of two ways: @@ -1252,6 +1260,8 @@ or `'private'` for private (asymmetric) keys. added: v0.1.92 --> +* Extends: {stream.Writable} + The `Sign` class is a utility for generating signatures. It can be used in one of two ways: @@ -1377,6 +1387,8 @@ This can be called many times with new data as it is streamed. added: v0.1.92 --> +* Extends: {stream.Writable} + The `Verify` class is a utility for verifying signatures. It can be used in one of two ways: diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index c2c1147639bba7..35039b68d95c8f 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -123,6 +123,7 @@ const customTypesMap = { 'Stream': 'stream.html#stream_stream', 'stream.Duplex': 'stream.html#stream_class_stream_duplex', 'stream.Readable': 'stream.html#stream_class_stream_readable', + 'stream.Transform': 'stream.html#stream_class_stream_transform', 'stream.Writable': 'stream.html#stream_class_stream_writable', 'Immediate': 'timers.html#timers_class_immediate', From 28ffc9f599a877afecde47a171cb960834296de5 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Thu, 29 Aug 2019 07:31:26 -0700 Subject: [PATCH 60/84] deps: V8: cherry-pick 597f885 Original commit message: [coverage] Deterministically sort collected shared function infos Prior to this CL, collected shared function infos with identical source ranges were sorted non-deterministically during coverage collection. This lead to non-deterministically incorrectly-reported coverage due to an optimization which depended on the sort order later on. With this CL, we now sort shared function infos by the source range *and* call count. Bug: v8:6000,v8:9212 Change-Id: If8bf900727591e71dbd0df621e472a4303f3a353 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1771776 Reviewed-by: Yang Guo Commit-Queue: Jakob Gruber Cr-Commit-Position: refs/heads/master@{#63411} Refs: https://github.com/v8/v8/commit/597f885eaa6189f8c8466ee9916763c679e84e9a PR-URL: https://github.com/nodejs/node/pull/29367 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Ben Noordhuis --- common.gypi | 2 +- deps/v8/src/debug/debug-coverage.cc | 124 ++++++++++++++++++---------- 2 files changed, 81 insertions(+), 45 deletions(-) diff --git a/common.gypi b/common.gypi index 6c4b04d7d06ecc..b86e5e05d7df9a 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.15', + 'v8_embedder_string': '-node.16', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/debug/debug-coverage.cc b/deps/v8/src/debug/debug-coverage.cc index 4021cd503898ce..24aa617524d011 100644 --- a/deps/v8/src/debug/debug-coverage.cc +++ b/deps/v8/src/debug/debug-coverage.cc @@ -54,13 +54,6 @@ int StartPosition(SharedFunctionInfo info) { return start; } -bool CompareSharedFunctionInfo(SharedFunctionInfo a, SharedFunctionInfo b) { - int a_start = StartPosition(a); - int b_start = StartPosition(b); - if (a_start == b_start) return a.EndPosition() > b.EndPosition(); - return a_start < b_start; -} - bool CompareCoverageBlock(const CoverageBlock& a, const CoverageBlock& b) { DCHECK_NE(kNoSourcePosition, a.start); DCHECK_NE(kNoSourcePosition, b.start); @@ -481,32 +474,12 @@ void CollectBlockCoverage(CoverageFunction* function, SharedFunctionInfo info, // Reset all counters on the DebugInfo to zero. ResetAllBlockCounts(info); } -} // anonymous namespace - -std::unique_ptr Coverage::CollectPrecise(Isolate* isolate) { - DCHECK(!isolate->is_best_effort_code_coverage()); - std::unique_ptr result = - Collect(isolate, isolate->code_coverage_mode()); - if (!isolate->is_collecting_type_profile() && - (isolate->is_precise_binary_code_coverage() || - isolate->is_block_binary_code_coverage())) { - // We do not have to hold onto feedback vectors for invocations we already - // reported. So we can reset the list. - isolate->SetFeedbackVectorsForProfilingTools(*ArrayList::New(isolate, 0)); - } - return result; -} - -std::unique_ptr Coverage::CollectBestEffort(Isolate* isolate) { - return Collect(isolate, v8::debug::CoverageMode::kBestEffort); -} - -std::unique_ptr Coverage::Collect( - Isolate* isolate, v8::debug::CoverageMode collectionMode) { - SharedToCounterMap counter_map; +void CollectAndMaybeResetCounts(Isolate* isolate, + SharedToCounterMap* counter_map, + v8::debug::CoverageMode coverage_mode) { const bool reset_count = - collectionMode != v8::debug::CoverageMode::kBestEffort; + coverage_mode != v8::debug::CoverageMode::kBestEffort; switch (isolate->code_coverage_mode()) { case v8::debug::CoverageMode::kBlockBinary: @@ -525,7 +498,7 @@ std::unique_ptr Coverage::Collect( DCHECK(shared.IsSubjectToDebugging()); uint32_t count = static_cast(vector.invocation_count()); if (reset_count) vector.clear_invocation_count(); - counter_map.Add(shared, count); + counter_map->Add(shared, count); } break; } @@ -533,7 +506,7 @@ std::unique_ptr Coverage::Collect( DCHECK(!isolate->factory() ->feedback_vectors_for_profiling_tools() ->IsArrayList()); - DCHECK_EQ(v8::debug::CoverageMode::kBestEffort, collectionMode); + DCHECK_EQ(v8::debug::CoverageMode::kBestEffort, coverage_mode); HeapIterator heap_iterator(isolate->heap()); for (HeapObject current_obj = heap_iterator.next(); !current_obj.is_null(); current_obj = heap_iterator.next()) { @@ -542,8 +515,9 @@ std::unique_ptr Coverage::Collect( SharedFunctionInfo shared = func.shared(); if (!shared.IsSubjectToDebugging()) continue; if (!(func.has_feedback_vector() || - func.has_closure_feedback_cell_array())) + func.has_closure_feedback_cell_array())) { continue; + } uint32_t count = 0; if (func.has_feedback_vector()) { count = @@ -554,7 +528,7 @@ std::unique_ptr Coverage::Collect( // atleast once. We don't have precise invocation count here. count = 1; } - counter_map.Add(shared, count); + counter_map->Add(shared, count); } // Also check functions on the stack to collect the count map. With lazy @@ -563,12 +537,64 @@ std::unique_ptr Coverage::Collect( // updated (i.e. it didn't execute return / jump). for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) { SharedFunctionInfo shared = it.frame()->function().shared(); - if (counter_map.Get(shared) != 0) continue; - counter_map.Add(shared, 1); + if (counter_map->Get(shared) != 0) continue; + counter_map->Add(shared, 1); } break; } } +} + +// A {SFI, count} tuple is used to sort by source range (stored on +// the SFI) and call count (in the counter map). +struct SharedFunctionInfoAndCount { + SharedFunctionInfoAndCount(SharedFunctionInfo info, uint32_t count) + : info(info), + count(count), + start(StartPosition(info)), + end(info.EndPosition()) {} + + // Sort by: + // - start, ascending. + // - end, descending. + // - count, ascending. + bool operator<(const SharedFunctionInfoAndCount& that) const { + if (this->start != that.start) return this->start < that.start; + if (this->end != that.end) return this->end > that.end; + return this->count < that.count; + } + + SharedFunctionInfo info; + uint32_t count; + int start; + int end; +}; + +} // anonymous namespace + +std::unique_ptr Coverage::CollectPrecise(Isolate* isolate) { + DCHECK(!isolate->is_best_effort_code_coverage()); + std::unique_ptr result = + Collect(isolate, isolate->code_coverage_mode()); + if (!isolate->is_collecting_type_profile() && + (isolate->is_precise_binary_code_coverage() || + isolate->is_block_binary_code_coverage())) { + // We do not have to hold onto feedback vectors for invocations we already + // reported. So we can reset the list. + isolate->SetFeedbackVectorsForProfilingTools(*ArrayList::New(isolate, 0)); + } + return result; +} + +std::unique_ptr Coverage::CollectBestEffort(Isolate* isolate) { + return Collect(isolate, v8::debug::CoverageMode::kBestEffort); +} + +std::unique_ptr Coverage::Collect( + Isolate* isolate, v8::debug::CoverageMode collectionMode) { + // Collect call counts for all functions. + SharedToCounterMap counter_map; + CollectAndMaybeResetCounts(isolate, &counter_map, collectionMode); // Iterate shared function infos of every script and build a mapping // between source ranges and invocation counts. @@ -583,30 +609,40 @@ std::unique_ptr Coverage::Collect( result->emplace_back(script_handle); std::vector* functions = &result->back().functions; - std::vector sorted; + std::vector sorted; { // Sort functions by start position, from outer to inner functions. SharedFunctionInfo::ScriptIterator infos(isolate, *script_handle); for (SharedFunctionInfo info = infos.Next(); !info.is_null(); info = infos.Next()) { - sorted.push_back(info); + sorted.emplace_back(info, counter_map.Get(info)); } - std::sort(sorted.begin(), sorted.end(), CompareSharedFunctionInfo); + std::sort(sorted.begin(), sorted.end()); } // Stack to track nested functions, referring function by index. std::vector nesting; // Use sorted list to reconstruct function nesting. - for (SharedFunctionInfo info : sorted) { - int start = StartPosition(info); - int end = info.EndPosition(); - uint32_t count = counter_map.Get(info); + for (const SharedFunctionInfoAndCount& v : sorted) { + SharedFunctionInfo info = v.info; + int start = v.start; + int end = v.end; + uint32_t count = v.count; + // Find the correct outer function based on start position. + // + // This is not robust when considering two functions with identical source + // ranges. In this case, it is unclear which function is the inner / outer + // function. Above, we ensure that such functions are sorted in ascending + // `count` order, so at least our `parent_is_covered` optimization below + // should be fine. + // TODO(jgruber): Consider removing the optimization. while (!nesting.empty() && functions->at(nesting.back()).end <= start) { nesting.pop_back(); } + if (count != 0) { switch (collectionMode) { case v8::debug::CoverageMode::kBlockCount: From 0ccf90b415873e60ee90174fe5cda702136a4a1b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 27 Aug 2019 23:04:51 -0700 Subject: [PATCH 61/84] test: remove Windows skipping of http keepalive request GC test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove code to skip Windows in test-http-server-keepalive-req-gc. The test now works reliably on Windows (I think). PR-URL: https://github.com/nodejs/node/pull/29354 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Сковорода Никита Андреевич Reviewed-By: David Carlier --- test/parallel/test-http-server-keepalive-req-gc.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/parallel/test-http-server-keepalive-req-gc.js b/test/parallel/test-http-server-keepalive-req-gc.js index 77defb5154676e..e94845d38df098 100644 --- a/test/parallel/test-http-server-keepalive-req-gc.js +++ b/test/parallel/test-http-server-keepalive-req-gc.js @@ -5,11 +5,6 @@ const onGC = require('../common/ongc'); const { createServer } = require('http'); const { connect } = require('net'); -if (common.isWindows) { - // TODO(addaleax): Investigate why and remove the skip. - common.skip('This test is flaky on Windows.'); -} - // Make sure that for HTTP keepalive requests, the req object can be // garbage collected once the request is finished. // Refs: https://github.com/nodejs/node/issues/9668 From 0c4df35db0318bc2c9960f748c0bd7ec66b75b7e Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 30 Aug 2019 08:52:42 +0200 Subject: [PATCH 62/84] build: hard code doctool in test-doc target This commit removes the usage of the CI_DOC variable in the test-doc recipe and specifies the doctool argument to tools/test.py explicitly. The motivation for this is that the build is taking longer time and this is mostly due to tests being run twice as the CI_DOC variable will be empty in most cases (when not using --without-ssl). This change was introduced with/after Commit 9039af83a33af870a074463a0e8d79a0cb95d14c ("build: skip test-ci doc targets if no crypto") and while I though it might make sense to change the setting of CI_DOC I not sure about the implications that might have to our CI environment. It currently looks like this: ifeq ($(node_use_openssl), false) CI_DOC := doctool else CI_DOC = endif Which is setting CI_DOC to doctool if there is no crypto support which not available. But perhaps this should be be the other way around, changing the order or updating condition to be true. PR-URL: https://github.com/nodejs/node/pull/29375 Reviewed-By: Ben Noordhuis Reviewed-By: Yongsheng Zhang Reviewed-By: David Carlier Reviewed-By: Luigi Pinca --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 478326e2cd851c..33d43798f52617 100644 --- a/Makefile +++ b/Makefile @@ -604,7 +604,7 @@ test-doc: doc-only ## Builds, lints, and verifies the docs. echo "Skipping test-doc (no crypto)"; \ else \ $(MAKE) lint; \ - $(PYTHON) tools/test.py $(PARALLEL_ARGS) $(CI_DOC); \ + $(PYTHON) tools/test.py $(PARALLEL_ARGS) doctool; \ fi test-known-issues: all From 2efd72f28d7d7e2d3aa1fe08ce64390e1c6be947 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 27 Aug 2019 04:12:41 -0400 Subject: [PATCH 63/84] stream: improve read() performance PR-URL: https://github.com/nodejs/node/pull/29337 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: David Carlier --- lib/internal/streams/buffer_list.js | 54 +++++++++++++---------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index 9d6e9e2fe4f7f9..715d5d201d4df4 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -98,33 +98,31 @@ module.exports = class BufferList { // Consumes a specified amount of characters from the buffered data. _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { + let ret = ''; + let p = this.head; + let c = 0; + do { const str = p.data; - const nb = (n > str.length ? str.length : n); - if (nb === str.length) + if (n > str.length) { ret += str; - else - ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { + n -= str.length; + } else { + if (n === str.length) { + ret += str; ++c; if (p.next) this.head = p.next; else this.head = this.tail = null; } else { + ret += str.slice(0, n); this.head = p; - p.data = str.slice(nb); + p.data = str.slice(n); } break; } ++c; - } + } while (p = p.next); this.length -= c; return ret; } @@ -132,33 +130,31 @@ module.exports = class BufferList { // Consumes a specified amount of bytes from the buffered data. _getBuffer(n) { const ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { + const retLen = n; + let p = this.head; + let c = 0; + do { const buf = p.data; - const nb = (n > buf.length ? buf.length : n); - if (nb === buf.length) - ret.set(buf, ret.length - n); - else - ret.set(new Uint8Array(buf.buffer, buf.byteOffset, nb), ret.length - n); - n -= nb; - if (n === 0) { - if (nb === buf.length) { + if (n > buf.length) { + ret.set(buf, retLen - n); + n -= buf.length; + } else { + if (n === buf.length) { + ret.set(buf, retLen - n); ++c; if (p.next) this.head = p.next; else this.head = this.tail = null; } else { + ret.set(new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n); this.head = p; - p.data = buf.slice(nb); + p.data = buf.slice(n); } break; } ++c; - } + } while (p = p.next); this.length -= c; return ret; } From e5a9a8522d4063f32e6a39d32f8c5dbad5fd8e2f Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 19 Aug 2019 08:37:49 +0200 Subject: [PATCH 64/84] http: simplify timeout handling Avoids allocating and registering extra listeners for 'timeout'. PR-URL: https://github.com/nodejs/node/pull/29200 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- lib/_http_client.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index a5a869b327c79b..8ceb3aac582b12 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -625,6 +625,10 @@ function responseOnEnd() { const res = this; const req = this.req; + if (req.socket && req.timeoutCb) { + req.socket.removeListener('timeout', emitRequestTimeout); + } + req._ended = true; if (!req.shouldKeepAlive || req.finished) responseKeepAlive(res, req); @@ -680,11 +684,17 @@ function tickOnSocket(req, socket) { req.emit('socket', socket); } +function emitRequestTimeout() { + const req = this._httpMessage; + if (req) { + req.emit('timeout'); + } +} + function listenSocketTimeout(req) { if (req.timeoutCb) { return; } - const emitRequestTimeout = () => req.emit('timeout'); // Set timeoutCb so it will get cleaned up on request end. req.timeoutCb = emitRequestTimeout; // Delegate socket timeout event. @@ -695,12 +705,6 @@ function listenSocketTimeout(req) { socket.once('timeout', emitRequestTimeout); }); } - // Remove socket timeout listener after response end. - req.once('response', (res) => { - res.once('end', () => { - req.socket.removeListener('timeout', emitRequestTimeout); - }); - }); } ClientRequest.prototype.onSocket = function onSocket(socket) { From 6734782f25b348fa893b7e1cbe9bfc302dcd8db5 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 29 Aug 2019 09:04:34 -0400 Subject: [PATCH 65/84] doc: remove multiple consecutive blank lines These are rendered as single breaks. Addresses Markdownlint MD012 rule. PR-URL: https://github.com/nodejs/node/pull/29352 Reviewed-By: Michael Dawson Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- CPP_STYLE_GUIDE.md | 2 -- README.md | 2 -- benchmark/README.md | 2 -- doc/api/documentation.md | 1 - doc/api/errors.md | 2 -- doc/api/events.md | 1 - doc/api/fs.md | 1 - doc/api/globals.md | 1 - doc/api/https.md | 1 - doc/api/n-api.md | 2 -- doc/api/policy.md | 1 - doc/api/tls.md | 2 -- doc/api/v8.md | 1 - doc/changelogs/CHANGELOG_IOJS.md | 11 ----------- doc/changelogs/CHANGELOG_V010.md | 1 - doc/changelogs/CHANGELOG_V012.md | 1 - doc/changelogs/CHANGELOG_V11.md | 1 - doc/changelogs/CHANGELOG_V4.md | 3 --- doc/changelogs/CHANGELOG_V5.md | 5 ----- doc/changelogs/CHANGELOG_V6.md | 4 ---- doc/changelogs/CHANGELOG_V7.md | 4 ---- doc/changelogs/CHANGELOG_V8.md | 2 -- doc/changelogs/CHANGELOG_V9.md | 1 - doc/guides/building-node-with-ninja.md | 1 - doc/guides/contributing/pull-requests.md | 1 - doc/guides/diagnostic-tooling-support-tiers.md | 1 - doc/guides/maintaining-V8.md | 1 - doc/guides/node-postmortem-support.md | 1 - doc/guides/writing-tests.md | 1 - 29 files changed, 58 deletions(-) diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index d624156b97a2ca..52a9b27878be34 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -29,7 +29,6 @@ * [Avoid throwing JavaScript errors in C++ methods](#avoid-throwing-javascript-errors-in-c) * [Avoid throwing JavaScript errors in nested C++ methods](#avoid-throwing-javascript-errors-in-nested-c-methods) - ## Guides and References The Node.js C++ codebase strives to be consistent in its use of language @@ -385,7 +384,6 @@ side effects. Node.js is built [without C++ exception handling][], so code using `throw` or even `try` and `catch` **will** break. - [C++ Core Guidelines]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines [Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html [Google’s `cpplint`]: https://github.com/google/styleguide diff --git a/README.md b/README.md index 4bb70abceee59e..9ae8f214e6af90 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ The Node.js project uses an [open governance model](./GOVERNANCE.md). The **This project is bound by a [Code of Conduct][].** - # Table of Contents * [Support](#support) @@ -89,7 +88,6 @@ Version-specific documentation is available in each release directory in the _docs_ subdirectory. Version-specific documentation is also at . - ### Verifying Binaries Download directories contain a `SHASUMS256.txt` file with SHA checksums for the diff --git a/benchmark/README.md b/benchmark/README.md index 8b30ab874b0a07..1e82614dbbff90 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -83,7 +83,6 @@ See [the guide on writing benchmarks](../doc/guides/writing-and-running-benchmar The default benchmarker used to run HTTP benchmarks. See [the guide on writing HTTP benchmarks](../doc/guides/writing-and-running-benchmarks.md#creating-an-http-benchmark). - ### PORT The default port used to run HTTP benchmarks. @@ -95,4 +94,3 @@ Used in special benchmarks that can't use `createBenchmark` and the object it returns to accomplish what they need. This function reports timing data to the parent process (usually created by running `compare.js`, `run.js` or `scatter.js`). - diff --git a/doc/api/documentation.md b/doc/api/documentation.md index c0733f266dd830..14310f7baed68a 100644 --- a/doc/api/documentation.md +++ b/doc/api/documentation.md @@ -12,7 +12,6 @@ Node.js is a JavaScript runtime built on the [V8 JavaScript engine][]. Report errors in this documentation in [the issue tracker][]. See [the contributing guide][] for directions on how to submit pull requests. - ## Stability Index diff --git a/doc/api/errors.md b/doc/api/errors.md index d5c6d37cfd5117..0810473d6a58f3 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -608,7 +608,6 @@ The OpenSSL library the error originates in. A human-readable string describing the reason for the error. - ## Node.js Error Codes @@ -2164,7 +2163,6 @@ removed: v10.0.0 The `repl` module was unable to parse data from the REPL history file. - ### ERR_STDERR_CLOSE -Indicates that the underlying [`Http2Stream`]() was terminated before +Indicates that the underlying [`Http2Stream`][] was terminated before [`response.end()`][] was called or able to flush. #### Event: 'finish' @@ -3192,12 +3192,12 @@ added: v8.4.0 * `callback` {Function} * Returns: {http2.Http2ServerResponse} -Sets the [`Http2Stream`]()'s timeout value to `msecs`. If a callback is +Sets the [`Http2Stream`][]'s timeout value to `msecs`. If a callback is provided, then it is added as a listener on the `'timeout'` event on the response object. If no `'timeout'` listener is added to the request, the response, or -the server, then [`Http2Stream`]()s are destroyed when they time out. If a +the server, then [`Http2Stream`][]s are destroyed when they time out. If a handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. @@ -3490,6 +3490,7 @@ following additional properties: [`ClientHttp2Stream`]: #http2_class_clienthttp2stream [`Duplex`]: stream.html#stream_class_stream_duplex [`Http2ServerRequest`]: #http2_class_http2_http2serverrequest +[`Http2ServerResponse`]: #class-http2http2serverresponse [`Http2Session` and Sockets]: #http2_http2session_and_sockets [`Http2Stream`]: #http2_class_http2stream [`ServerHttp2Stream`]: #http2_class_serverhttp2stream From 3fc29b8f9a3fe0fdeed00a653ee0251822ef232d Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 29 Aug 2019 09:28:03 -0400 Subject: [PATCH 67/84] doc: add blanks around code fences Addresses Markdownlint MD031 rule warnings PR-URL: https://github.com/nodejs/node/pull/29366 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Trivikram Kamat Reviewed-By: Gus Caplan Reviewed-By: David Carlier --- BUILDING.md | 3 + CPP_STYLE_GUIDE.md | 1 + doc/api/child_process.md | 1 + doc/api/cli.md | 1 + doc/api/console.md | 1 + doc/api/crypto.md | 1 + doc/api/dgram.md | 1 + doc/api/errors.md | 1 + doc/api/esm.md | 1 + doc/api/fs.md | 2 + doc/api/http2.md | 1 + doc/api/https.md | 1 + doc/api/n-api.md | 174 ++++++++++++++++++++++++++++++ doc/api/perf_hooks.md | 1 + doc/api/process.md | 3 + doc/api/stream.md | 1 + doc/api/tls.md | 1 + doc/api/util.md | 3 + doc/api/vm.md | 1 + doc/api/zlib.md | 1 + doc/guides/updating-root-certs.md | 3 + doc/guides/writing-tests.md | 3 + doc/onboarding-extras.md | 11 +- 23 files changed, 212 insertions(+), 5 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 8725db965eb0e4..c56be2ad54e9cb 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -665,16 +665,19 @@ during configuration if the ICU version is too old. #### Unix/macOS From an already-unpacked ICU: + ```console $ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu ``` From a local ICU tarball: + ```console $ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz ``` From a tarball URL: + ```console $ ./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz ``` diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 52a9b27878be34..07733db96ca89e 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -185,6 +185,7 @@ class FancyContainer { ... } ``` + ## Memory Management ### Memory allocation diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 02ffce72388c04..412092d7d13c50 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -168,6 +168,7 @@ generated output. The `command` string passed to the exec function is processed directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) need to be dealt with accordingly: + ```js exec('"/path/to/test file/test.sh" arg1 arg2'); // Double quotes are used so that the space in the path is not interpreted as diff --git a/doc/api/cli.md b/doc/api/cli.md index d8c73147af28d2..fdc1d790f18eb4 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -70,6 +70,7 @@ added: v10.12.0 --> Print source-able bash completion script for Node.js. + ```console $ node --completion-bash > node_bash_completion $ source node_bash_completion diff --git a/doc/api/console.md b/doc/api/console.md index 190e03007acc11..c03e7b82331ba8 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -498,6 +498,7 @@ This method does not display anything unless used in the inspector. The `console.profile()` method starts a JavaScript CPU profile with an optional label until [`console.profileEnd()`][] is called. The profile is then added to the **Profile** panel of the inspector. + ```js console.profile('MyLabel'); // Some code diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 6db84e4af7362e..dbef108f898808 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -716,6 +716,7 @@ const dh = crypto.createDiffieHellmanGroup(name); ``` `name` is taken from [RFC 2412][] (modp1 and 2) and [RFC 3526][]: + ```console $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h modp1 # 768 bits diff --git a/doc/api/dgram.md b/doc/api/dgram.md index d0af318117863a..dfd9c4d2ea5b70 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -528,6 +528,7 @@ socket.bind(1234, () => { #### Example: IPv4 Outgoing Multicast Interface All systems use an IP of the host on the desired physical interface: + ```js const socket = dgram.createSocket('udp4'); diff --git a/doc/api/errors.md b/doc/api/errors.md index 0810473d6a58f3..d2946435ca3b98 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -70,6 +70,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways: // Otherwise handle the data }); ``` + - When an asynchronous method is called on an object that is an [`EventEmitter`][], errors can be routed to that object's `'error'` event. diff --git a/doc/api/esm.md b/doc/api/esm.md index 159dcc678c74f7..0ed0d7d1b4dab2 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -188,6 +188,7 @@ module via `import`. "main": "./src/index.js" } ``` + ```js // ./my-app.mjs diff --git a/doc/api/fs.md b/doc/api/fs.md index 0d17c5deb4a49b..a045f454188701 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -231,6 +231,7 @@ fs.readFileSync(new URL('file:///p/a/t/h/%2f')); /* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded / characters */ ``` + On Windows, `file:` URLs having encoded backslash will result in a throw: ```js @@ -3815,6 +3816,7 @@ recommended. When `file` is a file descriptor, the behavior is almost identical to directly calling `fs.write()` like: + ```javascript fs.write(fd, Buffer.from(data, options.encoding), callback); ``` diff --git a/doc/api/http2.md b/doc/api/http2.md index c31e5c956ba481..1c6e6c70795397 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2484,6 +2484,7 @@ The `CONNECT` method is used to allow an HTTP/2 server to be used as a proxy for TCP/IP connections. A simple TCP Server: + ```js const net = require('net'); diff --git a/doc/api/https.md b/doc/api/https.md index 4b32ff087af040..d396c8a70dafad 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -255,6 +255,7 @@ req.on('error', (e) => { }); req.end(); ``` + Example using options from [`tls.connect()`][]: ```js diff --git a/doc/api/n-api.md b/doc/api/n-api.md index c49d446ac4be36..d4a8ebf1594794 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -87,26 +87,33 @@ not, and any external libraries used from the addon may not. In particular, none of the following APIs provide an ABI stability guarantee across major versions: * the Node.js C++ APIs available via any of + ```C++ #include #include #include #include ``` + * the libuv APIs which are also included with Node.js and available via + ```C++ #include ``` + * the V8 API available via + ```C++ #include ``` Thus, for an addon to remain ABI-compatible across Node.js major versions, it must make use exclusively of N-API by restricting itself to using + ```C #include ``` + and by checking, for all external libraries that it uses, that the external library makes ABI stability guarantees similar to N-API. @@ -340,6 +347,7 @@ napiVersion: 1 --> Integral status code indicating the success or failure of a N-API call. Currently, the following status codes are supported. + ```C typedef enum { napi_ok, @@ -363,6 +371,7 @@ typedef enum { napi_date_expected, } napi_status; ``` + If additional information is required upon an API returning a failed status, it can be obtained by calling `napi_get_last_error_info`. @@ -371,6 +380,7 @@ it can be obtained by calling `napi_get_last_error_info`. added: v8.0.0 napiVersion: 1 --> + ```C typedef struct { const char* error_message; @@ -422,6 +432,7 @@ A value to be given to `napi_release_threadsafe_function()` to indicate whether the thread-safe function is to be closed immediately (`napi_tsfn_abort`) or merely released (`napi_tsfn_release`) and thus available for subsequent use via `napi_acquire_threadsafe_function()` and `napi_call_threadsafe_function()`. + ```C typedef enum { napi_tsfn_release, @@ -438,6 +449,7 @@ napiVersion: 4 A value to be given to `napi_call_threadsafe_function()` to indicate whether the call should block whenever the queue associated with the thread-safe function is full. + ```C typedef enum { napi_tsfn_nonblocking, @@ -501,6 +513,7 @@ napiVersion: 1 Function pointer type for user-provided native functions which are to be exposed to JavaScript via N-API. Callback functions should satisfy the following signature: + ```C typedef napi_value (*napi_callback)(napi_env, napi_callback_info); ``` @@ -577,12 +590,14 @@ sufficient to call the JavaScript function via `napi_call_function` rather than via `napi_make_callback`. Callback functions must satisfy the following signature: + ```C typedef void (*napi_threadsafe_function_call_js)(napi_env env, napi_value js_callback, void* context, void* data); ``` + - `[in] env`: The environment to use for API calls, or `NULL` if the thread-safe function is being torn down and `data` may need to be freed. - `[in] js_callback`: The JavaScript function to call, or `NULL` if the @@ -631,6 +646,7 @@ The format of the `napi_extended_error_info` structure is as follows: added: v10.6.0 napiVersion: 4 --> + ```C typedef struct napi_extended_error_info { const char* error_message; @@ -639,6 +655,7 @@ typedef struct napi_extended_error_info { napi_status error_code; }; ``` + - `error_message`: Textual representation of the error that occurred. - `engine_reserved`: Opaque handle reserved for engine use only. - `engine_error_code`: VM specific error code. @@ -656,11 +673,13 @@ logging purposes. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_last_error_info(napi_env env, const napi_extended_error_info** result); ``` + - `[in] env`: The environment that the API is invoked under. - `[out] result`: The `napi_extended_error_info` structure with more information about the error. @@ -764,9 +783,11 @@ TypeError [ERR_ERROR_1] added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] error`: The JavaScript value to be thrown. @@ -779,11 +800,13 @@ This API throws the JavaScript value provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_throw_error(napi_env env, const char* code, const char* msg); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional error code to be set on the error. - `[in] msg`: C string representing the text to be associated with @@ -798,11 +821,13 @@ This API throws a JavaScript `Error` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_throw_type_error(napi_env env, const char* code, const char* msg); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional error code to be set on the error. - `[in] msg`: C string representing the text to be associated with @@ -817,11 +842,13 @@ This API throws a JavaScript `TypeError` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_throw_range_error(napi_env env, const char* code, const char* msg); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional error code to be set on the error. - `[in] msg`: C string representing the text to be associated with @@ -836,11 +863,13 @@ This API throws a JavaScript `RangeError` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_is_error(napi_env env, napi_value value, bool* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] value`: The `napi_value` to be checked. - `[out] result`: Boolean value that is set to true if `napi_value` represents @@ -855,12 +884,14 @@ This API queries a `napi_value` to check if it represents an error object. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_create_error(napi_env env, napi_value code, napi_value msg, napi_value* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional `napi_value` with the string for the error code to be associated with the error. @@ -877,12 +908,14 @@ This API returns a JavaScript `Error` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_create_type_error(napi_env env, napi_value code, napi_value msg, napi_value* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional `napi_value` with the string for the error code to be associated with the error. @@ -899,12 +932,14 @@ This API returns a JavaScript `TypeError` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_create_range_error(napi_env env, napi_value code, napi_value msg, napi_value* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] code`: Optional `napi_value` with the string for the error code to be associated with the error. @@ -921,6 +956,7 @@ This API returns a JavaScript `RangeError` with the text provided. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_and_clear_last_exception(napi_env env, napi_value* result); @@ -940,6 +976,7 @@ This API can be called even if there is a pending JavaScript exception. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_exception_pending(napi_env env, bool* result); ``` @@ -979,6 +1016,7 @@ thrown to immediately terminate the process. added: v8.2.0 napiVersion: 1 --> + ```C NAPI_NO_RETURN void napi_fatal_error(const char* location, size_t location_len, @@ -1093,10 +1131,12 @@ can only be called once. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_open_handle_scope(napi_env env, napi_handle_scope* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[out] result`: `napi_value` representing the new scope. @@ -1109,10 +1149,12 @@ This API open a new scope. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_close_handle_scope(napi_env env, napi_handle_scope scope); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] scope`: `napi_value` representing the scope to be closed. @@ -1128,11 +1170,13 @@ This API can be called even if there is a pending JavaScript exception. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_open_escapable_handle_scope(napi_env env, napi_handle_scope* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[out] result`: `napi_value` representing the new scope. @@ -1146,11 +1190,13 @@ to the outer scope. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_close_escapable_handle_scope(napi_env env, napi_handle_scope scope); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] scope`: `napi_value` representing the scope to be closed. @@ -1166,6 +1212,7 @@ This API can be called even if there is a pending JavaScript exception. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_escape_handle(napi_env env, napi_escapable_handle_scope scope, @@ -1232,6 +1279,7 @@ individual count. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_create_reference(napi_env env, napi_value value, @@ -1255,6 +1303,7 @@ to the `Object` passed in. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_delete_reference(napi_env env, napi_ref ref); ``` @@ -1273,11 +1322,13 @@ This API can be called even if there is a pending JavaScript exception. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_reference_ref(napi_env env, napi_ref ref, int* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] ref`: `napi_ref` for which the reference count will be incremented. - `[out] result`: The new reference count. @@ -1292,11 +1343,13 @@ passed in and returns the resulting reference count. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_reference_unref(napi_env env, napi_ref ref, int* result); ``` + - `[in] env`: The environment that the API is invoked under. - `[in] ref`: `napi_ref` for which the reference count will be decremented. - `[out] result`: The new reference count. @@ -1311,6 +1364,7 @@ passed in and returns the resulting reference count. added: v8.0.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_get_reference_value(napi_env env, napi_ref ref, @@ -1517,6 +1571,7 @@ the `napi_value` in question is of the JavaScript type expected by the API. ### Enum types #### napi_valuetype + ```C typedef enum { // ES6 types (corresponds to typeof) @@ -1544,6 +1599,7 @@ A JavaScript value of type `napi_external` appears in JavaScript as a plain object such that no properties can be set on it, and no prototype. #### napi_typedarray_type + ```C typedef enum { napi_int8_array, @@ -1570,6 +1626,7 @@ Elements of this enum correspond to added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_array(napi_env env, napi_value* result) ``` @@ -1588,6 +1645,7 @@ JavaScript arrays are described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_array_with_length(napi_env env, size_t length, @@ -1617,6 +1675,7 @@ JavaScript arrays are described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_arraybuffer(napi_env env, size_t byte_length, @@ -1649,6 +1708,7 @@ JavaScript `ArrayBuffer` objects are described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_buffer(napi_env env, size_t size, @@ -1671,6 +1731,7 @@ fully-supported data structure, in most cases using a `TypedArray` will suffice. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_buffer_copy(napi_env env, size_t length, @@ -1721,6 +1782,7 @@ JavaScript `Date` objects are described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_external(napi_env env, void* data, @@ -1754,6 +1816,7 @@ an external value yields `napi_external`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_external_arraybuffer(napi_env env, @@ -1789,6 +1852,7 @@ JavaScript `ArrayBuffer`s are described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_external_buffer(napi_env env, size_t length, @@ -1821,6 +1885,7 @@ For Node.js >=4 `Buffers` are `Uint8Array`s. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_object(napi_env env, napi_value* result) ``` @@ -1842,6 +1907,7 @@ ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_symbol(napi_env env, napi_value description, @@ -1866,6 +1932,7 @@ of the ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_typedarray(napi_env env, napi_typedarray_type type, @@ -1937,6 +2004,7 @@ JavaScript `DataView` objects are described in added: v8.4.0 napiVersion: 1 --> + ```C napi_status napi_create_int32(napi_env env, int32_t value, napi_value* result) ``` @@ -1958,6 +2026,7 @@ The JavaScript `Number` type is described in added: v8.4.0 napiVersion: 1 --> + ```C napi_status napi_create_uint32(napi_env env, uint32_t value, napi_value* result) ``` @@ -1979,6 +2048,7 @@ The JavaScript `Number` type is described in added: v8.4.0 napiVersion: 1 --> + ```C napi_status napi_create_int64(napi_env env, int64_t value, napi_value* result) ``` @@ -2006,6 +2076,7 @@ outside the range of added: v8.4.0 napiVersion: 1 --> + ```C napi_status napi_create_double(napi_env env, double value, napi_value* result) ``` @@ -2099,6 +2170,7 @@ The resulting `BigInt` is calculated as: (–1)`sign_bit` (`words[0]` added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_string_latin1(napi_env env, const char* str, @@ -2125,6 +2197,7 @@ The JavaScript `String` type is described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_string_utf16(napi_env env, const char16_t* str, @@ -2151,6 +2224,7 @@ The JavaScript `String` type is described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_string_utf8(napi_env env, const char* str, @@ -2178,6 +2252,7 @@ The JavaScript `String` type is described in added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_array_length(napi_env env, napi_value value, @@ -2202,6 +2277,7 @@ of the ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_arraybuffer_info(napi_env env, napi_value arraybuffer, @@ -2232,6 +2308,7 @@ trigger a GC. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_buffer_info(napi_env env, napi_value value, @@ -2257,6 +2334,7 @@ lifetime is not guaranteed if it's managed by the VM. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_prototype(napi_env env, napi_value object, @@ -2276,6 +2354,7 @@ Returns `napi_ok` if the API succeeded. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_typedarray_info(napi_env env, napi_value typedarray, @@ -2365,6 +2444,7 @@ This API returns the C double primitive of time value for the given JavaScript added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_bool(napi_env env, napi_value value, bool* result) ``` @@ -2385,6 +2465,7 @@ This API returns the C boolean primitive equivalent of the given JavaScript added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_double(napi_env env, napi_value value, @@ -2491,6 +2572,7 @@ both set to `NULL`, in order to get only `word_count`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_external(napi_env env, napi_value value, @@ -2512,6 +2594,7 @@ This API retrieves the external data pointer that was previously passed to added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_int32(napi_env env, napi_value value, @@ -2541,6 +2624,7 @@ result to zero. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_int64(napi_env env, napi_value value, @@ -2572,6 +2656,7 @@ result to zero. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_string_latin1(napi_env env, napi_value value, @@ -2600,6 +2685,7 @@ in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_string_utf8(napi_env env, napi_value value, @@ -2627,6 +2713,7 @@ This API returns the UTF8-encoded string corresponding the value passed in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_string_utf16(napi_env env, napi_value value, @@ -2654,6 +2741,7 @@ This API returns the UTF16-encoded string corresponding the value passed in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_value_uint32(napi_env env, napi_value value, @@ -2677,6 +2765,7 @@ This API returns the C primitive equivalent of the given `napi_value` as a added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_boolean(napi_env env, bool value, napi_value* result) ``` @@ -2696,6 +2785,7 @@ represent the given boolean value. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_global(napi_env env, napi_value* result) ``` @@ -2712,6 +2802,7 @@ This API returns the `global` object. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_null(napi_env env, napi_value* result) ``` @@ -2728,6 +2819,7 @@ This API returns the `null` object. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_undefined(napi_env env, napi_value* result) ``` @@ -2757,6 +2849,7 @@ These APIs support doing one of the following: added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_coerce_to_bool(napi_env env, napi_value value, @@ -2779,6 +2872,7 @@ This API can be re-entrant if getters are defined on the passed-in `Object`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_coerce_to_number(napi_env env, napi_value value, @@ -2801,6 +2895,7 @@ This API can be re-entrant if getters are defined on the passed-in `Object`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_coerce_to_object(napi_env env, napi_value value, @@ -2823,6 +2918,7 @@ This API can be re-entrant if getters are defined on the passed-in `Object`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_coerce_to_string(napi_env env, napi_value value, @@ -2845,6 +2941,7 @@ This API can be re-entrant if getters are defined on the passed-in `Object`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_typeof(napi_env env, napi_value value, napi_valuetype* result) ``` @@ -2867,6 +2964,7 @@ If `value` has a type that is invalid, an error is returned. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_instanceof(napi_env env, napi_value object, @@ -2893,6 +2991,7 @@ of the ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_array(napi_env env, napi_value value, bool* result) ``` @@ -2912,6 +3011,7 @@ of the ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_arraybuffer(napi_env env, napi_value value, bool* result) ``` @@ -2929,6 +3029,7 @@ This API checks if the `Object` passed in is an array buffer. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_buffer(napi_env env, napi_value value, bool* result) ``` @@ -2967,6 +3068,7 @@ This API checks if the `Object` passed in is a date. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_error(napi_env env, napi_value value, bool* result) ``` @@ -2984,6 +3086,7 @@ This API checks if the `Object` passed in is an `Error`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_is_typedarray(napi_env env, napi_value value, bool* result) ``` @@ -3019,6 +3122,7 @@ This API checks if the `Object` passed in is a `DataView`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_strict_equals(napi_env env, napi_value lhs, @@ -3063,11 +3167,14 @@ get and set properties on arbitrary JavaScript objects represented by `napi_value`. For instance, consider the following JavaScript code snippet: + ```js const obj = {}; obj.myProp = 123; ``` + The equivalent can be done using N-API values with the following snippet: + ```C napi_status status = napi_generic_failure; @@ -3087,11 +3194,14 @@ if (status != napi_ok) return status; Indexed properties can be set in a similar manner. Consider the following JavaScript snippet: + ```js const arr = []; arr[123] = 'hello'; ``` + The equivalent can be done using N-API values with the following snippet: + ```C napi_status status = napi_generic_failure; @@ -3111,12 +3221,14 @@ if (status != napi_ok) return status; Properties can be retrieved using the APIs described in this section. Consider the following JavaScript snippet: + ```js const arr = []; const value = arr[123]; ``` The following is the approximate equivalent of the N-API counterpart: + ```C napi_status status = napi_generic_failure; @@ -3132,6 +3244,7 @@ if (status != napi_ok) return status; Finally, multiple properties can also be defined on an object for performance reasons. Consider the following JavaScript: + ```js const obj = {}; Object.defineProperties(obj, { @@ -3141,6 +3254,7 @@ Object.defineProperties(obj, { ``` The following is the approximate equivalent of the N-API counterpart: + ```C napi_status status = napi_status_generic_failure; @@ -3170,6 +3284,7 @@ if (status != napi_ok) return status; ### Structures #### napi_property_attributes + ```C typedef enum { napi_default = 0, @@ -3202,6 +3317,7 @@ default. This is used only by [`napi_define_class`][]. It is ignored by `napi_define_properties`. #### napi_property_descriptor + ```C typedef struct { // One of utf8name or name should be NULL. @@ -3252,6 +3368,7 @@ this function is invoked. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_property_names(napi_env env, napi_value object, @@ -3276,6 +3393,7 @@ included. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_set_property(napi_env env, napi_value object, @@ -3297,6 +3415,7 @@ This API set a property on the `Object` passed in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_property(napi_env env, napi_value object, @@ -3318,6 +3437,7 @@ This API gets the requested property from the `Object` passed in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_has_property(napi_env env, napi_value object, @@ -3339,6 +3459,7 @@ This API checks if the `Object` passed in has the named property. added: v8.2.0 napiVersion: 1 --> + ```C napi_status napi_delete_property(napi_env env, napi_value object, @@ -3361,6 +3482,7 @@ This API attempts to delete the `key` own property from `object`. added: v8.2.0 napiVersion: 1 --> + ```C napi_status napi_has_own_property(napi_env env, napi_value object, @@ -3384,6 +3506,7 @@ any conversion between data types. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_set_named_property(napi_env env, napi_value object, @@ -3406,6 +3529,7 @@ created from the string passed in as `utf8Name`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_named_property(napi_env env, napi_value object, @@ -3428,6 +3552,7 @@ created from the string passed in as `utf8Name`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_has_named_property(napi_env env, napi_value object, @@ -3450,6 +3575,7 @@ created from the string passed in as `utf8Name`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_set_element(napi_env env, napi_value object, @@ -3471,6 +3597,7 @@ This API sets and element on the `Object` passed in. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_element(napi_env env, napi_value object, @@ -3492,6 +3619,7 @@ This API gets the element at the requested index. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_has_element(napi_env env, napi_value object, @@ -3514,6 +3642,7 @@ requested index. added: v8.2.0 napiVersion: 1 --> + ```C napi_status napi_delete_element(napi_env env, napi_value object, @@ -3536,6 +3665,7 @@ This API attempts to delete the specified `index` from `object`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_define_properties(napi_env env, napi_value object, @@ -3585,6 +3715,7 @@ whenever `object` is garbage-collected by passing both `object` and the data to added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_call_function(napi_env env, napi_value recv, @@ -3612,6 +3743,7 @@ after an async operation, see [`napi_make_callback`][]. A sample use case might look as follows. Consider the following JavaScript snippet: + ```js function AddTwo(num) { return num + 2; @@ -3620,6 +3752,7 @@ function AddTwo(num) { Then, the above function can be invoked from a native add-on using the following code: + ```C // Get the function named "AddTwo" on the global object napi_value global, add_two, arg; @@ -3652,6 +3785,7 @@ if (status != napi_ok) return; added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_create_function(napi_env env, const char* utf8name, @@ -3686,6 +3820,7 @@ to JavaScript, in order for the function to be accessible from script. In order to expose a function as part of the add-on's module exports, set the newly created function on the exports object. A sample module might look as follows: + ```C napi_value SayHello(napi_env env, napi_callback_info info) { printf("Hello\n"); @@ -3709,6 +3844,7 @@ NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) ``` Given the above code, the add-on can be used from JavaScript as follows: + ```js const myaddon = require('./addon'); myaddon.sayHello(); @@ -3731,6 +3867,7 @@ of the ECMAScript Language Specification. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_cb_info(napi_env env, napi_callback_info cbinfo, @@ -3762,6 +3899,7 @@ call like the arguments and the `this` pointer from a given callback info. added: v8.6.0 napiVersion: 1 --> + ```C napi_status napi_get_new_target(napi_env env, napi_callback_info cbinfo, @@ -3782,6 +3920,7 @@ callback is not a constructor call, the result is `NULL`. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_new_instance(napi_env env, napi_value cons, @@ -3802,6 +3941,7 @@ which in this case is the constructed object. This method is used to instantiate a new JavaScript value using a given `napi_value` that represents the constructor for the object. For example, consider the following snippet: + ```js function MyObject(param) { this.param = param; @@ -3812,6 +3952,7 @@ const value = new MyObject(arg); ``` The following can be approximated in N-API using the following snippet: + ```C // Get the constructor function MyObject napi_value global, constructor, arg, value; @@ -3876,6 +4017,7 @@ The reference must be freed once it is no longer needed. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_define_class(napi_env env, const char* utf8name, @@ -3939,6 +4081,7 @@ the JavaScript function and the data to [`napi_add_finalizer`][]. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_wrap(napi_env env, napi_value js_object, @@ -3995,6 +4138,7 @@ first. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_unwrap(napi_env env, napi_value js_object, @@ -4021,6 +4165,7 @@ then by calling `napi_unwrap()` on the wrapper object. added: v8.5.0 napiVersion: 1 --> + ```C napi_status napi_remove_wrap(napi_env env, napi_value js_object, @@ -4045,6 +4190,7 @@ JavaScript object becomes garbage-collected. + ```C napi_status napi_add_finalizer(napi_env env, napi_value js_object, @@ -4146,6 +4292,7 @@ changes: pr-url: https://github.com/nodejs/node/pull/14697 description: Added `async_resource` and `async_resource_name` parameters. --> + ```C napi_status napi_create_async_work(napi_env env, napi_value async_resource, @@ -4190,6 +4337,7 @@ the [`async_hooks` documentation][async_hooks `type`] for more information. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_delete_async_work(napi_env env, napi_async_work work); @@ -4209,6 +4357,7 @@ This API can be called even if there is a pending JavaScript exception. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_queue_async_work(napi_env env, napi_async_work work); @@ -4228,6 +4377,7 @@ with the same `napi_async_work` item or the result will be undefined. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_cancel_async_work(napi_env env, napi_async_work work); @@ -4258,6 +4408,7 @@ the runtime. added: v8.6.0 napiVersion: 1 --> + ```C napi_status napi_async_init(napi_env env, napi_value async_resource, @@ -4280,6 +4431,7 @@ Returns `napi_ok` if the API succeeded. added: v8.6.0 napiVersion: 1 --> + ```C napi_status napi_async_destroy(napi_env env, napi_async_context async_context); @@ -4300,6 +4452,7 @@ changes: - version: v8.6.0 description: Added `async_context` parameter. --> + ```C napi_status napi_make_callback(napi_env env, napi_async_context async_context, @@ -4344,12 +4497,14 @@ may be required when implementing custom async behavior that does not use added: v9.6.0 napiVersion: 3 --> + ```C NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env, napi_value resource_object, napi_async_context context, napi_callback_scope* result) ``` + - `[in] env`: The environment that the API is invoked under. - `[in] resource_object`: An object associated with the async work that will be passed to possible `async_hooks` [`init` hooks][]. @@ -4370,10 +4525,12 @@ the required scope. added: v9.6.0 napiVersion: 3 --> + ```C NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, napi_callback_scope scope) ``` + - `[in] env`: The environment that the API is invoked under. - `[in] scope`: The scope to be closed. @@ -4415,6 +4572,7 @@ The returned buffer is statically allocated and does not need to be freed. added: v8.0.0 napiVersion: 1 --> + ```C napi_status napi_get_version(napi_env env, uint32_t* result); @@ -4446,6 +4604,7 @@ support it: added: v8.5.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_adjust_external_memory(napi_env env, int64_t change_in_bytes, @@ -4480,6 +4639,7 @@ deferred object that is created by `napi_create_promise()` is freed by be returned to JavaScript where it can be used in the usual fashion. For example, to create a promise and pass it to an asynchronous worker: + ```c napi_deferred deferred; napi_value promise; @@ -4499,6 +4659,7 @@ return promise; The above function `do_something_asynchronous()` would perform its asynchronous action and then it would resolve or reject the deferred, thereby concluding the promise and freeing the deferred: + ```c napi_deferred deferred; napi_value undefined; @@ -4526,6 +4687,7 @@ deferred = NULL; added: v8.5.0 napiVersion: 1 --> + ```C napi_status napi_create_promise(napi_env env, napi_deferred* deferred, @@ -4547,6 +4709,7 @@ This API creates a deferred object and a JavaScript promise. added: v8.5.0 napiVersion: 1 --> + ```C napi_status napi_resolve_deferred(napi_env env, napi_deferred deferred, @@ -4571,6 +4734,7 @@ The deferred object is freed upon successful completion. added: v8.5.0 napiVersion: 1 --> + ```C napi_status napi_reject_deferred(napi_env env, napi_deferred deferred, @@ -4595,6 +4759,7 @@ The deferred object is freed upon successful completion. added: v8.5.0 napiVersion: 1 --> + ```C napi_status napi_is_promise(napi_env env, napi_value promise, @@ -4616,6 +4781,7 @@ underlying JavaScript engine. added: v8.5.0 napiVersion: 1 --> + ```C NAPI_EXTERN napi_status napi_run_script(napi_env env, napi_value script, @@ -4638,6 +4804,7 @@ added: - v9.3.0 napiVersion: 2 --> + ```C NAPI_EXTERN napi_status napi_get_uv_event_loop(napi_env env, uv_loop_t** loop); @@ -4765,6 +4932,7 @@ changes: pr-url: https://github.com/nodejs/node/pull/27791 description: Made `func` parameter optional with custom `call_js_cb`. --> + ```C NAPI_EXTERN napi_status napi_create_threadsafe_function(napi_env env, @@ -4808,6 +4976,7 @@ parameters and with `undefined` as its `this` value. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_get_threadsafe_function_context(napi_threadsafe_function func, @@ -4825,6 +4994,7 @@ This API may be called from any thread which makes use of `func`. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_call_threadsafe_function(napi_threadsafe_function func, @@ -4852,6 +5022,7 @@ This API may be called from any thread which makes use of `func`. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func); @@ -4873,6 +5044,7 @@ This API may be called from any thread which will start making use of `func`. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_release_threadsafe_function(napi_threadsafe_function func, @@ -4900,6 +5072,7 @@ This API may be called from any thread which will stop making use of `func`. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func); @@ -4920,6 +5093,7 @@ This API may only be called from the main thread. added: v10.6.0 napiVersion: 4 --> + ```C NAPI_EXTERN napi_status napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func); diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index c143b161a3ff10..b382ae2332a8fc 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -299,6 +299,7 @@ obs.observe({ entryTypes: ['mark'], buffered: true }); performance.mark('test'); ``` + Because `PerformanceObserver` instances introduce their own additional performance overhead, instances should not be left subscribed to notifications indefinitely. Users should disconnect observers as soon as they are no diff --git a/doc/api/process.md b/doc/api/process.md index aa7477d3bc5962..7c156e94923308 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -760,6 +760,7 @@ process. ```js console.log(`Current directory: ${process.cwd()}`); ``` + ## process.debugPort -Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that -represent spawned child processes. +* Extends: {EventEmitter} + +Instances of the `ChildProcess` represent spawned child processes. Instances of `ChildProcess` are not intended to be created directly. Rather, use the [`child_process.spawn()`][], [`child_process.exec()`][], diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 8036f82e797617..fb7328aa4d730b 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -116,6 +116,8 @@ also be used for other use cases requiring worker processes. added: v0.7.0 --> +* Extends: {EventEmitter} + A `Worker` object contains all public information and method about a worker. In the master it can be obtained using `cluster.workers`. In a worker it can be obtained using `cluster.worker`. diff --git a/doc/api/dgram.md b/doc/api/dgram.md index dfd9c4d2ea5b70..f4ae367527748b 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -35,8 +35,9 @@ server.bind(41234); added: v0.1.99 --> -The `dgram.Socket` object is an [`EventEmitter`][] that encapsulates the -datagram functionality. +* Extends: {EventEmitter} + +Encapsulates the datagram functionality. New instances of `dgram.Socket` are created using [`dgram.createSocket()`][]. The `new` keyword is not to be used to create `dgram.Socket` instances. @@ -720,7 +721,6 @@ and `udp6` sockets). The bound address and port can be retrieved using [`Error`]: errors.html#errors_class_error [`ERR_SOCKET_DGRAM_IS_CONNECTED`]: errors.html#errors_err_socket_dgram_is_connected [`ERR_SOCKET_DGRAM_NOT_CONNECTED`]: errors.html#errors_err_socket_dgram_not_connected -[`EventEmitter`]: events.html [`System Error`]: errors.html#errors_class_systemerror [`close()`]: #dgram_socket_close_callback [`cluster`]: cluster.html diff --git a/doc/api/domain.md b/doc/api/domain.md index 803fc2b830efd7..4aae68cf4027e9 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -273,11 +273,12 @@ serverDomain.run(() => { ## Class: Domain +* Extends: {EventEmitter} + The `Domain` class encapsulates the functionality of routing errors and uncaught exceptions to the active `Domain` object. -`Domain` is a child class of [`EventEmitter`][]. To handle the errors that it -catches, listen to its `'error'` event. +To handle the errors that it catches, listen to its `'error'` event. ### domain.members @@ -475,7 +476,6 @@ Promises. In other words, no `'error'` event will be emitted for unhandled `Promise` rejections. [`Error`]: errors.html#errors_class_error -[`EventEmitter`]: events.html#events_class_eventemitter [`domain.add(emitter)`]: #domain_domain_add_emitter [`domain.bind(callback)`]: #domain_domain_bind_callback [`domain.exit()`]: #domain_domain_exit diff --git a/doc/api/inspector.md b/doc/api/inspector.md index f25d6209c12189..f82c53f5bc3f51 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -64,6 +64,8 @@ An exception will be thrown if there is no active inspector. ## Class: inspector.Session +* Extends: {EventEmitter} + The `inspector.Session` is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. @@ -76,8 +78,6 @@ Create a new instance of the `inspector.Session` class. The inspector session needs to be connected through [`session.connect()`][] before the messages can be dispatched to the inspector backend. -`inspector.Session` is an [`EventEmitter`][] with the following events: - ### Event: 'inspectorNotification' +* Extends: {EventEmitter} + This class is used to create a TCP or [IPC][] server. ### new net.Server([options][, connectionListener]) @@ -384,10 +386,11 @@ active server in the event system. If the server is already `unref`ed calling added: v0.3.4 --> +* Extends: {stream.Duplex} + This class is an abstraction of a TCP socket or a streaming [IPC][] endpoint -(uses named pipes on Windows, and Unix domain sockets otherwise). A -`net.Socket` is also a [duplex stream][], so it can be both readable and -writable, and it is also an [`EventEmitter`][]. +(uses named pipes on Windows, and Unix domain sockets otherwise). It is also +an [`EventEmitter`][]. A `net.Socket` can be created by the user and used directly to interact with a server. For example, it is returned by [`net.createConnection()`][], @@ -1234,7 +1237,6 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [IPC]: #net_ipc_support [Identifying paths for IPC connections]: #net_identifying_paths_for_ipc_connections [Readable Stream]: stream.html#stream_class_stream_readable -[duplex stream]: stream.html#stream_class_stream_duplex [half-closed]: https://tools.ietf.org/html/rfc1122 [stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback [unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0 diff --git a/doc/api/readline.md b/doc/api/readline.md index 43d3a7e8f62dd4..898d7e005fb652 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -38,6 +38,8 @@ received on the `input` stream. added: v0.1.104 --> +* Extends: {EventEmitter} + Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a single `input` [Readable][] stream and a single `output` [Writable][] stream. diff --git a/doc/api/repl.md b/doc/api/repl.md index 193e82240b7cbe..1edee77b09b0c3 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -333,7 +333,8 @@ function myWriter(output) { added: v0.1.91 --> -The `repl.REPLServer` class inherits from the [`readline.Interface`][] class. +* Extends: {readline.Interface} + Instances of `repl.REPLServer` are created using the `repl.start()` method and *should not* be created directly using the JavaScript `new` keyword. @@ -696,7 +697,6 @@ For an example of running a REPL instance over [curl(1)][], see: [`domain`]: domain.html [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function -[`readline.Interface`]: readline.html#readline_class_interface [`repl.ReplServer`]: #repl_class_replserver [`util.inspect()`]: util.html#util_util_inspect_object_options [curl(1)]: https://curl.haxx.se/docs/manpage.html diff --git a/doc/api/tty.md b/doc/api/tty.md index 335aef7589b3bb..7111f2d228bd2b 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -35,10 +35,11 @@ classes. added: v0.5.8 --> -The `tty.ReadStream` class is a subclass of [`net.Socket`][] that represents the -readable side of a TTY. In normal circumstances [`process.stdin`][] will be the -only `tty.ReadStream` instance in a Node.js process and there should be no -reason to create additional instances. +* Extends: {net.Socket} + +Represents the readable side of a TTY. In normal circumstances +[`process.stdin`][] will be the only `tty.ReadStream` instance in a Node.js +process and there should be no reason to create additional instances. ### readStream.isRaw -The `tty.WriteStream` class is a subclass of [`net.Socket`][] that represents -the writable side of a TTY. In normal circumstances, [`process.stdout`][] and -[`process.stderr`][] will be the only `tty.WriteStream` instances created for a -Node.js process and there should be no reason to create additional instances. +* Extends: {net.Socket} + +Represents the writable side of a TTY. In normal circumstances, +[`process.stdout`][] and [`process.stderr`][] will be the only +`tty.WriteStream` instances created for a Node.js process and there +should be no reason to create additional instances. ### Event: 'resize' [`data:` URLs][] are supported for importing with the following MIME types: diff --git a/doc/api/fs.md b/doc/api/fs.md index a045f454188701..d5262766aa4bdb 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -735,7 +735,7 @@ milliseconds since the POSIX Epoch. ### stats.atimeNs * {bigint} @@ -747,7 +747,7 @@ nanoseconds since the POSIX Epoch. ### stats.mtimeNs * {bigint} @@ -759,7 +759,7 @@ nanoseconds since the POSIX Epoch. ### stats.ctimeNs * {bigint} @@ -771,7 +771,7 @@ in nanoseconds since the POSIX Epoch. ### stats.birthtimeNs * {bigint} @@ -1506,7 +1506,7 @@ fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);