diff --git a/.eslintrc.js b/.eslintrc.js index 39de6e690593a8..97456229969720 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -60,9 +60,9 @@ module.exports = { 'brace-style': ['error', '1tbs', { allowSingleLine: true }], 'capitalized-comments': ['error', 'always', { line: { - // Ignore all lines that have less characters than 50 and all lines that + // Ignore all lines that have less characters than 40 and all lines that // start with something that looks like a variable name or code. - ignorePattern: '^.{0,50}$|^ [a-z]+ ?[0-9A-Z_.(/=:[#-]', + ignorePattern: '^.{0,40}$|^ [a-z]+ ?[0-9A-Z_.(/=:[#-]|^ std', ignoreInlineComments: true, ignoreConsecutiveComments: true, }, diff --git a/.gitignore b/.gitignore index dad5a3efd8bcae..05e859c3066802 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,7 @@ vgcore.* v8*.log perf.data perf.data.old -.waf* tags -.lock-wscript *.pyc doc/api.xml tmp/ @@ -34,9 +32,7 @@ iojs_g node node_g *.swp -.benchmark_reports icu_config.gypi -.eslintcache node_trace.*.log coverage/ !**/node_modules/**/coverage @@ -64,8 +60,6 @@ ipch/ *.opensdf *.VC.db *.VC.opendb -.vs/ -.vscode/ /*.exe /config.mk @@ -86,7 +80,6 @@ deps/icu*.tgz deps/icu-tmp ./node_modules android-toolchain/ -.svn/ # generated by gyp on Windows deps/openssl/openssl.props diff --git a/.mailmap b/.mailmap index f5462dbb992482..aad595f12458fa 100644 --- a/.mailmap +++ b/.mailmap @@ -223,6 +223,7 @@ Leeseean Chiu Luke Bayes Lydia Kats Lydia Katsamberis Maciej Małecki +MaleDong Malte-Thorben Bruns Malte-Thorben Bruns skenqbx Mandeep Singh diff --git a/AUTHORS b/AUTHORS index 299800b059fe21..c46bf7939a7a10 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2249,7 +2249,6 @@ Sam Ruby Haroon Khan Developer Davo Jacek Pospychała -MaleDong iwko Sohail Rajdev Niicck diff --git a/BUILDING.md b/BUILDING.md index 03e25f56a97f17..c940e7be1504ae 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -80,8 +80,8 @@ platforms. This is true regardless of entries in the table below. | GNU/Linux | Tier 1 | kernel >= 2.6.32, glibc >= 2.12 | x64, arm | | | GNU/Linux | Tier 1 | kernel >= 3.10, glibc >= 2.17 | arm64 | | | macOS/OS X | Tier 1 | >= 10.11 | x64 | | -| Windows | Tier 1 | >= Windows 7/2008 R2/2012 R2 | x86, x64 | [2](#fn2),[3](#fn3),[4](#fn4) | -| SmartOS | Tier 2 | >= 15 < 16.4 | x86, x64 | [1](#fn1) | +| Windows | Tier 1 | >= Windows 7/2008 R2/2012 R2 | x86, x64 | [1](#fn1),[2](#fn2),[3](#fn3) | +| SmartOS | Tier 2 | >= 16 | x64 | | | FreeBSD | Tier 2 | >= 11 | x64 | | | GNU/Linux | Tier 2 | kernel >= 3.13.0, glibc >= 2.19 | ppc64le >=power8 | | | AIX | Tier 2 | >= 7.1 TL04 | ppc64be >=power7 | | @@ -89,25 +89,16 @@ platforms. This is true regardless of entries in the table below. | GNU/Linux | Experimental | kernel >= 2.6.32, glibc >= 2.12 | x86 | limited CI | | Linux (musl) | Experimental | musl >= 1.0 | x64 | | -1: The gcc4.8-libs package needs to be installed, because node - binaries have been built with GCC 4.8, for which runtime libraries are not - installed by default. For these node versions, the recommended binaries - are the ones available in pkgsrc, not the one available from nodejs.org. - Note that the binaries downloaded from the pkgsrc repositories are not - officially supported by the Node.js project, and instead are supported - by Joyent. SmartOS images >= 16.4 are not supported because - GCC 4.8 runtime libraries are not available in their pkgsrc repository - -2: Tier 1 support for building on Windows is only on 64-bit +1: Tier 1 support for building on Windows is only on 64-bit hosts. Support is experimental for 32-bit hosts. -3: On Windows, running Node.js in Windows terminal emulators +2: On Windows, running Node.js in Windows terminal emulators like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty) for the tty channels to work correctly (e.g. `winpty node.exe script.js`). In "Git bash" if you call the node shell alias (`node` without the `.exe` extension), `winpty` is used automatically. -4: The Windows Subsystem for Linux (WSL) is not directly +3: The Windows Subsystem for Linux (WSL) is not directly supported, but the GNU/Linux build process and binaries should work. The community will only address issues that reproduce on native GNU/Linux systems. Issues that only reproduce on WSL should be reported in the diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a941ec57aed64..aa6eab593b2f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ release. -11.10.1
+11.11.0
+11.10.1
11.10.0
11.9.0
11.8.0
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index aa1406a990b91f..646bc408a5fa89 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -312,58 +312,46 @@ For pull requests introducing new core modules: ### Additions to N-API -N-API provides an ABI-stable API guaranteed for future Node.js versions. -Existing N-API APIs cannot change or disappear, even in semver-major releases. -Thus, N-API additions call for unusual care and scrutiny. - -This -[guide](https://github.com/nodejs/node/blob/master/doc/guides/adding-new-napi-api.md) -outlines the requirements and principles that we should follow when -approving and landing new N-API APIs (any additions to `node_api.h` and -`node_api_types.h`). +N-API provides an ABI-stable API guaranteed for future Node.js versions. N-API +additions call for unusual care and scrutiny. If a change adds to `node_api.h` +or `node_api_types.h`, consult [the relevant +guide](https://github.com/nodejs/node/blob/master/doc/guides/adding-new-napi-api.md). ### Deprecations -[_Deprecation_][] is "the discouragement of use of some … feature … or practice, -typically because it has been superseded or is no longer considered efficient or -safe, without completely removing it or prohibiting its use. It can also imply -that a feature, design, or practice will be removed or discontinued entirely in -the future." - -Node.js uses three Deprecation levels: - -* *Documentation-Only Deprecation*: A deprecation notice is added to the API - documentation but no functional changes are implemented in the code. By - default, there will be no warnings emitted for such deprecations at - runtime. Documentation-only deprecations may trigger a runtime warning when - Node.js is started with the [`--pending-deprecation`][] flag or the - `NODE_PENDING_DEPRECATION=1` environment variable is set. - -* *Runtime Deprecation*: A warning is emitted at runtime the first time that a - deprecated API is used. The [`--throw-deprecation`][] flag can be used to - escalate such warnings into runtime errors that will cause the Node.js process - to exit. As with Documentation-Only Deprecation, the documentation for the API - must be updated to clearly indicate the deprecated status. - -* *End-of-life*: The API is no longer subject to the semantic versioning rules. - Backward-incompatible changes including complete removal of such APIs may - occur at any time. - -Documentation-Only Deprecations may be handled as semver-minor or semver-major -changes. Such deprecations have no impact on the successful operation of running -code and therefore should not be viewed as breaking changes. - -Runtime Deprecations and End-of-life APIs (internal or public) must be -handled as semver-major changes unless there is TSC consensus to land the -deprecation as a semver-minor. - -All Documentation-Only and Runtime deprecations will be assigned a unique -identifier that can be used to persistently refer to the deprecation in -documentation, emitted process warnings, or errors thrown. Documentation for -these identifiers will be included in the Node.js API documentation and will -be immutable once assigned. Even if End-of-Life code is removed from Node.js, -the documentation for the assigned deprecation identifier must remain in the -Node.js API documentation. +Node.js uses three [Deprecation][] levels. For all deprecated APIs, the API +documentation must state the deprecation status. + +* Documentation-Only Deprecation + * A deprecation notice appears in the API documentation. + * There are no functional changes. + * By default, there will be no warnings emitted for such deprecations at + runtime. + * May cause a runtime warning with the [`--pending-deprecation`][] flag or + `NODE_PENDING_DEPRECATION` environment variable. + +* Runtime Deprecation + * Emits a warning at runtime on first use of the deprecated API. + * If used with the [`--throw-deprecation`][] flag, will throw a runtime error. + +* End-of-life + * The API is no longer subject to the semantic versioning rules. + * Backward-incompatible changes including complete removal of such APIs may + occur at any time. + +Apply the `notable change` label to all pull requests that introduce +Documentation-Only Deprecations. Such deprecations have no impact on code +execution. Thus, they are not breaking changes (`semver-major`). + +Runtime Deprecations and End-of-life APIs (internal or public) are breaking +changes (`semver-major`). The TSC may make exceptions, deciding that one of +these deprecations is not a breaking change. + +All deprecations receive a unique and immutable identifier. Documentation, +warnings, and errors use the identifier when referring to the deprecation. The +documentation for the assigned deprecation identifier must always remain in the +API documentation. This is true even if the deprecation is no longer in use (for +example, due to removal of an End-of-Life deprecated API). A _Deprecation cycle_ is a major release during which an API has been in one of @@ -800,9 +788,9 @@ When things need extra attention, are controversial, or `semver-major`: If you cannot find who to cc for a file, `git shortlog -n -s ` may help. ["Merge Pull Request"]: https://help.github.com/articles/merging-a-pull-request/#merging-a-pull-request-on-github +[Deprecation]: https://en.wikipedia.org/wiki/Deprecation [Stability Index]: doc/api/documentation.md#stability-index [TSC]: https://github.com/nodejs/TSC -[_Deprecation_]: https://en.wikipedia.org/wiki/Deprecation [`--pending-deprecation`]: doc/api/cli.md#--pending-deprecation [`--throw-deprecation`]: doc/api/cli.md#--throw-deprecation [`node-core-utils`]: https://github.com/nodejs/node-core-utils diff --git a/Makefile b/Makefile index c3c9bdf6f765e4..dd18ebdcacc2f7 100644 --- a/Makefile +++ b/Makefile @@ -1184,8 +1184,12 @@ lint-js-fix: # Note that on the CI `lint-js-ci` is run instead. # Lints the JavaScript code with eslint. lint-js: - @echo "Running JS linter..." - @$(call available-node,$(run-lint-js)) + @if [ "$(shell $(node_use_openssl))" != "true" ]; then \ + echo "Skipping $@ (no crypto)"; \ + else \ + echo "Running JS linter..."; \ + $(call available-node,$(run-lint-js)) \ + fi jslint: lint-js @echo "Please use lint-js instead of jslint" @@ -1262,11 +1266,8 @@ else @echo "To install (requires internet access) run: $ make format-cpp-build" endif -ifeq ($(V),1) - CPPLINT_QUIET = -else - CPPLINT_QUIET = --quiet -endif +CPPLINT_QUIET = --quiet + .PHONY: lint-cpp # Lints the C++ code with cpplint.py and check-imports.py. lint-cpp: tools/.cpplintstamp diff --git a/README.md b/README.md index 7bc71da80fbc4e..91baaad51543fc 100644 --- a/README.md +++ b/README.md @@ -184,8 +184,6 @@ For information about the governance of the Node.js project, see **Jeremiah Senkpiel** <fishrock123@rocketmail.com> * [gabrielschulhof](https://github.com/gabrielschulhof) - **Gabriel Schulhof** <gabriel.schulhof@intel.com> -* [jasnell](https://github.com/jasnell) - -**James M Snell** <jasnell@gmail.com> (he/him) * [joyeecheung](https://github.com/joyeecheung) - **Joyee Cheung** <joyeec9h3@gmail.com> (she/her) * [mcollina](https://github.com/mcollina) - @@ -219,6 +217,8 @@ For information about the governance of the Node.js project, see **Fedor Indutny** <fedor.indutny@gmail.com> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me> +* [jasnell](https://github.com/jasnell) - +**James M Snell** <jasnell@gmail.com> (he/him) * [joshgav](https://github.com/joshgav) - **Josh Gavant** <josh.gavant@outlook.com> * [mscdex](https://github.com/mscdex) - diff --git a/benchmark/_cli.js b/benchmark/_cli.js index abd394694457c2..45e4c7a2bf05fb 100644 --- a/benchmark/_cli.js +++ b/benchmark/_cli.js @@ -28,7 +28,7 @@ function CLI(usage, settings) { } let currentOptional = null; - let mode = 'both'; // possible states are: [both, option, item] + let mode = 'both'; // Possible states are: [both, option, item] for (const arg of process.argv.slice(2)) { if (arg === '--') { @@ -59,7 +59,7 @@ function CLI(usage, settings) { this.optional[currentOptional] = arg; } - // the next value can be either an option or an item + // The next value can be either an option or an item mode = 'both'; } else if (['both', 'item'].includes(mode)) { // item arguments diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 584039a1e516e6..f426a32769d0dd 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -15,7 +15,7 @@ function main({ api, cipher, type, len, writes }) { cipher = 'AES192'; if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); - // use the legacy, just so that we can compare them. + // Use the legacy, just so that we can compare them. api = 'legacy'; } diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index faaa12a9e5d484..8ffbe148bb71a5 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -16,7 +16,7 @@ const bench = common.createBenchmark(main, { function main({ api, type, len, out, writes, algo }) { if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); - // use the legacy, just so that we can compare them. + // Use the legacy, just so that we can compare them. api = 'legacy'; } @@ -54,7 +54,7 @@ function legacyWrite(algo, message, encoding, writes, len, outEnc) { h.update(message, encoding); var res = h.digest(outEnc); - // include buffer creation costs for older versions + // Include buffer creation costs for older versions if (outEnc === 'buffer' && typeof res === 'string') res = Buffer.from(res, 'binary'); } diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index 934e7a0b11bdae..6ce7a6767e4880 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { function main({ api, type, len, algo, writes }) { if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); - // use the legacy, just so that we can compare them. + // Use the legacy, just so that we can compare them. api = 'legacy'; } diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 1295ac850609ab..13153c20cad569 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -1,5 +1,5 @@ 'use strict'; -// throughput benchmark in signing and verifying +// Throughput benchmark in signing and verifying const common = require('../common.js'); const crypto = require('crypto'); const fs = require('fs'); diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index 4ea39d1eb6a6ce..846fa1b9a4bddb 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -1,5 +1,5 @@ 'use strict'; -// throughput benchmark in signing and verifying +// Throughput benchmark in signing and verifying const common = require('../common.js'); const crypto = require('crypto'); const fs = require('fs'); diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index bce5f5c996b0a8..cb5d98dc3279f6 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -1,4 +1,4 @@ -// test the throughput of the fs.WriteStream class. +// Test the throughput of the fs.WriteStream class. 'use strict'; const path = require('path'); diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index a1daa619a352aa..bc88330929c2fc 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -1,4 +1,4 @@ -// test the throughput of the fs.WriteStream class. +// Test the throughput of the fs.WriteStream class. 'use strict'; const path = require('path'); diff --git a/benchmark/http/create-clientrequest.js b/benchmark/http/create-clientrequest.js index 76468a49aa0835..24d6e020c63bc0 100644 --- a/benchmark/http/create-clientrequest.js +++ b/benchmark/http/create-clientrequest.js @@ -1,7 +1,9 @@ 'use strict'; const common = require('../common.js'); -const ClientRequest = require('http').ClientRequest; +const { ClientRequest } = require('http'); +const assert = require('assert'); + const types = Object.keys(common.urls) .filter((i) => common.urls[i] .startsWith('http://')); @@ -15,36 +17,43 @@ const bench = common.createBenchmark(main, { function noop() {} function main({ url: type, arg, e }) { - e = +e; + e = Number(e); const data = common.bakeUrlData(type, e, false, false) .filter((i) => i.startsWith('http://')); const len = data.length; - var result; - var i; - if (arg === 'options') { - const options = data.map((i) => ({ - path: new URL(i).path, createConnection: noop - })); - bench.start(); - for (i = 0; i < len; i++) { - result = new ClientRequest(options[i]); + let result; + switch (arg) { + case 'options': { + const options = data.map((i) => ({ + path: new URL(i).path, createConnection: noop + })); + bench.start(); + for (let i = 0; i < len; i++) { + result = new ClientRequest(options[i]); + } + bench.end(len); + break; + } + case 'URL': { + const options = data.map((i) => new URL(i)); + bench.start(); + for (let i = 0; i < len; i++) { + result = new ClientRequest(options[i], { createConnection: noop }); + } + bench.end(len); + break; } - bench.end(len); - } else if (arg === 'URL') { - const options = data.map((i) => new URL(i)); - bench.start(); - for (i = 0; i < len; i++) { - result = new ClientRequest(options[i], { createConnection: noop }); + case 'string': { + bench.start(); + for (let i = 0; i < len; i++) { + result = new ClientRequest(data[i], { createConnection: noop }); + } + bench.end(len); + break; } - bench.end(len); - } else if (arg === 'string') { - bench.start(); - for (i = 0; i < len; i++) { - result = new ClientRequest(data[i], { createConnection: noop }); + default: { + throw new Error(`Unknown arg type ${arg}`); } - bench.end(len); - } else { - throw new Error(`Unknown arg type ${arg}`); } - require('assert').ok(result); + assert.ok(result); } diff --git a/benchmark/http/headers.js b/benchmark/http/headers.js index 60d800c20cf04f..8f611ae4743c93 100644 --- a/benchmark/http/headers.js +++ b/benchmark/http/headers.js @@ -4,21 +4,20 @@ const common = require('../common.js'); const http = require('http'); const bench = common.createBenchmark(main, { - duplicates: [1, 100], n: [10, 1000], + len: [1, 100], }); -function main({ duplicates, n }) { +function main({ len, n }) { const headers = { 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked', }; - for (var i = 0; i < n / duplicates; i++) { - headers[`foo${i}`] = []; - for (var j = 0; j < duplicates; j++) { - headers[`foo${i}`].push(`some header value ${i}`); - } + const Is = [ ...Array(n / len).keys() ]; + const Js = [ ...Array(len).keys() ]; + for (const i of Is) { + headers[`foo${i}`] = Js.map(() => `some header value ${i}`); } const server = http.createServer((req, res) => { diff --git a/benchmark/http/incoming_headers.js b/benchmark/http/incoming_headers.js index a1ab57e23876bf..7d9955766c7882 100644 --- a/benchmark/http/incoming_headers.js +++ b/benchmark/http/incoming_headers.js @@ -5,10 +5,10 @@ const http = require('http'); const bench = common.createBenchmark(main, { // unicode confuses ab on os x. c: [50, 500], - headerDuplicates: [0, 5, 20] + n: [0, 5, 20] }); -function main({ c, headerDuplicates }) { +function main({ c, n }) { const server = http.createServer((req, res) => { res.end(); }); @@ -21,7 +21,7 @@ function main({ c, headerDuplicates }) { 'Date': new Date().toString(), 'Cache-Control': 'no-cache' }; - for (let i = 0; i < headerDuplicates; i++) { + for (let i = 0; i < n; i++) { headers[`foo${i}`] = `some header value ${i}`; } bench.http({ diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 849b3651681e7f..fe320ddaa2716b 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const util = require('util'); -// if there are --dur=N and --len=N args, then +// If there are --dur=N and --len=N args, then // run the function with those settings. // if not, then queue up a bunch of child processes. const bench = common.createBenchmark(main, { @@ -36,7 +36,7 @@ function main({ dur, len, type }) { if (err) fail(err, 'connect'); - // the meat of the benchmark is right here: + // The meat of the benchmark is right here: bench.start(); var bytes = 0; diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index 10c69fb8b2d4bf..89db42dc4f3e72 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const util = require('util'); -// if there are --dur=N and --len=N args, then +// If there are --dur=N and --len=N args, then // run the function with those settings. // if not, then queue up a bunch of child processes. const bench = common.createBenchmark(main, { diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index d34434a3d02e41..73f4d292cf5541 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -122,7 +122,7 @@ function main({ dur, len, type }) { clientHandle.readStart(); - // the meat of the benchmark is right here: + // The meat of the benchmark is right here: bench.start(); setTimeout(() => { diff --git a/common.gypi b/common.gypi index f85bbd78ecb942..20ad4292c19df6 100644 --- a/common.gypi +++ b/common.gypi @@ -30,7 +30,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.17', + 'v8_embedder_string': '-node.18', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, diff --git a/configure.py b/configure.py index 2c163f485bf8ef..9317bb5b725807 100755 --- a/configure.py +++ b/configure.py @@ -617,6 +617,10 @@ def warn(msg): # track if warnings occurred warn.warned = False +def info(msg): + prefix = '\033[1m\033[32mINFO\033[0m' if os.isatty(1) else 'INFO' + print('%s: %s' % (prefix, msg)) + def print_verbose(x): if not options.verbose: return @@ -1179,10 +1183,6 @@ def configure_v8(o): o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) o['variables']['force_dynamic_crt'] = 1 if options.shared else 0 o['variables']['node_enable_d8'] = b(options.enable_d8) - # Unconditionally force typed arrays to allocate outside the v8 heap. This - # is to prevent memory pointers from being moved around that are returned by - # Buffer::Data(). - o['variables']['v8_typed_array_max_size_in_heap'] = 0 if options.enable_d8: o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp. if options.without_bundled_v8 and options.enable_d8: @@ -1292,7 +1292,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir): patchfile = '%s/%s/%s' % (dir_base, patch_dir, file) if os.path.isfile(patchfile): srcfile = '%s/%s' % (patch_dir, file) - warn('Using floating patch "%s" from "%s"' % (patchfile, dir_base)) + info('Using floating patch "%s" from "%s"' % (patchfile, dir_base)) list.append(srcfile) break return list diff --git a/deps/acorn/acorn/CHANGELOG.md b/deps/acorn/acorn/CHANGELOG.md index 254406af611d76..430b0b5cd14247 100644 --- a/deps/acorn/acorn/CHANGELOG.md +++ b/deps/acorn/acorn/CHANGELOG.md @@ -1,3 +1,13 @@ +## 6.1.0 (2019-02-08) + +### Bug fixes + +Fix scope checking when redefining a `var` as a lexical binding. + +### New features + +Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. + ## 6.0.7 (2019-02-04) ### Bug fixes diff --git a/deps/acorn/acorn/bin/acorn b/deps/acorn/acorn/bin/acorn old mode 100755 new mode 100644 diff --git a/deps/acorn/acorn/dist/acorn.js b/deps/acorn/acorn/dist/acorn.js index 913c072e1e0087..44d95c5fae74db 100644 --- a/deps/acorn/acorn/dist/acorn.js +++ b/deps/acorn/acorn/dist/acorn.js @@ -607,7 +607,7 @@ pp.strictDirective = function(start) { // Skip semicolon, if any. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this$1.input)[0].length; - if (this$1.input[start] === ';') + if (this$1.input[start] === ";") { start++; } } }; @@ -2139,47 +2139,53 @@ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; - for (var computed = (void 0);;) { - if ((computed = this$1.eat(types.bracketL)) || this$1.eat(types.dot)) { - var node = this$1.startNodeAt(startPos, startLoc); - node.object = base; - node.property = computed ? this$1.parseExpression() : this$1.parseIdent(true); - node.computed = !!computed; - if (computed) { this$1.expect(types.bracketR); } - base = this$1.finishNode(node, "MemberExpression"); - } else if (!noCalls && this$1.eat(types.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos, oldAwaitIdentPos = this$1.awaitIdentPos; - this$1.yieldPos = 0; - this$1.awaitPos = 0; - this$1.awaitIdentPos = 0; - var exprList = this$1.parseExprList(types.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(types.arrow)) { - this$1.checkPatternErrors(refDestructuringErrors, false); - this$1.checkYieldAwaitInDefaultParams(); - if (this$1.awaitIdentPos > 0) - { this$1.raise(this$1.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } - this$1.yieldPos = oldYieldPos; - this$1.awaitPos = oldAwaitPos; - this$1.awaitIdentPos = oldAwaitIdentPos; - return this$1.parseArrowExpression(this$1.startNodeAt(startPos, startLoc), exprList, true) - } - this$1.checkExpressionErrors(refDestructuringErrors, true); - this$1.yieldPos = oldYieldPos || this$1.yieldPos; - this$1.awaitPos = oldAwaitPos || this$1.awaitPos; - this$1.awaitIdentPos = oldAwaitIdentPos || this$1.awaitIdentPos; - var node$1 = this$1.startNodeAt(startPos, startLoc); - node$1.callee = base; - node$1.arguments = exprList; - base = this$1.finishNode(node$1, "CallExpression"); - } else if (this$1.type === types.backQuote) { - var node$2 = this$1.startNodeAt(startPos, startLoc); - node$2.tag = base; - node$2.quasi = this$1.parseTemplate({isTagged: true}); - base = this$1.finishNode(node$2, "TaggedTemplateExpression"); - } else { - return base + while (true) { + var element = this$1.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); + if (element === base || element.type === "ArrowFunctionExpression") { return element } + base = element; + } +}; + +pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { + var computed = this.eat(types.bracketL); + if (computed || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(true); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + 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(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); } + return base }; // Parse an atomic expression — either a single token that is an @@ -2874,7 +2880,7 @@ pp$5.exitScope = function() { // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. pp$5.treatFunctionsAsVarInScope = function(scope) { - return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP); + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; pp$5.declareName = function(name, bindingType, pos) { @@ -2900,7 +2906,7 @@ pp$5.declareName = function(name, bindingType, pos) { } else { for (var i = this.scopeStack.length - 1; i >= 0; --i) { var scope$3 = this$1.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name || + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || !this$1.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { redeclared = true; break @@ -4955,7 +4961,7 @@ pp$8.readWord = function() { // // [walk]: util/walk.js -var version = "6.0.7"; +var version = "6.1.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/deps/acorn/acorn/dist/acorn.js.map b/deps/acorn/acorn/dist/acorn.js.map index 9f9ed77cccdfdf..219dac5954a3be 100644 --- a/deps/acorn/acorn/dist/acorn.js.map +++ b/deps/acorn/acorn/dist/acorn.js.map @@ -1 +1 @@ -{"version":3,"file":"acorn.js","sources":["../src/identifier.js","../src/tokentype.js","../src/whitespace.js","../src/util.js","../src/locutil.js","../src/options.js","../src/scopeflags.js","../src/state.js","../src/parseutil.js","../src/statement.js","../src/lval.js","../src/expression.js","../src/location.js","../src/scope.js","../src/node.js","../src/tokencontext.js","../src/unicode-property-data.js","../src/regexp.js","../src/tokenize.js","../src/index.js"],"sourcesContent":["// Reserved word lists for various dialects of the language\n\nexport const reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n}\n\n// And the keywords\n\nconst ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\"\n\nexport const keywords = {\n 5: ecma5AndLessKeywords,\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n}\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\n// Generated by `bin/generate-identifier-regex.js`.\n\nlet nonASCIIidentifierStartChars = \"\\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\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\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\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08bd\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8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0e8d\\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-\\u1878\\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\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\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-\\u312f\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fef\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7b9\\ua7f7-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\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\"\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf2-\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\"\n\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\")\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\")\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null\n\n// These are a run-length and offset encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by bin/generate-identifier-regex.js\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n let pos = 0x10000\n for (let i = 0; i < set.length; i += 2) {\n pos += set[i]\n if (pos > code) return false\n pos += set[i + 1]\n if (pos >= code) return true\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code, astral) {\n if (code < 65) return code === 36\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n","// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nexport class TokenType {\n constructor(label, conf = {}) {\n this.label = label\n this.keyword = conf.keyword\n this.beforeExpr = !!conf.beforeExpr\n this.startsExpr = !!conf.startsExpr\n this.isLoop = !!conf.isLoop\n this.isAssign = !!conf.isAssign\n this.prefix = !!conf.prefix\n this.postfix = !!conf.postfix\n this.binop = conf.binop || null\n this.updateContext = null\n }\n}\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nconst beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}\n\n// Map keyword names to token types.\n\nexport const keywords = {}\n\n// Succinct definitions of keyword token types\nfunction kw(name, options = {}) {\n options.keyword = name\n return keywords[name] = new TokenType(name, options)\n}\n\nexport const types = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\"),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n}\n","// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nexport const lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\")\n\nexport function isNewLine(code, ecma2019String) {\n return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))\n}\n\nexport const nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g\n","const {hasOwnProperty, toString} = Object.prototype\n\n// Checks if an object has a property.\n\nexport function has(obj, propName) {\n return hasOwnProperty.call(obj, propName)\n}\n\nexport const isArray = Array.isArray || ((obj) => (\n toString.call(obj) === \"[object Array]\"\n))\n\nexport function wordsRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n","import {lineBreakG} from \"./whitespace\"\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n constructor(line, col) {\n this.line = line\n this.column = col\n }\n\n offset(n) {\n return new Position(this.line, this.column + n)\n }\n}\n\nexport class SourceLocation {\n constructor(p, start, end) {\n this.start = start\n this.end = end\n if (p.sourceFile !== null) this.source = p.sourceFile\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input, offset) {\n for (let line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n let match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}\n","import {has, isArray} from \"./util\"\nimport {SourceLocation} from \"./locutil\"\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport const defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10\n // (2019). This influences support for strict mode, the set of\n // reserved words, and support for new syntax features. The default\n // is 9.\n ecmaVersion: 9,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: false,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n}\n\n// Interpret and default an options object\n\nexport function getOptions(opts) {\n let options = {}\n\n for (let opt in defaultOptions)\n options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]\n\n if (options.ecmaVersion >= 2015)\n options.ecmaVersion -= 2009\n\n if (options.allowReserved == null)\n options.allowReserved = options.ecmaVersion < 5\n\n if (isArray(options.onToken)) {\n let tokens = options.onToken\n options.onToken = (token) => tokens.push(token)\n }\n if (isArray(options.onComment))\n options.onComment = pushComment(options, options.onComment)\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n let comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n }\n if (options.locations)\n comment.loc = new SourceLocation(this, startLoc, endLoc)\n if (options.ranges)\n comment.range = [start, end]\n array.push(comment)\n }\n}\n","// Each scope gets a bitset that may contain these flags\nexport const\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128\n\nexport function functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal and declareName to determine the type of a binding\nexport const\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5 // Special case for function names as bound inside the function\n","import {reservedWords, keywords} from \"./identifier\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\nimport {getOptions} from \"./options\"\nimport {wordsRegexp} from \"./util\"\nimport {SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_SUPER, SCOPE_DIRECT_SUPER} from \"./scopeflags\"\n\nexport class Parser {\n constructor(options, input, startPos) {\n this.options = options = getOptions(options)\n this.sourceFile = options.sourceFile\n this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5])\n let reserved = \"\"\n if (!options.allowReserved) {\n for (let v = options.ecmaVersion;; v--)\n if (reserved = reservedWords[v]) break\n if (options.sourceType === \"module\") reserved += \" await\"\n }\n this.reservedWords = wordsRegexp(reserved)\n let reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict\n this.reservedWordsStrict = wordsRegexp(reservedStrict)\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind)\n this.input = String(input)\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length\n } else {\n this.pos = this.lineStart = 0\n this.curLine = 1\n }\n\n // Properties of the current token:\n // Its type\n this.type = tt.eof\n // For tokens that include more information than their type, the value\n this.value = null\n // Its start and end offset\n this.start = this.end = this.pos\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition()\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null\n this.lastTokStart = this.lastTokEnd = this.pos\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext()\n this.exprAllowed = true\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\"\n this.strict = this.inModule || this.strictDirective(this.pos)\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0\n // Labels in scope.\n this.labels = []\n // Thus-far undefined exports.\n this.undefinedExports = {};\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n this.skipLineComment(2)\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = []\n this.enterScope(SCOPE_TOP)\n\n // For RegExp validation\n this.regexpState = null\n }\n\n parse() {\n let node = this.options.program || this.startNode()\n this.nextToken()\n return this.parseTopLevel(node)\n }\n\n get inFunction() { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }\n get inGenerator() { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }\n get inAsync() { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }\n get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }\n get allowDirectSuper() { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }\n get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()) }\n\n // Switch to a getter for 7.0.0.\n inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }\n\n static extend(...plugins) {\n let cls = this\n for (let i = 0; i < plugins.length; i++) cls = plugins[i](cls)\n return cls\n }\n\n static parse(input, options) {\n return new this(options, input).parse()\n }\n\n static parseExpressionAt(input, pos, options) {\n let parser = new this(options, input, pos)\n parser.nextToken()\n return parser.parseExpression()\n }\n\n static tokenizer(input, options) {\n return new this(options, input)\n }\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\n\nconst pp = Parser.prototype\n\n// ## Parser utilities\n\nconst literal = /^(?:'((?:\\\\.|[^'])*?)'|\"((?:\\\\.|[^\"])*?)\")/\npp.strictDirective = function(start) {\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n let match = literal.exec(this.input.slice(start))\n if (!match) return false\n if ((match[1] || match[2]) === \"use strict\") return true\n start += match[0].length\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n if (this.input[start] === ';')\n start++\n }\n}\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp.eat = function(type) {\n if (this.type === type) {\n this.next()\n return true\n } else {\n return false\n }\n}\n\n// Tests whether parsed token is a contextual keyword.\n\npp.isContextual = function(name) {\n return this.type === tt.name && this.value === name && !this.containsEsc\n}\n\n// Consumes contextual keyword if possible.\n\npp.eatContextual = function(name) {\n if (!this.isContextual(name)) return false\n this.next()\n return true\n}\n\n// Asserts that following token is given contextual keyword.\n\npp.expectContextual = function(name) {\n if (!this.eatContextual(name)) this.unexpected()\n}\n\n// Test whether a semicolon can be inserted at the current position.\n\npp.canInsertSemicolon = function() {\n return this.type === tt.eof ||\n this.type === tt.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\npp.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc)\n return true\n }\n}\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp.semicolon = function() {\n if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected()\n}\n\npp.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc)\n if (!notNext)\n this.next()\n return true\n }\n}\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp.expect = function(type) {\n this.eat(type) || this.unexpected()\n}\n\n// Raise an unexpected token error.\n\npp.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\")\n}\n\nexport function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1\n}\n\npp.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) return\n if (refDestructuringErrors.trailingComma > -1)\n this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\")\n let parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind\n if (parens > -1) this.raiseRecoverable(parens, \"Parenthesized pattern\")\n}\n\npp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) return false\n let {shorthandAssign, doubleProto} = refDestructuringErrors\n if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0\n if (shorthandAssign >= 0)\n this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\")\n if (doubleProto >= 0)\n this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\")\n}\n\npp.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n this.raise(this.yieldPos, \"Yield expression cannot be a default value\")\n if (this.awaitPos)\n this.raise(this.awaitPos, \"Await expression cannot be a default value\")\n}\n\npp.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n return this.isSimpleAssignTarget(expr.expression)\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\nimport {isIdentifierStart, isIdentifierChar, keywordRelationalOperator} from \"./identifier\"\nimport {has} from \"./util\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {functionFlags, SCOPE_SIMPLE_CATCH, BIND_SIMPLE_CATCH, BIND_LEXICAL, BIND_VAR, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp.parseTopLevel = function(node) {\n let exports = {}\n if (!node.body) node.body = []\n while (this.type !== tt.eof) {\n let stmt = this.parseStatement(null, true, exports)\n node.body.push(stmt)\n }\n if (this.inModule)\n for (let name of Object.keys(this.undefinedExports))\n this.raiseRecoverable(this.undefinedExports[name].start, `Export '${name}' is not defined`);\n this.adaptDirectivePrologue(node.body)\n this.next()\n if (this.options.ecmaVersion >= 6) {\n node.sourceType = this.options.sourceType\n }\n return this.finishNode(node, \"Program\")\n}\n\nconst loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"}\n\npp.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) return false\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91) return true // '['\n if (context) return false\n\n if (nextCh === 123) return true // '{'\n if (isIdentifierStart(nextCh, true)) {\n let pos = next + 1\n while (isIdentifierChar(this.input.charCodeAt(pos), true)) ++pos\n let ident = this.input.slice(next, pos)\n if (!keywordRelationalOperator.test(ident)) return true\n }\n return false\n}\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n return false\n\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))\n}\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp.parseStatement = function(context, topLevel, exports) {\n let starttype = this.type, node = this.startNode(), kind\n\n if (this.isLet(context)) {\n starttype = tt._var\n kind = \"let\"\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case tt._debugger: return this.parseDebuggerStatement(node)\n case tt._do: return this.parseDoStatement(node)\n case tt._for: return this.parseForStatement(node)\n case tt._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) this.unexpected()\n return this.parseFunctionStatement(node, false, !context)\n case tt._class:\n if (context) this.unexpected()\n return this.parseClass(node, true)\n case tt._if: return this.parseIfStatement(node)\n case tt._return: return this.parseReturnStatement(node)\n case tt._switch: return this.parseSwitchStatement(node)\n case tt._throw: return this.parseThrowStatement(node)\n case tt._try: return this.parseTryStatement(node)\n case tt._const: case tt._var:\n kind = kind || this.value\n if (context && kind !== \"var\") this.unexpected()\n return this.parseVarStatement(node, kind)\n case tt._while: return this.parseWhileStatement(node)\n case tt._with: return this.parseWithStatement(node)\n case tt.braceL: return this.parseBlock(true, node)\n case tt.semi: return this.parseEmptyStatement(node)\n case tt._export:\n case tt._import:\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n this.raise(this.start, \"'import' and 'export' may only appear at the top level\")\n if (!this.inModule)\n this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\")\n }\n return starttype === tt._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) this.unexpected()\n this.next()\n return this.parseFunctionStatement(node, true, !context)\n }\n\n let maybeName = this.value, expr = this.parseExpression()\n if (starttype === tt.name && expr.type === \"Identifier\" && this.eat(tt.colon))\n return this.parseLabeledStatement(node, maybeName, expr, context)\n else return this.parseExpressionStatement(node, expr)\n }\n}\n\npp.parseBreakContinueStatement = function(node, keyword) {\n let isBreak = keyword === \"break\"\n this.next()\n if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null\n else if (this.type !== tt.name) this.unexpected()\n else {\n node.label = this.parseIdent()\n this.semicolon()\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n let i = 0\n for (; i < this.labels.length; ++i) {\n let lab = this.labels[i]\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break\n if (node.label && isBreak) break\n }\n }\n if (i === this.labels.length) this.raise(node.start, \"Unsyntactic \" + keyword)\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n}\n\npp.parseDebuggerStatement = function(node) {\n this.next()\n this.semicolon()\n return this.finishNode(node, \"DebuggerStatement\")\n}\n\npp.parseDoStatement = function(node) {\n this.next()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"do\")\n this.labels.pop()\n this.expect(tt._while)\n node.test = this.parseParenExpression()\n if (this.options.ecmaVersion >= 6)\n this.eat(tt.semi)\n else\n this.semicolon()\n return this.finishNode(node, \"DoWhileStatement\")\n}\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp.parseForStatement = function(node) {\n this.next()\n let awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual(\"await\")) ? this.lastTokStart : -1\n this.labels.push(loopLabel)\n this.enterScope(0)\n this.expect(tt.parenL)\n if (this.type === tt.semi) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, null)\n }\n let isLet = this.isLet()\n if (this.type === tt._var || this.type === tt._const || isLet) {\n let init = this.startNode(), kind = isLet ? \"let\" : this.value\n this.next()\n this.parseVar(init, true, kind)\n this.finishNode(init, \"VariableDeclaration\")\n if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1 &&\n !(kind !== \"var\" && init.declarations[0].init)) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n }\n let refDestructuringErrors = new DestructuringErrors\n let init = this.parseExpression(true, refDestructuringErrors)\n if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n this.toAssignable(init, false, refDestructuringErrors)\n this.checkLVal(init)\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n}\n\npp.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next()\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n}\n\npp.parseIfStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\")\n node.alternate = this.eat(tt._else) ? this.parseStatement(\"if\") : null\n return this.finishNode(node, \"IfStatement\")\n}\n\npp.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n this.raise(this.start, \"'return' outside of function\")\n this.next()\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null\n else { node.argument = this.parseExpression(); this.semicolon() }\n return this.finishNode(node, \"ReturnStatement\")\n}\n\npp.parseSwitchStatement = function(node) {\n this.next()\n node.discriminant = this.parseParenExpression()\n node.cases = []\n this.expect(tt.braceL)\n this.labels.push(switchLabel)\n this.enterScope(0)\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur\n for (let sawDefault = false; this.type !== tt.braceR;) {\n if (this.type === tt._case || this.type === tt._default) {\n let isCase = this.type === tt._case\n if (cur) this.finishNode(cur, \"SwitchCase\")\n node.cases.push(cur = this.startNode())\n cur.consequent = []\n this.next()\n if (isCase) {\n cur.test = this.parseExpression()\n } else {\n if (sawDefault) this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\")\n sawDefault = true\n cur.test = null\n }\n this.expect(tt.colon)\n } else {\n if (!cur) this.unexpected()\n cur.consequent.push(this.parseStatement(null))\n }\n }\n this.exitScope()\n if (cur) this.finishNode(cur, \"SwitchCase\")\n this.next() // Closing brace\n this.labels.pop()\n return this.finishNode(node, \"SwitchStatement\")\n}\n\npp.parseThrowStatement = function(node) {\n this.next()\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n this.raise(this.lastTokEnd, \"Illegal newline after throw\")\n node.argument = this.parseExpression()\n this.semicolon()\n return this.finishNode(node, \"ThrowStatement\")\n}\n\n// Reused empty array added for node fields that are always empty.\n\nconst empty = []\n\npp.parseTryStatement = function(node) {\n this.next()\n node.block = this.parseBlock()\n node.handler = null\n if (this.type === tt._catch) {\n let clause = this.startNode()\n this.next()\n if (this.eat(tt.parenL)) {\n clause.param = this.parseBindingAtom()\n let simple = clause.param.type === \"Identifier\"\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0)\n this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL)\n this.expect(tt.parenR)\n } else {\n if (this.options.ecmaVersion < 10) this.unexpected()\n clause.param = null\n this.enterScope(0)\n }\n clause.body = this.parseBlock(false)\n this.exitScope()\n node.handler = this.finishNode(clause, \"CatchClause\")\n }\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null\n if (!node.handler && !node.finalizer)\n this.raise(node.start, \"Missing catch or finally clause\")\n return this.finishNode(node, \"TryStatement\")\n}\n\npp.parseVarStatement = function(node, kind) {\n this.next()\n this.parseVar(node, false, kind)\n this.semicolon()\n return this.finishNode(node, \"VariableDeclaration\")\n}\n\npp.parseWhileStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"while\")\n this.labels.pop()\n return this.finishNode(node, \"WhileStatement\")\n}\n\npp.parseWithStatement = function(node) {\n if (this.strict) this.raise(this.start, \"'with' in strict mode\")\n this.next()\n node.object = this.parseParenExpression()\n node.body = this.parseStatement(\"with\")\n return this.finishNode(node, \"WithStatement\")\n}\n\npp.parseEmptyStatement = function(node) {\n this.next()\n return this.finishNode(node, \"EmptyStatement\")\n}\n\npp.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (let label of this.labels)\n if (label.name === maybeName)\n this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\")\n let kind = this.type.isLoop ? \"loop\" : this.type === tt._switch ? \"switch\" : null\n for (let i = this.labels.length - 1; i >= 0; i--) {\n let label = this.labels[i]\n if (label.statementStart === node.start) {\n // Update information about previous labels on this node\n label.statementStart = this.start\n label.kind = kind\n } else break\n }\n this.labels.push({name: maybeName, kind, statementStart: this.start})\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\")\n this.labels.pop()\n node.label = expr\n return this.finishNode(node, \"LabeledStatement\")\n}\n\npp.parseExpressionStatement = function(node, expr) {\n node.expression = expr\n this.semicolon()\n return this.finishNode(node, \"ExpressionStatement\")\n}\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp.parseBlock = function(createNewLexicalScope = true, node = this.startNode()) {\n node.body = []\n this.expect(tt.braceL)\n if (createNewLexicalScope) this.enterScope(0)\n while (!this.eat(tt.braceR)) {\n let stmt = this.parseStatement(null)\n node.body.push(stmt)\n }\n if (createNewLexicalScope) this.exitScope()\n return this.finishNode(node, \"BlockStatement\")\n}\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp.parseFor = function(node, init) {\n node.init = init\n this.expect(tt.semi)\n node.test = this.type === tt.semi ? null : this.parseExpression()\n this.expect(tt.semi)\n node.update = this.type === tt.parenR ? null : this.parseExpression()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, \"ForStatement\")\n}\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp.parseForIn = function(node, init) {\n let type = this.type === tt._in ? \"ForInStatement\" : \"ForOfStatement\"\n this.next()\n if (type === \"ForInStatement\") {\n if (init.type === \"AssignmentPattern\" ||\n (init.type === \"VariableDeclaration\" && init.declarations[0].init != null &&\n (this.strict || init.declarations[0].id.type !== \"Identifier\")))\n this.raise(init.start, \"Invalid assignment in for-in loop head\")\n }\n node.left = init\n node.right = type === \"ForInStatement\" ? this.parseExpression() : this.parseMaybeAssign()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, type)\n}\n\n// Parse a list of variable declarations.\n\npp.parseVar = function(node, isFor, kind) {\n node.declarations = []\n node.kind = kind\n for (;;) {\n let decl = this.startNode()\n this.parseVarId(decl, kind)\n if (this.eat(tt.eq)) {\n decl.init = this.parseMaybeAssign(isFor)\n } else if (kind === \"const\" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected()\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === tt._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\")\n } else {\n decl.init = null\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"))\n if (!this.eat(tt.comma)) break\n }\n return node\n}\n\npp.parseVarId = function(decl, kind) {\n if ((kind === \"const\" || kind === \"let\") && this.isContextual(\"let\")) {\n this.raiseRecoverable(this.start, \"let is disallowed as a lexically bound name\");\n }\n decl.id = this.parseBindingAtom()\n this.checkLVal(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false)\n}\n\nconst FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4\n\n// Parse a function declaration or literal (depending on the\n// `statement & FUNC_STATEMENT`).\n\n// Remove `allowExpressionBody` for 7.0.0, as it is only called with false\npp.parseFunction = function(node, statement, allowExpressionBody, isAsync) {\n this.initFunction(node)\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === tt.star && (statement & FUNC_HANGING_STATEMENT))\n this.unexpected()\n node.generator = this.eat(tt.star)\n }\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== tt.name ? null : this.parseIdent()\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);\n }\n\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n this.enterScope(functionFlags(node.async, node.generator))\n\n if (!(statement & FUNC_STATEMENT))\n node.id = this.type === tt.name ? this.parseIdent() : null\n\n this.parseFunctionParams(node)\n this.parseFunctionBody(node, allowExpressionBody, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n}\n\npp.parseFunctionParams = function(node) {\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n}\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseClass = function(node, isStatement) {\n this.next()\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n const oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement)\n this.parseClassSuper(node)\n let classBody = this.startNode()\n let hadConstructor = false\n classBody.body = []\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n const element = this.parseClassElement(node.superClass !== null)\n if (element) {\n classBody.body.push(element)\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) this.raise(element.start, \"Duplicate constructor in the same class\")\n hadConstructor = true\n }\n }\n }\n node.body = this.finishNode(classBody, \"ClassBody\")\n this.strict = oldStrict;\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n}\n\npp.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(tt.semi)) return null\n\n let method = this.startNode()\n const tryContextual = (k, noLineBreak = false) => {\n const start = this.start, startLoc = this.startLoc\n if (!this.eatContextual(k)) return false\n if (this.type !== tt.parenL && (!noLineBreak || !this.canInsertSemicolon())) return true\n if (method.key) this.unexpected()\n method.computed = false\n method.key = this.startNodeAt(start, startLoc)\n method.key.name = k\n this.finishNode(method.key, \"Identifier\")\n return false\n }\n\n method.kind = \"method\"\n method.static = tryContextual(\"static\")\n let isGenerator = this.eat(tt.star)\n let isAsync = false\n if (!isGenerator) {\n if (this.options.ecmaVersion >= 8 && tryContextual(\"async\", true)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n } else if (tryContextual(\"get\")) {\n method.kind = \"get\"\n } else if (tryContextual(\"set\")) {\n method.kind = \"set\"\n }\n }\n if (!method.key) this.parsePropertyName(method)\n let {key} = method\n let allowsDirectSuper = false\n if (!method.computed && !method.static && (key.type === \"Identifier\" && key.name === \"constructor\" ||\n key.type === \"Literal\" && key.value === \"constructor\")) {\n if (method.kind !== \"method\") this.raise(key.start, \"Constructor can't have get/set modifier\")\n if (isGenerator) this.raise(key.start, \"Constructor can't be a generator\")\n if (isAsync) this.raise(key.start, \"Constructor can't be an async method\")\n method.kind = \"constructor\"\n allowsDirectSuper = constructorAllowsSuper\n } else if (method.static && key.type === \"Identifier\" && key.name === \"prototype\") {\n this.raise(key.start, \"Classes may not have a static property named prototype\")\n }\n this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper)\n if (method.kind === \"get\" && method.value.params.length !== 0)\n this.raiseRecoverable(method.value.start, \"getter should have no params\")\n if (method.kind === \"set\" && method.value.params.length !== 1)\n this.raiseRecoverable(method.value.start, \"setter should have exactly one param\")\n if (method.kind === \"set\" && method.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(method.value.params[0].start, \"Setter cannot use rest params\")\n return method\n}\n\npp.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper)\n return this.finishNode(method, \"MethodDefinition\")\n}\n\npp.parseClassId = function(node, isStatement) {\n if (this.type === tt.name) {\n node.id = this.parseIdent();\n if (isStatement === true)\n this.checkLVal(node.id, BIND_LEXICAL, false)\n } else {\n if (isStatement === true)\n this.unexpected();\n node.id = null;\n }\n}\n\npp.parseClassSuper = function(node) {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null\n}\n\n// Parses module export declaration.\n\npp.parseExport = function(node, exports) {\n this.next()\n // export * from '...'\n if (this.eat(tt.star)) {\n this.expectContextual(\"from\")\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n this.semicolon()\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(tt._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart)\n let isAsync\n if (this.type === tt._function || (isAsync = this.isAsyncFunction())) {\n let fNode = this.startNode()\n this.next()\n if (isAsync) this.next()\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)\n } else if (this.type === tt._class) {\n let cNode = this.startNode()\n node.declaration = this.parseClass(cNode, \"nullableID\")\n } else {\n node.declaration = this.parseMaybeAssign()\n this.semicolon()\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null)\n if (node.declaration.type === \"VariableDeclaration\")\n this.checkVariableExport(exports, node.declaration.declarations)\n else\n this.checkExport(exports, node.declaration.id.name, node.declaration.id.start)\n node.specifiers = []\n node.source = null\n } else { // export { x, y as z } [from '...']\n node.declaration = null\n node.specifiers = this.parseExportSpecifiers(exports)\n if (this.eatContextual(\"from\")) {\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n } else {\n for (let spec of node.specifiers) {\n // check for keywords used as local names\n this.checkUnreserved(spec.local)\n // check if export is defined\n this.checkLocalExport(spec.local)\n }\n\n node.source = null\n }\n this.semicolon()\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n}\n\npp.checkExport = function(exports, name, pos) {\n if (!exports) return\n if (has(exports, name))\n this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\")\n exports[name] = true\n}\n\npp.checkPatternExport = function(exports, pat) {\n let type = pat.type\n if (type === \"Identifier\")\n this.checkExport(exports, pat.name, pat.start)\n else if (type === \"ObjectPattern\")\n for (let prop of pat.properties)\n this.checkPatternExport(exports, prop)\n else if (type === \"ArrayPattern\")\n for (let elt of pat.elements) {\n if (elt) this.checkPatternExport(exports, elt)\n }\n else if (type === \"Property\")\n this.checkPatternExport(exports, pat.value)\n else if (type === \"AssignmentPattern\")\n this.checkPatternExport(exports, pat.left)\n else if (type === \"RestElement\")\n this.checkPatternExport(exports, pat.argument)\n else if (type === \"ParenthesizedExpression\")\n this.checkPatternExport(exports, pat.expression)\n}\n\npp.checkVariableExport = function(exports, decls) {\n if (!exports) return\n for (let decl of decls)\n this.checkPatternExport(exports, decl.id)\n}\n\npp.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n}\n\n// Parses a comma-separated list of module exports.\n\npp.parseExportSpecifiers = function(exports) {\n let nodes = [], first = true\n // export { x, y as z } [from '...']\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.local = this.parseIdent(true)\n node.exported = this.eatContextual(\"as\") ? this.parseIdent(true) : node.local\n this.checkExport(exports, node.exported.name, node.exported.start)\n nodes.push(this.finishNode(node, \"ExportSpecifier\"))\n }\n return nodes\n}\n\n// Parses import declaration.\n\npp.parseImport = function(node) {\n this.next()\n // import '...'\n if (this.type === tt.string) {\n node.specifiers = empty\n node.source = this.parseExprAtom()\n } else {\n node.specifiers = this.parseImportSpecifiers()\n this.expectContextual(\"from\")\n node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()\n }\n this.semicolon()\n return this.finishNode(node, \"ImportDeclaration\")\n}\n\n// Parses a comma-separated list of module imports.\n\npp.parseImportSpecifiers = function() {\n let nodes = [], first = true\n if (this.type === tt.name) {\n // import defaultObj, { x, y as z } from '...'\n let node = this.startNode()\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"))\n if (!this.eat(tt.comma)) return nodes\n }\n if (this.type === tt.star) {\n let node = this.startNode()\n this.next()\n this.expectContextual(\"as\")\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportNamespaceSpecifier\"))\n return nodes\n }\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.imported = this.parseIdent(true)\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent()\n } else {\n this.checkUnreserved(node.imported)\n node.local = node.imported\n }\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportSpecifier\"))\n }\n return nodes\n}\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp.adaptDirectivePrologue = function(statements) {\n for (let i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1)\n }\n}\npp.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {has} from \"./util\"\nimport {BIND_NONE, BIND_OUTSIDE} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\")\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n for (let prop of node.properties) {\n this.toAssignable(prop, isBinding)\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\")\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") this.raise(node.key.start, \"Object pattern can't contain getter or setter\")\n this.toAssignable(node.value, isBinding)\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n this.toAssignableList(node.elements, isBinding)\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\"\n this.toAssignable(node.argument, isBinding)\n if (node.argument.type === \"AssignmentPattern\")\n this.raise(node.argument.start, \"Rest elements cannot have a default value\")\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\")\n node.type = \"AssignmentPattern\"\n delete node.operator\n this.toAssignable(node.left, isBinding)\n // falls through to AssignmentPattern\n\n case \"AssignmentPattern\":\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors)\n break\n\n case \"MemberExpression\":\n if (!isBinding) break\n\n default:\n this.raise(node.start, \"Assigning to rvalue\")\n }\n } else if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n return node\n}\n\n// Convert list of expression atoms to binding list.\n\npp.toAssignableList = function(exprList, isBinding) {\n let end = exprList.length\n for (let i = 0; i < end; i++) {\n let elt = exprList[i]\n if (elt) this.toAssignable(elt, isBinding)\n }\n if (end) {\n let last = exprList[end - 1]\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n this.unexpected(last.argument.start)\n }\n return exprList\n}\n\n// Parses spread element.\n\npp.parseSpread = function(refDestructuringErrors) {\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n return this.finishNode(node, \"SpreadElement\")\n}\n\npp.parseRestBinding = function() {\n let node = this.startNode()\n this.next()\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== tt.name)\n this.unexpected()\n\n node.argument = this.parseBindingAtom()\n\n return this.finishNode(node, \"RestElement\")\n}\n\n// Parses lvalue (assignable) atom.\n\npp.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case tt.bracketL:\n let node = this.startNode()\n this.next()\n node.elements = this.parseBindingList(tt.bracketR, true, true)\n return this.finishNode(node, \"ArrayPattern\")\n\n case tt.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n}\n\npp.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (first) first = false\n else this.expect(tt.comma)\n if (allowEmpty && this.type === tt.comma) {\n elts.push(null)\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === tt.ellipsis) {\n let rest = this.parseRestBinding()\n this.parseBindingListItem(rest)\n elts.push(rest)\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n this.expect(close)\n break\n } else {\n let elem = this.parseMaybeDefault(this.start, this.startLoc)\n this.parseBindingListItem(elem)\n elts.push(elem)\n }\n }\n return elts\n}\n\npp.parseBindingListItem = function(param) {\n return param\n}\n\n// Parses assignment pattern around given atom if possible.\n\npp.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom()\n if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.right = this.parseMaybeAssign()\n return this.finishNode(node, \"AssignmentPattern\")\n}\n\n// Verify that a node is an lval — something that can be assigned\n// to.\n// bindingType can be either:\n// 'var' indicating that the lval creates a 'var' binding\n// 'let' indicating that the lval creates a lexical ('let' or 'const') binding\n// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references\n\npp.checkLVal = function(expr, bindingType = BIND_NONE, checkClashes) {\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n this.raiseRecoverable(expr.start, (bindingType ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\")\n if (checkClashes) {\n if (has(checkClashes, expr.name))\n this.raiseRecoverable(expr.start, \"Argument name clash\")\n checkClashes[expr.name] = true\n }\n if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) this.declareName(expr.name, bindingType, expr.start)\n break\n\n case \"MemberExpression\":\n if (bindingType) this.raiseRecoverable(expr.start, \"Binding member expression\")\n break\n\n case \"ObjectPattern\":\n for (let prop of expr.properties)\n this.checkLVal(prop, bindingType, checkClashes)\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLVal(expr.value, bindingType, checkClashes)\n break\n\n case \"ArrayPattern\":\n for (let elem of expr.elements) {\n if (elem) this.checkLVal(elem, bindingType, checkClashes)\n }\n break\n\n case \"AssignmentPattern\":\n this.checkLVal(expr.left, bindingType, checkClashes)\n break\n\n case \"RestElement\":\n this.checkLVal(expr.argument, bindingType, checkClashes)\n break\n\n case \"ParenthesizedExpression\":\n this.checkLVal(expr.expression, bindingType, checkClashes)\n break\n\n default:\n this.raise(expr.start, (bindingType ? \"Binding\" : \"Assigning to\") + \" rvalue\")\n }\n}\n","// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {lineBreak} from \"./whitespace\"\nimport {functionFlags, SCOPE_ARROW, SCOPE_SUPER, SCOPE_DIRECT_SUPER, BIND_OUTSIDE, BIND_VAR} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n return\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n return\n let {key} = prop, name\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n let {kind} = prop\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) refDestructuringErrors.doubleProto = key.start\n // Backwards-compat kludge. Can be removed in version 6.0\n else this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\")\n }\n propHash.proto = true\n }\n return\n }\n name = \"$\" + name\n let other = propHash[name]\n if (other) {\n let redefinition\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set\n } else {\n redefinition = other.init || other[kind]\n }\n if (redefinition)\n this.raiseRecoverable(key.start, \"Redefinition of property\")\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n }\n }\n other[kind] = true\n}\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp.parseExpression = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeAssign(noIn, refDestructuringErrors)\n if (this.type === tt.comma) {\n let node = this.startNodeAt(startPos, startLoc)\n node.expressions = [expr]\n while (this.eat(tt.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors))\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n}\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) return this.parseYield(noIn)\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else this.exprAllowed = false\n }\n\n let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign\n oldTrailingComma = refDestructuringErrors.trailingComma\n oldShorthandAssign = refDestructuringErrors.shorthandAssign\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1\n } else {\n refDestructuringErrors = new DestructuringErrors\n ownDestructuringErrors = true\n }\n\n let startPos = this.start, startLoc = this.startLoc\n if (this.type === tt.parenL || this.type === tt.name)\n this.potentialArrowAt = this.start\n let left = this.parseMaybeConditional(noIn, refDestructuringErrors)\n if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc)\n if (this.type.isAssign) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.left = this.type === tt.eq ? this.toAssignable(left, false, refDestructuringErrors) : left\n if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors)\n refDestructuringErrors.shorthandAssign = -1 // reset because shorthand default was used correctly\n this.checkLVal(left)\n this.next()\n node.right = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign\n if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma\n if (oldShorthandAssign > -1) refDestructuringErrors.shorthandAssign = oldShorthandAssign\n return left\n}\n\n// Parse a ternary conditional (`?:`) operator.\n\npp.parseMaybeConditional = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprOps(noIn, refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n if (this.eat(tt.question)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.test = expr\n node.consequent = this.parseMaybeAssign()\n this.expect(tt.colon)\n node.alternate = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n}\n\n// Start the precedence parser.\n\npp.parseExprOps = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeUnary(refDestructuringErrors, false)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)\n}\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {\n let prec = this.type.binop\n if (prec != null && (!noIn || this.type !== tt._in)) {\n if (prec > minPrec) {\n let logical = this.type === tt.logicalOR || this.type === tt.logicalAND\n let op = this.value\n this.next()\n let startPos = this.start, startLoc = this.startLoc\n let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn)\n let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical)\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)\n }\n }\n return left\n}\n\npp.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.operator = op\n node.right = right\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n}\n\n// Parse unary operators, both prefix and postfix.\n\npp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {\n let startPos = this.start, startLoc = this.startLoc, expr\n if (this.isContextual(\"await\") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {\n expr = this.parseAwait()\n sawUnary = true\n } else if (this.type.prefix) {\n let node = this.startNode(), update = this.type === tt.incDec\n node.operator = this.value\n node.prefix = true\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n this.checkExpressionErrors(refDestructuringErrors, true)\n if (update) this.checkLVal(node.argument)\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\")\n else sawUnary = true\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\")\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n while (this.type.postfix && !this.canInsertSemicolon()) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.prefix = false\n node.argument = expr\n this.checkLVal(expr)\n this.next()\n expr = this.finishNode(node, \"UpdateExpression\")\n }\n }\n\n if (!sawUnary && this.eat(tt.starstar))\n return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), \"**\", false)\n else\n return expr\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp.parseExprSubscripts = function(refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprAtom(refDestructuringErrors)\n let skipArrowSubscripts = expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\"\n if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr\n let result = this.parseSubscripts(expr, startPos, startLoc)\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) refDestructuringErrors.parenthesizedAssign = -1\n if (refDestructuringErrors.parenthesizedBind >= result.start) refDestructuringErrors.parenthesizedBind = -1\n }\n return result\n}\n\npp.parseSubscripts = function(base, startPos, startLoc, noCalls) {\n let maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === \"async\"\n for (let computed;;) {\n if ((computed = this.eat(tt.bracketL)) || this.eat(tt.dot)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.object = base\n node.property = computed ? this.parseExpression() : this.parseIdent(true)\n node.computed = !!computed\n if (computed) this.expect(tt.bracketR)\n base = this.finishNode(node, \"MemberExpression\")\n } else if (!noCalls && this.eat(tt.parenL)) {\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n let exprList = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors)\n if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n if (this.awaitIdentPos > 0)\n this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\")\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)\n }\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos\n let node = this.startNodeAt(startPos, startLoc)\n node.callee = base\n node.arguments = exprList\n base = this.finishNode(node, \"CallExpression\")\n } else if (this.type === tt.backQuote) {\n let node = this.startNodeAt(startPos, startLoc)\n node.tag = base\n node.quasi = this.parseTemplate({isTagged: true})\n base = this.finishNode(node, \"TaggedTemplateExpression\")\n } else {\n return base\n }\n }\n}\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp.parseExprAtom = function(refDestructuringErrors) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === tt.slash) this.readRegexp()\n\n let node, canBeArrow = this.potentialArrowAt === this.start\n switch (this.type) {\n case tt._super:\n if (!this.allowSuper)\n this.raise(this.start, \"'super' keyword outside a method\")\n node = this.startNode()\n this.next()\n if (this.type === tt.parenL && !this.allowDirectSuper)\n this.raise(node.start, \"super() call outside constructor of a subclass\")\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super Arguments\n if (this.type !== tt.dot && this.type !== tt.bracketL && this.type !== tt.parenL)\n this.unexpected()\n return this.finishNode(node, \"Super\")\n\n case tt._this:\n node = this.startNode()\n this.next()\n return this.finishNode(node, \"ThisExpression\")\n\n case tt.name:\n let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc\n let id = this.parseIdent(false)\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(tt._function))\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true)\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(tt.arrow))\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false)\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === tt.name && !containsEsc) {\n id = this.parseIdent(false)\n if (this.canInsertSemicolon() || !this.eat(tt.arrow))\n this.unexpected()\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)\n }\n }\n return id\n\n case tt.regexp:\n let value = this.value\n node = this.parseLiteral(value.value)\n node.regex = {pattern: value.pattern, flags: value.flags}\n return node\n\n case tt.num: case tt.string:\n return this.parseLiteral(this.value)\n\n case tt._null: case tt._true: case tt._false:\n node = this.startNode()\n node.value = this.type === tt._null ? null : this.type === tt._true\n node.raw = this.type.keyword\n this.next()\n return this.finishNode(node, \"Literal\")\n\n case tt.parenL:\n let start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow)\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n refDestructuringErrors.parenthesizedAssign = start\n if (refDestructuringErrors.parenthesizedBind < 0)\n refDestructuringErrors.parenthesizedBind = start\n }\n return expr\n\n case tt.bracketL:\n node = this.startNode()\n this.next()\n node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors)\n return this.finishNode(node, \"ArrayExpression\")\n\n case tt.braceL:\n return this.parseObj(false, refDestructuringErrors)\n\n case tt._function:\n node = this.startNode()\n this.next()\n return this.parseFunction(node, 0)\n\n case tt._class:\n return this.parseClass(this.startNode(), false)\n\n case tt._new:\n return this.parseNew()\n\n case tt.backQuote:\n return this.parseTemplate()\n\n default:\n this.unexpected()\n }\n}\n\npp.parseLiteral = function(value) {\n let node = this.startNode()\n node.value = value\n node.raw = this.input.slice(this.start, this.end)\n this.next()\n return this.finishNode(node, \"Literal\")\n}\n\npp.parseParenExpression = function() {\n this.expect(tt.parenL)\n let val = this.parseExpression()\n this.expect(tt.parenR)\n return val\n}\n\npp.parseParenAndDistinguishExpression = function(canBeArrow) {\n let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8\n if (this.options.ecmaVersion >= 6) {\n this.next()\n\n let innerStartPos = this.start, innerStartLoc = this.startLoc\n let exprList = [], first = true, lastIsComma = false\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart\n this.yieldPos = 0\n this.awaitPos = 0\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== tt.parenR) {\n first ? first = false : this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) {\n lastIsComma = true\n break\n } else if (this.type === tt.ellipsis) {\n spreadStart = this.start\n exprList.push(this.parseParenItem(this.parseRestBinding()))\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem))\n }\n }\n let innerEndPos = this.start, innerEndLoc = this.startLoc\n this.expect(tt.parenR)\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseParenArrowList(startPos, startLoc, exprList)\n }\n\n if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart)\n if (spreadStart) this.unexpected(spreadStart)\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc)\n val.expressions = exprList\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc)\n } else {\n val = exprList[0]\n }\n } else {\n val = this.parseParenExpression()\n }\n\n if (this.options.preserveParens) {\n let par = this.startNodeAt(startPos, startLoc)\n par.expression = val\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n}\n\npp.parseParenItem = function(item) {\n return item\n}\n\npp.parseParenArrowList = function(startPos, startLoc, exprList) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)\n}\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nconst empty = []\n\npp.parseNew = function() {\n let node = this.startNode()\n let meta = this.parseIdent(true)\n if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) {\n node.meta = meta\n let containsEsc = this.containsEsc\n node.property = this.parseIdent(true)\n if (node.property.name !== \"target\" || containsEsc)\n this.raiseRecoverable(node.property.start, \"The only valid meta property for new is new.target\")\n if (!this.inNonArrowFunction())\n this.raiseRecoverable(node.start, \"new.target can only be used in functions\")\n return this.finishNode(node, \"MetaProperty\")\n }\n let startPos = this.start, startLoc = this.startLoc\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true)\n if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false)\n else node.arguments = empty\n return this.finishNode(node, \"NewExpression\")\n}\n\n// Parse template expression.\n\npp.parseTemplateElement = function({isTagged}) {\n let elem = this.startNode()\n if (this.type === tt.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\")\n }\n elem.value = {\n raw: this.value,\n cooked: null\n }\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n }\n }\n this.next()\n elem.tail = this.type === tt.backQuote\n return this.finishNode(elem, \"TemplateElement\")\n}\n\npp.parseTemplate = function({isTagged = false} = {}) {\n let node = this.startNode()\n this.next()\n node.expressions = []\n let curElt = this.parseTemplateElement({isTagged})\n node.quasis = [curElt]\n while (!curElt.tail) {\n if (this.type === tt.eof) this.raise(this.pos, \"Unterminated template literal\")\n this.expect(tt.dollarBraceL)\n node.expressions.push(this.parseExpression())\n this.expect(tt.braceR)\n node.quasis.push(curElt = this.parseTemplateElement({isTagged}))\n }\n this.next()\n return this.finishNode(node, \"TemplateLiteral\")\n}\n\npp.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === tt.name || this.type === tt.num || this.type === tt.string || this.type === tt.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === tt.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\n// Parse an object literal or binding pattern.\n\npp.parseObj = function(isPattern, refDestructuringErrors) {\n let node = this.startNode(), first = true, propHash = {}\n node.properties = []\n this.next()\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n const prop = this.parseProperty(isPattern, refDestructuringErrors)\n if (!isPattern) this.checkPropClash(prop, propHash, refDestructuringErrors)\n node.properties.push(prop)\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n}\n\npp.parseProperty = function(isPattern, refDestructuringErrors) {\n let prop = this.startNode(), isGenerator, isAsync, startPos, startLoc\n if (this.options.ecmaVersion >= 9 && this.eat(tt.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false)\n if (this.type === tt.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\")\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === tt.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === tt.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false\n prop.shorthand = false\n if (isPattern || refDestructuringErrors) {\n startPos = this.start\n startLoc = this.startLoc\n }\n if (!isPattern)\n isGenerator = this.eat(tt.star)\n }\n let containsEsc = this.containsEsc\n this.parsePropertyName(prop)\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n this.parsePropertyName(prop, refDestructuringErrors)\n } else {\n isAsync = false\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc)\n return this.finishNode(prop, \"Property\")\n}\n\npp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === tt.colon)\n this.unexpected()\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors)\n prop.kind = \"init\"\n } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) {\n if (isPattern) this.unexpected()\n prop.kind = \"init\"\n prop.method = true\n prop.value = this.parseMethod(isGenerator, isAsync)\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== tt.comma && this.type !== tt.braceR)) {\n if (isGenerator || isAsync) this.unexpected()\n prop.kind = prop.key.name\n this.parsePropertyName(prop)\n prop.value = this.parseMethod(false)\n let paramCount = prop.kind === \"get\" ? 0 : 1\n if (prop.value.params.length !== paramCount) {\n let start = prop.value.start\n if (prop.kind === \"get\")\n this.raiseRecoverable(start, \"getter should have no params\")\n else\n this.raiseRecoverable(start, \"setter should have exactly one param\")\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\")\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) this.unexpected()\n this.checkUnreserved(prop.key)\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n this.awaitIdentPos = startPos\n prop.kind = \"init\"\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else if (this.type === tt.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n refDestructuringErrors.shorthandAssign = this.start\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else {\n prop.value = prop.key\n }\n prop.shorthand = true\n } else this.unexpected()\n}\n\npp.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(tt.bracketL)) {\n prop.computed = true\n prop.key = this.parseMaybeAssign()\n this.expect(tt.bracketR)\n return prop.key\n } else {\n prop.computed = false\n }\n }\n return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true)\n}\n\n// Initialize empty function node.\n\npp.initFunction = function(node) {\n node.id = null\n if (this.options.ecmaVersion >= 6) node.generator = node.expression = false\n if (this.options.ecmaVersion >= 8) node.async = false\n}\n\n// Parse object or class method.\n\npp.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n\n this.initFunction(node)\n if (this.options.ecmaVersion >= 6)\n node.generator = isGenerator\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0))\n\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n this.parseFunctionBody(node, false, true)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, \"FunctionExpression\")\n}\n\n// Parse arrow function expression with given parameters.\n\npp.parseArrowExpression = function(node, params, isAsync) {\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW)\n this.initFunction(node)\n if (this.options.ecmaVersion >= 8) node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.awaitIdentPos = 0\n\n node.params = this.toAssignableList(params, true)\n this.parseFunctionBody(node, true, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n this.awaitIdentPos = oldAwaitIdentPos\n return this.finishNode(node, \"ArrowFunctionExpression\")\n}\n\n// Parse function body and check parameters.\n\npp.parseFunctionBody = function(node, isArrowFunction, isMethod) {\n let isExpression = isArrowFunction && this.type !== tt.braceL\n let oldStrict = this.strict, useStrict = false\n\n if (isExpression) {\n node.body = this.parseMaybeAssign()\n node.expression = true\n this.checkParams(node, false)\n } else {\n let nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end)\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\")\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n let oldLabels = this.labels\n this.labels = []\n if (useStrict) this.strict = true\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params))\n node.body = this.parseBlock(false)\n node.expression = false\n this.adaptDirectivePrologue(node.body.body)\n this.labels = oldLabels\n }\n this.exitScope()\n\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) this.checkLVal(node.id, BIND_OUTSIDE)\n this.strict = oldStrict\n}\n\npp.isSimpleParamList = function(params) {\n for (let param of params)\n if (param.type !== \"Identifier\") return false\n return true\n}\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp.checkParams = function(node, allowDuplicates) {\n let nameHash = {}\n for (let param of node.params)\n this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash)\n}\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (!first) {\n this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(close)) break\n } else first = false\n\n let elt\n if (allowEmpty && this.type === tt.comma)\n elt = null\n else if (this.type === tt.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors)\n if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0)\n refDestructuringErrors.trailingComma = this.start\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors)\n }\n elts.push(elt)\n }\n return elts\n}\n\npp.checkUnreserved = function({start, end, name}) {\n if (this.inGenerator && name === \"yield\")\n this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\")\n if (this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\")\n if (this.keywords.test(name))\n this.raise(start, `Unexpected keyword '${name}'`)\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) return\n const re = this.strict ? this.reservedWordsStrict : this.reservedWords\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\")\n this.raiseRecoverable(start, `The keyword '${name}' is reserved`)\n }\n}\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp.parseIdent = function(liberal, isBinding) {\n let node = this.startNode()\n if (liberal && this.options.allowReserved === \"never\") liberal = false\n if (this.type === tt.name) {\n node.name = this.value\n } else if (this.type.keyword) {\n node.name = this.type.keyword\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop()\n }\n } else {\n this.unexpected()\n }\n this.next()\n this.finishNode(node, \"Identifier\")\n if (!liberal) {\n this.checkUnreserved(node)\n if (node.name === \"await\" && !this.awaitIdentPos)\n this.awaitIdentPos = node.start\n }\n return node\n}\n\n// Parses yield expression inside generator.\n\npp.parseYield = function(noIn) {\n if (!this.yieldPos) this.yieldPos = this.start\n\n let node = this.startNode()\n this.next()\n if (this.type === tt.semi || this.canInsertSemicolon() || (this.type !== tt.star && !this.type.startsExpr)) {\n node.delegate = false\n node.argument = null\n } else {\n node.delegate = this.eat(tt.star)\n node.argument = this.parseMaybeAssign(noIn)\n }\n return this.finishNode(node, \"YieldExpression\")\n}\n\npp.parseAwait = function() {\n if (!this.awaitPos) this.awaitPos = this.start\n\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n return this.finishNode(node, \"AwaitExpression\")\n}\n","import {Parser} from \"./state\"\nimport {Position, getLineInfo} from \"./locutil\"\n\nconst pp = Parser.prototype\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp.raise = function(pos, message) {\n let loc = getLineInfo(this.input, pos)\n message += \" (\" + loc.line + \":\" + loc.column + \")\"\n let err = new SyntaxError(message)\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos\n throw err\n}\n\npp.raiseRecoverable = pp.raise\n\npp.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n}\n","import {Parser} from \"./state\"\nimport {SCOPE_VAR, SCOPE_FUNCTION, SCOPE_TOP, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, BIND_LEXICAL, BIND_SIMPLE_CATCH, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\nclass Scope {\n constructor(flags) {\n this.flags = flags\n // A list of var-declared names in the current lexical scope\n this.var = []\n // A list of lexically-declared names in the current lexical scope\n this.lexical = []\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = []\n }\n}\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags))\n}\n\npp.exitScope = function() {\n this.scopeStack.pop()\n}\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP);\n}\n\npp.declareName = function(name, bindingType, pos) {\n let redeclared = false\n if (bindingType === BIND_LEXICAL) {\n const scope = this.currentScope()\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.lexical.push(name)\n if (this.inModule && (scope.flags & SCOPE_TOP))\n delete this.undefinedExports[name];\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n const scope = this.currentScope()\n scope.lexical.push(name)\n } else if (bindingType === BIND_FUNCTION) {\n const scope = this.currentScope()\n if (this.treatFunctionsAsVar)\n redeclared = scope.lexical.indexOf(name) > -1;\n else\n redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.functions.push(name)\n } else {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n const scope = this.scopeStack[i]\n if (scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH) && scope.lexical[0] === name ||\n !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1) {\n redeclared = true\n break\n }\n scope.var.push(name)\n if (this.inModule && (scope.flags & SCOPE_TOP))\n delete this.undefinedExports[name];\n if (scope.flags & SCOPE_VAR) break\n }\n }\n if (redeclared) this.raiseRecoverable(pos, `Identifier '${name}' has already been declared`)\n}\n\npp.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id;\n }\n}\n\npp.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n}\n\npp.currentVarScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR) return scope\n }\n}\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp.currentThisScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) return scope\n }\n}\n","import {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\n\nexport class Node {\n constructor(parser, pos, loc) {\n this.type = \"\"\n this.start = pos\n this.end = 0\n if (parser.options.locations)\n this.loc = new SourceLocation(parser, loc)\n if (parser.options.directSourceFile)\n this.sourceFile = parser.options.directSourceFile\n if (parser.options.ranges)\n this.range = [pos, 0]\n }\n}\n\n// Start an AST node, attaching a start offset.\n\nconst pp = Parser.prototype\n\npp.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n}\n\npp.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n}\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type\n node.end = pos\n if (this.options.locations)\n node.loc.end = loc\n if (this.options.ranges)\n node.range[1] = pos\n return node\n}\n\npp.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n}\n\n// Finish node at given position\n\npp.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n}\n","// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport {Parser} from \"./state\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\n\nexport class TokContext {\n constructor(token, isExpr, preserveSpace, override, generator) {\n this.token = token\n this.isExpr = !!isExpr\n this.preserveSpace = !!preserveSpace\n this.override = override\n this.generator = !!generator\n }\n}\n\nexport const types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, p => p.tryReadTemplateToken()),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n}\n\nconst pp = Parser.prototype\n\npp.initialContext = function() {\n return [types.b_stat]\n}\n\npp.braceIsBlock = function(prevType) {\n let parent = this.curContext()\n if (parent === types.f_expr || parent === types.f_stat)\n return true\n if (prevType === tt.colon && (parent === types.b_stat || parent === types.b_expr))\n return !parent.isExpr\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === tt._return || prevType === tt.name && this.exprAllowed)\n return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR || prevType === tt.arrow)\n return true\n if (prevType === tt.braceL)\n return parent === types.b_stat\n if (prevType === tt._var || prevType === tt._const || prevType === tt.name)\n return false\n return !this.exprAllowed\n}\n\npp.inGeneratorContext = function() {\n for (let i = this.context.length - 1; i >= 1; i--) {\n let context = this.context[i]\n if (context.token === \"function\")\n return context.generator\n }\n return false\n}\n\npp.updateContext = function(prevType) {\n let update, type = this.type\n if (type.keyword && prevType === tt.dot)\n this.exprAllowed = false\n else if (update = type.updateContext)\n update.call(this, prevType)\n else\n this.exprAllowed = type.beforeExpr\n}\n\n// Token-specific context update code\n\ntt.parenR.updateContext = tt.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true\n return\n }\n let out = this.context.pop()\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop()\n }\n this.exprAllowed = !out.isExpr\n}\n\ntt.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr)\n this.exprAllowed = true\n}\n\ntt.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl)\n this.exprAllowed = true\n}\n\ntt.parenL.updateContext = function(prevType) {\n let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while\n this.context.push(statementParens ? types.p_stat : types.p_expr)\n this.exprAllowed = true\n}\n\ntt.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n}\n\ntt._function.updateContext = tt._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else &&\n !(prevType === tt._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat))\n this.context.push(types.f_expr)\n else\n this.context.push(types.f_stat)\n this.exprAllowed = false\n}\n\ntt.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n this.context.pop()\n else\n this.context.push(types.q_tmpl)\n this.exprAllowed = false\n}\n\ntt.star.updateContext = function(prevType) {\n if (prevType === tt._function) {\n let index = this.context.length - 1\n if (this.context[index] === types.f_expr)\n this.context[index] = types.f_expr_gen\n else\n this.context[index] = types.f_gen\n }\n this.exprAllowed = true\n}\n\ntt.name.updateContext = function(prevType) {\n let allowed = false\n if (this.options.ecmaVersion >= 6 && prevType !== tt.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n allowed = true\n }\n this.exprAllowed = allowed\n}\n","import {wordsRegexp} from \"./util.js\"\n\n// This file contains Unicode properties extracted from the ECMAScript\n// specification. The lists are extracted like so:\n// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n// #table-binary-unicode-properties\nconst ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\"\nconst unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma9BinaryProperties + \" Extended_Pictographic\"\n}\n\n// #table-unicode-general-category-values\nconst unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\"\n\n// #table-unicode-script-values\nconst ecma9ScriptValues = \"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\"\nconst unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\"\n}\n\nconst data = {}\nfunction buildUnicodeData(ecmaVersion) {\n let d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n }\n d.nonBinary.Script_Extensions = d.nonBinary.Script\n\n d.nonBinary.gc = d.nonBinary.General_Category\n d.nonBinary.sc = d.nonBinary.Script\n d.nonBinary.scx = d.nonBinary.Script_Extensions\n}\nbuildUnicodeData(9)\nbuildUnicodeData(10)\n\nexport default data\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier.js\"\nimport {Parser} from \"./state.js\"\nimport UNICODE_PROPERTY_VALUES from \"./unicode-property-data.js\"\nimport {has} from \"./util.js\"\n\nconst pp = Parser.prototype\n\nexport class RegExpValidationState {\n constructor(parser) {\n this.parser = parser\n this.validFlags = `gim${parser.options.ecmaVersion >= 6 ? \"uy\" : \"\"}${parser.options.ecmaVersion >= 9 ? \"s\" : \"\"}`\n this.unicodeProperties = UNICODE_PROPERTY_VALUES[parser.options.ecmaVersion >= 10 ? 10 : parser.options.ecmaVersion]\n this.source = \"\"\n this.flags = \"\"\n this.start = 0\n this.switchU = false\n this.switchN = false\n this.pos = 0\n this.lastIntValue = 0\n this.lastStringValue = \"\"\n this.lastAssertionIsQuantifiable = false\n this.numCapturingParens = 0\n this.maxBackReference = 0\n this.groupNames = []\n this.backReferenceNames = []\n }\n\n reset(start, pattern, flags) {\n const unicode = flags.indexOf(\"u\") !== -1\n this.start = start | 0\n this.source = pattern + \"\"\n this.flags = flags\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9\n }\n\n raise(message) {\n this.parser.raiseRecoverable(this.start, `Invalid regular expression: /${this.source}/: ${message}`)\n }\n\n // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n at(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return -1\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00\n }\n\n nextIndex(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return l\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return i + 1\n }\n return i + 2\n }\n\n current() {\n return this.at(this.pos)\n }\n\n lookahead() {\n return this.at(this.nextIndex(this.pos))\n }\n\n advance() {\n this.pos = this.nextIndex(this.pos)\n }\n\n eat(ch) {\n if (this.current() === ch) {\n this.advance()\n return true\n }\n return false\n }\n}\n\nfunction codePointToString(ch) {\n if (ch <= 0xFFFF) return String.fromCharCode(ch)\n ch -= 0x10000\n return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)\n}\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpFlags = function(state) {\n const validFlags = state.validFlags\n const flags = state.flags\n\n for (let i = 0; i < flags.length; i++) {\n const flag = flags.charAt(i)\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\")\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\")\n }\n }\n}\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpPattern = function(state) {\n this.regexp_pattern(state)\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true\n this.regexp_pattern(state)\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp.regexp_pattern = function(state) {\n state.pos = 0\n state.lastIntValue = 0\n state.lastStringValue = \"\"\n state.lastAssertionIsQuantifiable = false\n state.numCapturingParens = 0\n state.maxBackReference = 0\n state.groupNames.length = 0\n state.backReferenceNames.length = 0\n\n this.regexp_disjunction(state)\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\")\n }\n if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\")\n }\n for (const name of state.backReferenceNames) {\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\")\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp.regexp_disjunction = function(state) {\n this.regexp_alternative(state)\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state)\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n ;\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\")\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state)\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp.regexp_eatAssertion = function(state) {\n const start = state.pos\n state.lastAssertionIsQuantifiable = false\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n let lookbehind = false\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */)\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state)\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\")\n }\n state.lastAssertionIsQuantifiable = !lookbehind\n return true\n }\n }\n\n state.pos = start\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp.regexp_eatQuantifier = function(state, noError = false) {\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n}\npp.regexp_eatBracedQuantifier = function(state, noError) {\n const start = state.pos\n if (state.eat(0x7B /* { */)) {\n let min = 0, max = -1\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\")\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n}\npp.regexp_eatReverseSolidusAtomEscape = function(state) {\n const start = state.pos\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatUncapturingGroup = function(state) {\n const start = state.pos\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\")\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state)\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\")\n }\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1\n return true\n }\n state.raise(\"Unterminated group\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp.regexp_eatSyntaxCharacter = function(state) {\n const ch = state.current()\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n return false\n}\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp.regexp_eatPatternCharacters = function(state) {\n const start = state.pos\n let ch = 0\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance()\n }\n return state.pos !== start\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp.regexp_eatExtendedPatternCharacter = function(state) {\n const ch = state.current()\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance()\n return true\n }\n return false\n}\n\n// GroupSpecifier[U] ::\n// [empty]\n// `?` GroupName[?U]\npp.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\")\n }\n state.groupNames.push(state.lastStringValue)\n return\n }\n state.raise(\"Invalid group\")\n }\n}\n\n// GroupName[U] ::\n// `<` RegExpIdentifierName[?U] `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\"\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\")\n }\n return false\n}\n\n// RegExpIdentifierName[U] ::\n// RegExpIdentifierStart[?U]\n// RegExpIdentifierName[?U] RegExpIdentifierPart[?U]\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\"\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n }\n return true\n }\n return false\n}\n\n// RegExpIdentifierStart[U] ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\npp.regexp_eatRegExpIdentifierStart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart[U] ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\n// \n// \npp.regexp_eatRegExpIdentifierPart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\")\n }\n state.raise(\"Invalid escape\")\n }\n return false\n}\npp.regexp_eatBackReference = function(state) {\n const start = state.pos\n if (this.regexp_eatDecimalEscape(state)) {\n const n = state.lastIntValue\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue)\n return true\n }\n state.raise(\"Invalid named reference\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n}\npp.regexp_eatCControlLetter = function(state) {\n const start = state.pos\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp.regexp_eatControlEscape = function(state) {\n const ch = state.current()\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09 /* \\t */\n state.advance()\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A /* \\n */\n state.advance()\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B /* \\v */\n state.advance()\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C /* \\f */\n state.advance()\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D /* \\r */\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp.regexp_eatControlLetter = function(state) {\n const ch = state.current()\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp.regexp_eatRegExpUnicodeEscapeSequence = function(state) {\n const start = state.pos\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n const lead = state.lastIntValue\n if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n const leadSurrogateEnd = state.pos\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n const trail = state.lastIntValue\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000\n return true\n }\n }\n state.pos = leadSurrogateEnd\n state.lastIntValue = lead\n }\n return true\n }\n if (\n state.switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid unicode escape\")\n }\n state.pos = start\n }\n\n return false\n}\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F /* / */\n return true\n }\n return false\n }\n\n const ch = state.current()\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0\n let ch = state.current()\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp.regexp_eatCharacterClassEscape = function(state) {\n const ch = state.current()\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1\n state.advance()\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1\n state.advance()\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\")\n }\n\n return false\n}\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp.regexp_eatUnicodePropertyValueExpression = function(state) {\n const start = state.pos\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n const name = state.lastStringValue\n if (this.regexp_eatUnicodePropertyValue(state)) {\n const value = state.lastStringValue\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value)\n return true\n }\n }\n state.pos = start\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n const nameOrValue = state.lastStringValue\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n return true\n }\n return false\n}\npp.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!has(state.unicodeProperties.nonBinary, name))\n state.raise(\"Invalid property name\")\n if (!state.unicodeProperties.nonBinary[name].test(value))\n state.raise(\"Invalid property value\")\n}\npp.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (!state.unicodeProperties.binary.test(nameOrValue))\n state.raise(\"Invalid property name\")\n}\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp.regexp_eatUnicodePropertyName = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatUnicodePropertyValue = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */)\n this.regexp_classRanges(state)\n if (state.eat(0x5D /* [ */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n const left = state.lastIntValue\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n const right = state.lastIntValue\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\")\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\")\n }\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp.regexp_eatClassAtom = function(state) {\n const start = state.pos\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n const ch = state.current()\n if (ch === 0x63 /* c */ || isOctalDigit(ch)) {\n state.raise(\"Invalid class escape\")\n }\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n\n const ch = state.current()\n if (ch !== 0x5D /* [ */) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp.regexp_eatClassEscape = function(state) {\n const start = state.pos\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08 /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp.regexp_eatClassControlLetter = function(state) {\n const ch = state.current()\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatHexEscapeSequence = function(state) {\n const start = state.pos\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp.regexp_eatDecimalDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp.regexp_eatHexDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n const n1 = state.lastIntValue\n if (this.regexp_eatOctalDigit(state)) {\n const n2 = state.lastIntValue\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue\n } else {\n state.lastIntValue = n1 * 8 + n2\n }\n } else {\n state.lastIntValue = n1\n }\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp.regexp_eatOctalDigit = function(state) {\n const ch = state.current()\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30 /* 0 */\n state.advance()\n return true\n }\n state.lastIntValue = 0\n return false\n}\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatFixedHexDigits = function(state, length) {\n const start = state.pos\n state.lastIntValue = 0\n for (let i = 0; i < length; ++i) {\n const ch = state.current()\n if (!isHexDigit(ch)) {\n state.pos = start\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return true\n}\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier\"\nimport {types as tt, keywords as keywordTypes} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\nimport {RegExpValidationState} from \"./regexp\"\nimport {lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace} from \"./whitespace\"\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(p) {\n this.type = p.type\n this.value = p.value\n this.start = p.start\n this.end = p.end\n if (p.options.locations)\n this.loc = new SourceLocation(p, p.startLoc, p.endLoc)\n if (p.options.ranges)\n this.range = [p.start, p.end]\n }\n}\n\n// ## Tokenizer\n\nconst pp = Parser.prototype\n\n// Move to the next token\n\npp.next = function() {\n if (this.options.onToken)\n this.options.onToken(new Token(this))\n\n this.lastTokEnd = this.end\n this.lastTokStart = this.start\n this.lastTokEndLoc = this.endLoc\n this.lastTokStartLoc = this.startLoc\n this.nextToken()\n}\n\npp.getToken = function() {\n this.next()\n return new Token(this)\n}\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n pp[Symbol.iterator] = function() {\n return {\n next: () => {\n let token = this.getToken()\n return {\n done: token.type === tt.eof,\n value: token\n }\n }\n }\n }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\npp.curContext = function() {\n return this.context[this.context.length - 1]\n}\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n let curContext = this.curContext()\n if (!curContext || !curContext.preserveSpace) this.skipSpace()\n\n this.start = this.pos\n if (this.options.locations) this.startLoc = this.curPosition()\n if (this.pos >= this.input.length) return this.finishToken(tt.eof)\n\n if (curContext.override) return curContext.override(this)\n else this.readToken(this.fullCharCodeAtPos())\n}\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n return this.readWord()\n\n return this.getTokenFromCode(code)\n}\n\npp.fullCharCodeAtPos = function() {\n let code = this.input.charCodeAt(this.pos)\n if (code <= 0xd7ff || code >= 0xe000) return code\n let next = this.input.charCodeAt(this.pos + 1)\n return (code << 10) + next - 0x35fdc00\n}\n\npp.skipBlockComment = function() {\n let startLoc = this.options.onComment && this.curPosition()\n let start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2)\n if (end === -1) this.raise(this.pos - 2, \"Unterminated comment\")\n this.pos = end + 2\n if (this.options.locations) {\n lineBreakG.lastIndex = start\n let match\n while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {\n ++this.curLine\n this.lineStart = match.index + match[0].length\n }\n }\n if (this.options.onComment)\n this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition())\n}\n\npp.skipLineComment = function(startSkip) {\n let start = this.pos\n let startLoc = this.options.onComment && this.curPosition()\n let ch = this.input.charCodeAt(this.pos += startSkip)\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos)\n }\n if (this.options.onComment)\n this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition())\n}\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n let ch = this.input.charCodeAt(this.pos)\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos\n }\n case 10: case 8232: case 8233:\n ++this.pos\n if (this.options.locations) {\n ++this.curLine\n this.lineStart = this.pos\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment()\n break\n case 47:\n this.skipLineComment(2)\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos\n } else {\n break loop\n }\n }\n }\n}\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos\n if (this.options.locations) this.endLoc = this.curPosition()\n let prevType = this.type\n this.type = type\n this.value = val\n\n this.updateContext(prevType)\n}\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n let next = this.input.charCodeAt(this.pos + 1)\n if (next >= 48 && next <= 57) return this.readNumber(true)\n let next2 = this.input.charCodeAt(this.pos + 2)\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3\n return this.finishToken(tt.ellipsis)\n } else {\n ++this.pos\n return this.finishToken(tt.dot)\n }\n}\n\npp.readToken_slash = function() { // '/'\n let next = this.input.charCodeAt(this.pos + 1)\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.slash, 1)\n}\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n let tokentype = code === 42 ? tt.star : tt.modulo\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size\n tokentype = tt.starstar\n next = this.input.charCodeAt(this.pos + 2)\n }\n\n if (next === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tokentype, size)\n}\n\npp.readToken_pipe_amp = function(code) { // '|&'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1)\n}\n\npp.readToken_caret = function() { // '^'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.bitwiseXOR, 1)\n}\n\npp.readToken_plus_min = function(code) { // '+-'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` diff --git a/doc/api/addons.md b/doc/api/addons.md index 4941d3de9add8f..1c811b50c21a47 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -251,6 +251,11 @@ down. If necessary, such hooks can be removed using `RemoveEnvironmentCleanupHook()` before they are run, which has the same signature. +In order to be loaded from multiple Node.js environments, +such as a main thread and a Worker thread, an add-on needs to either: +- Be an N-API addon, or +- Be declared as context-aware using `NODE_MODULE_INIT()` as described above + ### Building Once the source code has been written, it must be compiled into the binary diff --git a/doc/api/child_process.md b/doc/api/child_process.md index cdfdab1a98d635..a6064ee3c7545f 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1,7 +1,6 @@ # Child Process - > Stability: 2 - Stable @@ -41,20 +40,22 @@ the event loop until the spawned process either exits or is terminated. For convenience, the `child_process` module provides a handful of synchronous and asynchronous alternatives to [`child_process.spawn()`][] and -[`child_process.spawnSync()`][]. *Note that each of these alternatives are -implemented on top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][].* - - * [`child_process.exec()`][]: spawns a shell and runs a command within that shell, - passing the `stdout` and `stderr` to a callback function when complete. - * [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except that - it spawns the command directly without first spawning a shell by default. +[`child_process.spawnSync()`][]. Each of these alternatives are implemented on +top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][]. + + * [`child_process.exec()`][]: spawns a shell and runs a command within that + shell, passing the `stdout` and `stderr` to a callback function when + complete. + * [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except + that it spawns the command directly without first spawning a shell by + default. * [`child_process.fork()`][]: spawns a new Node.js process and invokes a specified module with an IPC communication channel established that allows sending messages between parent and child. * [`child_process.execSync()`][]: a synchronous version of - [`child_process.exec()`][] that *will* block the Node.js event loop. + [`child_process.exec()`][] that will block the Node.js event loop. * [`child_process.execFileSync()`][]: a synchronous version of - [`child_process.execFile()`][] that *will* block the Node.js event loop. + [`child_process.execFile()`][] that will block the Node.js event loop. For certain use cases, such as automating shell scripts, the [synchronous counterparts][] may be more convenient. In many cases, however, @@ -72,21 +73,22 @@ implement the Node.js [`EventEmitter`][] API, allowing the parent process to register listener functions that are called when certain events occur during the life cycle of the child process. -The [`child_process.exec()`][] and [`child_process.execFile()`][] methods additionally -allow for an optional `callback` function to be specified that is invoked -when the child process terminates. +The [`child_process.exec()`][] and [`child_process.execFile()`][] methods +additionally allow for an optional `callback` function to be specified that is +invoked when the child process terminates. ### Spawning `.bat` and `.cmd` files on Windows The importance of the distinction between [`child_process.exec()`][] and -[`child_process.execFile()`][] can vary based on platform. On Unix-type operating -systems (Unix, Linux, macOS) [`child_process.execFile()`][] can be more efficient -because it does not spawn a shell by default. On Windows, however, `.bat` and `.cmd` -files are not executable on their own without a terminal, and therefore cannot -be launched using [`child_process.execFile()`][]. When running on Windows, `.bat` -and `.cmd` files can be invoked using [`child_process.spawn()`][] with the `shell` -option set, with [`child_process.exec()`][], or by spawning `cmd.exe` and passing -the `.bat` or `.cmd` file as an argument (which is what the `shell` option and +[`child_process.execFile()`][] can vary based on platform. On Unix-type +operating systems (Unix, Linux, macOS) [`child_process.execFile()`][] can be +more efficient because it does not spawn a shell by default. On Windows, +however, `.bat` and `.cmd` files are not executable on their own without a +terminal, and therefore cannot be launched using [`child_process.execFile()`][]. +When running on Windows, `.bat` and `.cmd` files can be invoked using +[`child_process.spawn()`][] with the `shell` option set, with +[`child_process.exec()`][], or by spawning `cmd.exe` and passing the `.bat` or +`.cmd` file as an argument (which is what the `shell` option and [`child_process.exec()`][] do). In any case, if the script filename contains spaces it needs to be quoted. @@ -267,12 +269,13 @@ changes: * Returns: {ChildProcess} The `child_process.execFile()` function is similar to [`child_process.exec()`][] -except that it does not spawn a shell by default. Rather, the specified executable `file` -is spawned directly as a new process making it slightly more efficient than -[`child_process.exec()`][]. +except that it does not spawn a shell by default. Rather, the specified +executable `file` is spawned directly as a new process making it slightly more +efficient than [`child_process.exec()`][]. -The same options as [`child_process.exec()`][] are supported. Since a shell is not -spawned, behaviors such as I/O redirection and file globbing are not supported. +The same options as [`child_process.exec()`][] are supported. Since a shell is +not spawned, behaviors such as I/O redirection and file globbing are not +supported. ```js const { execFile } = require('child_process'); @@ -350,10 +353,10 @@ changes: The `child_process.fork()` method is a special case of [`child_process.spawn()`][] used specifically to spawn new Node.js processes. -Like [`child_process.spawn()`][], a [`ChildProcess`][] object is returned. The returned -[`ChildProcess`][] will have an additional communication channel built-in that -allows messages to be passed back and forth between the parent and child. See -[`subprocess.send()`][] for details. +Like [`child_process.spawn()`][], a [`ChildProcess`][] object is returned. The +returned [`ChildProcess`][] will have an additional communication channel +built-in that allows messages to be passed back and forth between the parent and +child. See [`subprocess.send()`][] for details. It is important to keep in mind that spawned Node.js child processes are independent of the parent with exception of the IPC communication channel @@ -524,13 +527,13 @@ added: v0.7.10 On Windows, setting `options.detached` to `true` makes it possible for the child process to continue running after the parent exits. The child will have -its own console window. *Once enabled for a child process, it cannot be -disabled*. +its own console window. Once enabled for a child process, it cannot be +disabled. On non-Windows platforms, if `options.detached` is set to `true`, the child -process will be made the leader of a new process group and session. Note that -child processes may continue running after the parent exits regardless of -whether they are detached or not. See setsid(2) for more information. +process will be made the leader of a new process group and session. Child +processes may continue running after the parent exits regardless of whether +they are detached or not. See setsid(2) for more information. By default, the parent will wait for the detached child to exit. To prevent the parent from waiting for a given `subprocess` to exit, use the @@ -608,11 +611,12 @@ pipes between the parent and child. The value is one of the following: for fds 0 - 2 are also available as [`subprocess.stdin`][], [`subprocess.stdout`][] and [`subprocess.stderr`][], respectively. 2. `'ipc'` - Create an IPC channel for passing messages/file descriptors - between parent and child. A [`ChildProcess`][] may have at most *one* IPC stdio - file descriptor. Setting this option enables the [`subprocess.send()`][] - method. If the child is a Node.js process, the presence of an IPC channel - will enable [`process.send()`][] and [`process.disconnect()`][] methods, - as well as [`'disconnect'`][] and [`'message'`][] events within the child. + between parent and child. A [`ChildProcess`][] may have at most one IPC + stdio file descriptor. Setting this option enables the + [`subprocess.send()`][] method. If the child is a Node.js process, the + presence of an IPC channel will enable [`process.send()`][] and + [`process.disconnect()`][] methods, as well as [`'disconnect'`][] and + [`'message'`][] events within the child. Accessing the IPC channel fd in any way other than [`process.send()`][] or using the IPC channel with a child process that is not a Node.js instance @@ -628,9 +632,9 @@ pipes between the parent and child. The value is one of the following: 5. {Stream} object - Share a readable or writable stream that refers to a tty, file, socket, or a pipe with the child process. The stream's underlying file descriptor is duplicated in the child process to the fd that - corresponds to the index in the `stdio` array. Note that the stream must - have an underlying descriptor (file streams do not until the `'open'` - event has occurred). + corresponds to the index in the `stdio` array. The stream must have an + underlying descriptor (file streams do not until the `'open'` event has + occurred). 6. Positive integer - The integer value is interpreted as a file descriptor that is currently open in the parent process. It is shared with the child process, similar to how {Stream} objects can be shared. @@ -670,9 +674,9 @@ See also: [`child_process.exec()`][] and [`child_process.fork()`][]. ## Synchronous Process Creation The [`child_process.spawnSync()`][], [`child_process.execSync()`][], and -[`child_process.execFileSync()`][] methods are **synchronous** and **WILL** block -the Node.js event loop, pausing execution of any additional code until the -spawned process exits. +[`child_process.execFileSync()`][] methods are synchronous and will block the +Node.js event loop, pausing execution of any additional code until the spawned +process exits. Blocking calls like these are mostly useful for simplifying general-purpose scripting tasks and for simplifying the loading/processing of application @@ -728,17 +732,17 @@ changes: * Returns: {Buffer|string} The stdout from the command. The `child_process.execFileSync()` method is generally identical to -[`child_process.execFile()`][] with the exception that the method will not return -until the child process has fully closed. When a timeout has been encountered -and `killSignal` is sent, the method won't return until the process has -completely exited. +[`child_process.execFile()`][] with the exception that the method will not +return until the child process has fully closed. When a timeout has been +encountered and `killSignal` is sent, the method won't return until the process +has completely exited. If the child process intercepts and handles the `SIGTERM` signal and does not exit, the parent process will still wait until the child process has exited. -If the process times out or has a non-zero exit code, this method ***will*** -throw an [`Error`][] that will include the full result of the underlying +If the process times out or has a non-zero exit code, this method will throw an +[`Error`][] that will include the full result of the underlying [`child_process.spawnSync()`][]. **If the `shell` option is enabled, do not pass unsanitized user input to this @@ -791,15 +795,15 @@ changes: * Returns: {Buffer|string} The stdout from the command. The `child_process.execSync()` method is generally identical to -[`child_process.exec()`][] with the exception that the method will not return until -the child process has fully closed. When a timeout has been encountered and -`killSignal` is sent, the method won't return until the process has completely -exited. *Note that if the child process intercepts and handles the `SIGTERM` -signal and doesn't exit, the parent process will wait until the child -process has exited.* - -If the process times out or has a non-zero exit code, this method ***will*** -throw. The [`Error`][] object will contain the entire result from +[`child_process.exec()`][] with the exception that the method will not return +until the child process has fully closed. When a timeout has been encountered +and `killSignal` is sent, the method won't return until the process has +completely exited. If the child process intercepts and handles the `SIGTERM` +signal and doesn't exit, the parent process will wait until the child process +has exited. + +If the process times out or has a non-zero exit code, this method will throw. +The [`Error`][] object will contain the entire result from [`child_process.spawnSync()`][]. **Never pass unsanitized user input to this function. Any input containing shell @@ -872,9 +876,9 @@ The `child_process.spawnSync()` method is generally identical to [`child_process.spawn()`][] with the exception that the function will not return until the child process has fully closed. When a timeout has been encountered and `killSignal` is sent, the method won't return until the process has -completely exited. Note that if the process intercepts and handles the -`SIGTERM` signal and doesn't exit, the parent process will wait until the child -process has exited. +completely exited. If the process intercepts and handles the `SIGTERM` signal +and doesn't exit, the parent process will wait until the child process has +exited. **If the `shell` option is enabled, do not pass unsanitized user input to this function. Any input containing shell metacharacters may be used to trigger @@ -885,8 +889,8 @@ arbitrary command execution.** added: v2.2.0 --> -Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that represent -spawned child processes. +Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that +represent spawned child processes. Instances of `ChildProcess` are not intended to be created directly. Rather, use the [`child_process.spawn()`][], [`child_process.exec()`][], @@ -945,13 +949,13 @@ exited, `code` is the final exit code of the process, otherwise `null`. If the process terminated due to receipt of a signal, `signal` is the string name of the signal, otherwise `null`. One of the two will always be non-null. -Note that when the `'exit'` event is triggered, child process stdio streams -might still be open. +When the `'exit'` event is triggered, child process stdio streams might still be +open. -Also, note that Node.js establishes signal handlers for `SIGINT` and -`SIGTERM` and Node.js processes will not terminate immediately due to receipt -of those signals. Rather, Node.js will perform a sequence of cleanup actions -and then will re-raise the handled signal. +Node.js establishes signal handlers for `SIGINT` and `SIGTERM` and Node.js +processes will not terminate immediately due to receipt of those signals. +Rather, Node.js will perform a sequence of cleanup actions and then will +re-raise the handled signal. See waitpid(2). @@ -964,8 +968,8 @@ added: v0.5.9 * `sendHandle` {Handle} A [`net.Socket`][] or [`net.Server`][] object, or undefined. -The `'message'` event is triggered when a child process uses [`process.send()`][] -to send messages. +The `'message'` event is triggered when a child process uses +[`process.send()`][] to send messages. The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent. @@ -1006,7 +1010,7 @@ The `'disconnect'` event will be emitted when there are no messages in the process of being received. This will most often be triggered immediately after calling `subprocess.disconnect()`. -Note that when the child process is a Node.js instance (e.g. spawned using +When the child process is a Node.js instance (e.g. spawned using [`child_process.fork()`]), the `process.disconnect()` method can be invoked within the child process to close the IPC channel as well. @@ -1034,14 +1038,14 @@ grep.on('close', (code, signal) => { grep.kill('SIGHUP'); ``` -The [`ChildProcess`][] object may emit an [`'error'`][] event if the signal cannot be -delivered. Sending a signal to a child process that has already exited is not -an error but may have unforeseen consequences. Specifically, if the process -identifier (PID) has been reassigned to another process, the signal will be -delivered to that process instead which can have unexpected results. +The [`ChildProcess`][] object may emit an [`'error'`][] event if the signal +cannot be delivered. Sending a signal to a child process that has already exited +is not an error but may have unforeseen consequences. Specifically, if the +process identifier (PID) has been reassigned to another process, the signal will +be delivered to that process instead which can have unexpected results. -Note that while the function is called `kill`, the signal delivered to the -child process may not actually terminate the process. +While the function is called `kill`, the signal delivered to the child process +may not actually terminate the process. See kill(2) for reference. @@ -1066,7 +1070,7 @@ const subprocess = spawn( ); setTimeout(() => { - subprocess.kill(); // does not terminate the node process in the shell + subprocess.kill(); // Does not terminate the node process in the shell }, 2000); ``` @@ -1180,8 +1184,8 @@ process.on('message', (m) => { process.send({ foo: 'bar', baz: NaN }); ``` -Child Node.js processes will have a [`process.send()`][] method of their own that -allows the child to send messages back to the parent. +Child Node.js processes will have a [`process.send()`][] method of their own +that allows the child to send messages back to the parent. There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages containing a `NODE_` prefix in the `cmd` property are reserved for use within @@ -1202,8 +1206,8 @@ sent but before the child may have received it. The function is called with a single argument: `null` on success, or an [`Error`][] object on failure. If no `callback` function is provided and the message cannot be sent, an -`'error'` event will be emitted by the [`ChildProcess`][] object. This can happen, -for instance, when the child process has already exited. +`'error'` event will be emitted by the [`ChildProcess`][] object. This can +happen, for instance, when the child process has already exited. `subprocess.send()` will return `false` if the channel has closed or when the backlog of unsent messages exceeds a threshold that makes it unwise to send @@ -1245,8 +1249,9 @@ can be handled by the parent and some by the child. While the example above uses a server created using the `net` module, `dgram` module servers use exactly the same workflow with the exceptions of listening on -a `'message'` event instead of `'connection'` and using `server.bind()` instead of -`server.listen()`. This is, however, currently only supported on UNIX platforms. +a `'message'` event instead of `'connection'` and using `server.bind()` instead +of `server.listen()`. This is, however, currently only supported on UNIX +platforms. #### Example: sending a socket object @@ -1324,8 +1329,8 @@ added: v0.1.90 A `Writable Stream` that represents the child process's `stdin`. -*Note that if a child process waits to read all of its input, the child will not -continue until this stream has been closed via `end()`.* +If a child process waits to read all of its input, the child will not continue +until this stream has been closed via `end()`. If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, then this will be `null`. @@ -1342,8 +1347,8 @@ added: v0.7.10 A sparse array of pipes to the child process, corresponding with positions in the [`stdio`][] option passed to [`child_process.spawn()`][] that have been set -to the value `'pipe'`. Note that `subprocess.stdio[0]`, `subprocess.stdio[1]`, -and `subprocess.stdio[2]` are also available as `subprocess.stdin`, +to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and +`subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, respectively. In the following example, only the child's fd `1` (stdout) is configured as a diff --git a/doc/api/cli.md b/doc/api/cli.md index 300e0182205810..71e36a4c12b561 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -126,13 +126,6 @@ Enables report to be generated on un-caught exceptions, if `--experimental-report` is enabled. Useful when inspecting JavaScript stack in conjunction with native stack and other runtime environment data. -### `--diagnostic-report-verbose` - - -Flag that enables additional information to be printed during report generation. - ### `--enable-fips` -* {string} The request path. Read-only. +* {string} The request path. ### request.removeHeader(name) + +> Stability: 1 - Experimental + +```C +napi_status napi_create_date(napi_env env, + double time, + napi_value* result); +``` + +- `[in] env`: The environment that the API is invoked under. +- `[in] time`: ECMAScript time value in milliseconds since 01 January, 1970 UTC. +- `[out] result`: A `napi_value` representing a JavaScript `Date`. + +Returns `napi_ok` if the API succeeded. + +This API allocates a JavaScript `Date` object. + +JavaScript `Date` objects are described in +[Section 20.3][] of the ECMAScript Language Specification. + #### napi_create_external + +> Stability: 1 - Experimental + +```C +napi_status napi_get_date_value(napi_env env, + napi_value value, + double* result) +``` + +- `[in] env`: The environment that the API is invoked under. +- `[in] value`: `napi_value` representing a JavaScript `Date`. +- `[out] result`: Time value as a `double` represented as milliseconds +since midnight at the beginning of 01 January, 1970 UTC. + +Returns `napi_ok` if the API succeeded. If a non-date `napi_value` is passed +in it returns `napi_date_expected`. + +This API returns the C double primitive of time value for the given JavaScript +`Date`. + #### napi_get_value_bool + +> Stability: 1 - Experimental + +```C +napi_status napi_is_date(napi_env env, napi_value value, bool* result) +``` + +- `[in] env`: The environment that the API is invoked under. +- `[in] value`: The JavaScript value to check. +- `[out] result`: Whether the given `napi_value` represents a JavaScript `Date` +object. + +Returns `napi_ok` if the API succeeded. + +This API checks if the `Object` passed in is a date. + ### napi_is_error -* `err` {Error} A custom error used for reporting the JavsScript stack. +* `err` {Error} A custom error used for reporting the JavaScript stack. * Returns: {string} Returns a JSON-formatted diagnostic report for the running process. The report's @@ -1703,8 +1703,6 @@ added: v11.8.0 * `filename` {string} Name of the file where the report is written. * `path` {string} Directory where the report is written. **Default:** the current working directory of the Node.js process. - * `verbose` {boolean} Flag that controls additional verbose information on - report generation. **Default:** `false`. Configures the diagnostic reporting behavior. Upon invocation, the runtime is reconfigured to generate reports based on `options`. Several usage examples @@ -1721,9 +1719,6 @@ process.report.setOptions({ filename: 'foo.json', path: '/home' }); // to `stdout` and `stderr`. Usage of these will result in report being written // to the associated standard streams. URLs are not supported. process.report.setOptions({ filename: 'stdout' }); - -// Enable verbose option on report generation. -process.report.setOptions({ verbose: true }); ``` Signal based report generation is not supported on Windows. @@ -1739,7 +1734,7 @@ added: v11.8.0 should be a relative path, that will be appended to the directory specified in `process.report.setOptions`, or the current working directory of the Node.js process, if unspecified. -* `err` {Error} A custom error used for reporting the JavsScript stack. +* `err` {Error} A custom error used for reporting the JavaScript stack. * Returns: {string} Returns the filename of the generated report. diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 60230d916b3243..67475601af9517 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -109,7 +109,7 @@ Any other input values will be coerced to empty strings. ```js querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); -// returns 'foo=bar&baz=qux&baz=quux&corge=' +// Returns 'foo=bar&baz=qux&baz=quux&corge=' querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); // returns 'foo:bar;baz:qux' diff --git a/doc/api/repl.md b/doc/api/repl.md index 5a817348433790..324b15f3852288 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -42,8 +42,7 @@ The following special commands are supported by all REPL instances: `> .load ./file/to/load.js` * `.editor` - Enter editor mode (`-D` to finish, `-C` to cancel). - -```js +```console > .editor // Entering editor mode (^D to finish, ^C to cancel) function welcome(name) { @@ -78,8 +77,7 @@ evaluation function when the [`repl.REPLServer`][] instance is created. The default evaluator supports direct evaluation of JavaScript expressions: - -```js +```console > 1 + 1 2 > const m = 2 @@ -107,8 +105,7 @@ repl.start('> ').context.m = msg; Properties in the `context` object appear as local within the REPL: - -```js +```console $ node repl_test.js > m 'message' @@ -136,8 +133,7 @@ REPL environment when used. For instance, unless otherwise declared as a global or scoped variable, the input `fs` will be evaluated on-demand as `global.fs = require('fs')`. - -```js +```console > fs.createReadStream('./some/file'); ``` @@ -164,8 +160,7 @@ The default evaluator will, by default, assign the result of the most recently evaluated expression to the special variable `_` (underscore). Explicitly setting `_` to a value will disable this behavior. - -```js +```console > [ 'a', 'b', 'c' ] [ 'a', 'b', 'c' ] > _.length @@ -182,8 +177,7 @@ Expression assignment to _ now disabled. Similarly, `_error` will refer to the last seen error, if there was any. Explicitly setting `_error` to a value will disable this behavior. - -```js +```console > throw new Error('foo'); Error: foo > _error.message @@ -195,8 +189,7 @@ Error: foo With the [`--experimental-repl-await`][] command line option specified, experimental support for the `await` keyword is enabled. - -```js +```console > await Promise.resolve(123) 123 > await Promise.reject(new Error('REPL await')) @@ -341,8 +334,7 @@ r.on('reset', initializeContext); When this code is executed, the global `'m'` variable can be modified but then reset to its initial value using the `.clear` command: - -```js +```console $ ./node example.js > m 'test' @@ -534,8 +526,7 @@ Node.js itself uses the `repl` module to provide its own interactive interface for executing JavaScript. This can be used by executing the Node.js binary without passing any arguments (or by passing the `-i` argument): - -```js +```console $ node > const a = [1, 2, 3]; undefined diff --git a/doc/api/report.md b/doc/api/report.md index 8d6d054c0a10b9..856cd80119ab79 100644 --- a/doc/api/report.md +++ b/doc/api/report.md @@ -23,7 +23,7 @@ is provided below for reference. { "header": { "event": "exception", - "location": "OnUncaughtException", + "trigger": "Exception", "filename": "report.20181221.005011.8974.001.json", "dumpEventTime": "2018-12-21T00:50:11Z", "dumpEventTimeStamp": "1545371411331", @@ -32,7 +32,7 @@ is provided below for reference. "/home/nodeuser/project/node/out/Release/node", "--experimental-report", "--diagnostic-report-uncaught-exception", - "/home/nodeuser/project/node/test/node-report/test-exception.js", + "/home/nodeuser/project/node/test/report/test-exception.js", "child" ], "nodejsVersion": "v12.0.0-pre", @@ -66,8 +66,8 @@ is provided below for reference. "javascriptStack": { "message": "Error: *** test-exception.js: throwing uncaught Error", "stack": [ - "at myException (/home/nodeuser/project/node/test/node-report/test-exception.js:9:11)", - "at Object. (/home/nodeuser/project/node/test/node-report/test-exception.js:12:3)", + "at myException (/home/nodeuser/project/node/test/report/test-exception.js:9:11)", + "at Object. (/home/nodeuser/project/node/test/report/test-exception.js:12:3)", "at Module._compile (internal/modules/cjs/loader.js:718:30)", "at Object.Module._extensions..js (internal/modules/cjs/loader.js:729:10)", "at Module.load (internal/modules/cjs/loader.js:617:32)", @@ -401,9 +401,6 @@ written. * `--diagnostic-report-signal` Sets or resets the signal for report generation (not supported on Windows). Default signal is `SIGUSR2`. -* `--diagnostic-report-verbose` Flag that enables additional information to be -printed during report generation. - A report can also be triggered via an API call from a JavaScript application: ```js @@ -495,8 +492,7 @@ process.report.setOptions({ events: ['exception', 'fatalerror', 'signal'], signal: 'SIGUSR2', filename: 'myreport.json', - path: '/home/nodeuser', - verbose: true + path: '/home/nodeuser' }); ``` @@ -519,9 +515,6 @@ timestamp, PID and sequence number. URLs are not supported. Defaults to the current working directory of the Node.js process. -`verbose` specifies whether to print additional verbose messages -pertinent to the report generation. Defaults to `false`. - ```js // Trigger report only on uncaught exceptions. process.report.setOptions({ events: ['exception'] }); @@ -541,7 +534,7 @@ environment variables: NODE_OPTIONS="--experimental-report --diagnostic-report-uncaught-exception \ --diagnostic-report-on-fatalerror --diagnostic-report-on-signal \ --diagnostic-report-signal=SIGUSR2 --diagnostic-report-filename=./report.json \ - --diagnostic-report-directory=/home/nodeuser --diagnostic-report-verbose" + --diagnostic-report-directory=/home/nodeuser" ``` Specific API documentation can be found under diff --git a/doc/api/stream.md b/doc/api/stream.md index 14bc50d3107283..c9d4b035ddd48c 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -135,7 +135,7 @@ const server = http.createServer((req, res) => { req.on('end', () => { try { const data = JSON.parse(body); - // write back something interesting to the user: + // Write back something interesting to the user: res.write(typeof data); res.end(); } catch (er) { @@ -413,7 +413,7 @@ Calling the [`stream.write()`][stream-write] method after calling [`stream.end()`][stream-end] will raise an error. ```js -// write 'hello, ' and then end with 'world!' +// Write 'hello, ' and then end with 'world!' const fs = require('fs'); const file = fs.createWriteStream('example.txt'); file.write('hello, '); @@ -684,7 +684,7 @@ pass.unpipe(writable); pass.on('data', (chunk) => { console.log(chunk.toString()); }); pass.write('ok'); // will not emit 'data' -pass.resume(); // must be called to make stream emit 'data' +pass.resume(); // Must be called to make stream emit 'data' ``` While `readable.readableFlowing` is `false`, data may be accumulating @@ -1211,7 +1211,7 @@ function parseHeader(stream, callback) { const remaining = split.join('\n\n'); const buf = Buffer.from(remaining, 'utf8'); stream.removeListener('error', callback); - // remove the 'readable' listener before unshifting + // Remove the 'readable' listener before unshifting stream.removeListener('readable', onReadable); if (buf.length) stream.unshift(buf); diff --git a/doc/api/util.md b/doc/api/util.md index f4ff140b6c2e28..31028c42ea43a7 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -158,7 +158,7 @@ const util = require('util'); const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); -fn1(); // emits a deprecation warning with code DEP0001 +fn1(); // Emits a deprecation warning with code DEP0001 fn2(); // Does not emit a deprecation warning because it has the same code ``` @@ -375,6 +375,9 @@ stream.write('With ES6'); - -### anyTypeAnnotation -```javascript -t.anyTypeAnnotation() -``` - -See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### arrayExpression -```javascript -t.arrayExpression(elements) -``` - -See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`. - -Aliases: `Expression` - - - `elements`: `Array` (default: `[]`) - ---- - -### arrayPattern -```javascript -t.arrayPattern(elements) -``` - -See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`. - -Aliases: `Pattern`, `PatternLike`, `LVal` - - - `elements`: `Array` (required) - - `decorators`: `Array` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - ---- - -### arrayTypeAnnotation -```javascript -t.arrayTypeAnnotation(elementType) -``` - -See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `elementType` (required) - ---- - -### arrowFunctionExpression -```javascript -t.arrowFunctionExpression(params, body, async) -``` - -See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`. - -Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish` - - - `params`: `Array` (required) - - `body`: `BlockStatement | Expression` (required) - - `async`: `boolean` (default: `false`) - - `expression`: `boolean` (default: `null`) - - `generator`: `boolean` (default: `false`) - - `returnType`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### assignmentExpression -```javascript -t.assignmentExpression(operator, left, right) -``` - -See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`. - -Aliases: `Expression` - - - `operator`: `string` (required) - - `left`: `LVal` (required) - - `right`: `Expression` (required) - ---- - -### assignmentPattern -```javascript -t.assignmentPattern(left, right) -``` - -See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`. - -Aliases: `Pattern`, `PatternLike`, `LVal` - - - `left`: `Identifier | ObjectPattern | ArrayPattern` (required) - - `right`: `Expression` (required) - - `decorators`: `Array` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - ---- - -### awaitExpression -```javascript -t.awaitExpression(argument) -``` - -See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`. - -Aliases: `Expression`, `Terminatorless` - - - `argument`: `Expression` (required) - ---- - -### binaryExpression -```javascript -t.binaryExpression(operator, left, right) -``` - -See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`. - -Aliases: `Binary`, `Expression` - - - `operator`: `'+' | '-' | '/' | '%' | '*' | '**' | '&' | '|' | '>>' | '>>>' | '<<' | '^' | '==' | '===' | '!=' | '!==' | 'in' | 'instanceof' | '>' | '<' | '>=' | '<='` (required) - - `left`: `Expression` (required) - - `right`: `Expression` (required) - ---- - -### bindExpression -```javascript -t.bindExpression(object, callee) -``` - -See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`. - -Aliases: `Expression` - - - `object` (required) - - `callee` (required) - ---- - -### blockStatement -```javascript -t.blockStatement(body, directives) -``` - -See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`. - -Aliases: `Scopable`, `BlockParent`, `Block`, `Statement` - - - `body`: `Array` (required) - - `directives`: `Array` (default: `[]`) - ---- - -### booleanLiteral -```javascript -t.booleanLiteral(value) -``` - -See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`. - -Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - - - `value`: `boolean` (required) - ---- - -### booleanLiteralTypeAnnotation -```javascript -t.booleanLiteralTypeAnnotation() -``` - -See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - ---- - -### booleanTypeAnnotation -```javascript -t.booleanTypeAnnotation() -``` - -See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### breakStatement -```javascript -t.breakStatement(label) -``` - -See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`. - -Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - - - `label`: `Identifier` (default: `null`) - ---- - -### callExpression -```javascript -t.callExpression(callee, arguments) -``` - -See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`. - -Aliases: `Expression` - - - `callee`: `Expression` (required) - - `arguments`: `Array` (required) - - `optional`: `true | false` (default: `null`) - - `typeParameters`: `TypeParameterInstantiation | TSTypeParameterInstantiation` (default: `null`) - ---- - -### catchClause -```javascript -t.catchClause(param, body) -``` - -See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`. - -Aliases: `Scopable`, `BlockParent` - - - `param`: `Identifier` (default: `null`) - - `body`: `BlockStatement` (required) - ---- - -### classBody -```javascript -t.classBody(body) -``` - -See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`. - - - `body`: `Array` (required) - ---- - -### classDeclaration -```javascript -t.classDeclaration(id, superClass, body, decorators) -``` - -See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`. - -Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish` - - - `id`: `Identifier` (default: `null`) - - `superClass`: `Expression` (default: `null`) - - `body`: `ClassBody` (required) - - `decorators`: `Array` (default: `null`) - - `abstract`: `boolean` (default: `null`) - - `declare`: `boolean` (default: `null`) - - `implements`: `Array` (default: `null`) - - `mixins` (default: `null`) - - `superTypeParameters`: `TypeParameterInstantiation | TSTypeParameterInstantiation` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### classExpression -```javascript -t.classExpression(id, superClass, body, decorators) -``` - -See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`. - -Aliases: `Scopable`, `Class`, `Expression`, `Pureish` - - - `id`: `Identifier` (default: `null`) - - `superClass`: `Expression` (default: `null`) - - `body`: `ClassBody` (required) - - `decorators`: `Array` (default: `null`) - - `implements`: `Array` (default: `null`) - - `mixins` (default: `null`) - - `superTypeParameters`: `TypeParameterInstantiation | TSTypeParameterInstantiation` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### classImplements -```javascript -t.classImplements(id, typeParameters) -``` - -See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`. - -Aliases: `Flow` - - - `id` (required) - - `typeParameters` (required) - ---- - -### classMethod -```javascript -t.classMethod(kind, key, params, body, computed, static) -``` - -See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`. - -Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method` - - - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`) - - `key`: if computed then `Expression` else `Identifier | Literal` (required) - - `params`: `Array` (required) - - `body`: `BlockStatement` (required) - - `computed`: `boolean` (default: `false`) - - `static`: `boolean` (default: `null`) - - `abstract`: `boolean` (default: `null`) - - `access`: `"public" | "private" | "protected"` (default: `null`) - - `accessibility`: `"public" | "private" | "protected"` (default: `null`) - - `async`: `boolean` (default: `false`) - - `decorators`: `Array` (default: `null`) - - `generator`: `boolean` (default: `false`) - - `optional`: `boolean` (default: `null`) - - `returnType`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### classProperty -```javascript -t.classProperty(key, value, typeAnnotation, decorators, computed) -``` - -See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`. - -Aliases: `Property` - - - `key` (required) - - `value`: `Expression` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `decorators`: `Array` (default: `null`) - - `computed`: `boolean` (default: `false`) - - `abstract`: `boolean` (default: `null`) - - `accessibility`: `"public" | "private" | "protected"` (default: `null`) - - `optional`: `boolean` (default: `null`) - - `readonly`: `boolean` (default: `null`) - - `static`: `boolean` (default: `null`) - ---- - -### conditionalExpression -```javascript -t.conditionalExpression(test, consequent, alternate) -``` - -See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`. - -Aliases: `Expression`, `Conditional` - - - `test`: `Expression` (required) - - `consequent`: `Expression` (required) - - `alternate`: `Expression` (required) - ---- - -### continueStatement -```javascript -t.continueStatement(label) -``` - -See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`. - -Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - - - `label`: `Identifier` (default: `null`) - ---- - -### debuggerStatement -```javascript -t.debuggerStatement() -``` - -See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`. - -Aliases: `Statement` - - ---- - -### declareClass -```javascript -t.declareClass(id, typeParameters, extends, body) -``` - -See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `extends` (required) - - `body` (required) - ---- - -### declareExportAllDeclaration -```javascript -t.declareExportAllDeclaration(source) -``` - -See also `t.isDeclareExportAllDeclaration(node, opts)` and `t.assertDeclareExportAllDeclaration(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `source` (required) - ---- - -### declareExportDeclaration -```javascript -t.declareExportDeclaration(declaration, specifiers, source) -``` - -See also `t.isDeclareExportDeclaration(node, opts)` and `t.assertDeclareExportDeclaration(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `declaration` (required) - - `specifiers` (required) - - `source` (required) - ---- - -### declareFunction -```javascript -t.declareFunction(id) -``` - -See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - ---- - -### declareInterface -```javascript -t.declareInterface(id, typeParameters, extends, body) -``` - -See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `extends` (required) - - `body` (required) - ---- - -### declareModule -```javascript -t.declareModule(id, body) -``` - -See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `body` (required) - ---- - -### declareModuleExports -```javascript -t.declareModuleExports(typeAnnotation) -``` - -See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `typeAnnotation` (required) - ---- - -### declareOpaqueType -```javascript -t.declareOpaqueType(id, typeParameters, supertype) -``` - -See also `t.isDeclareOpaqueType(node, opts)` and `t.assertDeclareOpaqueType(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `supertype` (required) - ---- - -### declareTypeAlias -```javascript -t.declareTypeAlias(id, typeParameters, right) -``` - -See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `right` (required) - ---- - -### declareVariable -```javascript -t.declareVariable(id) -``` - -See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - ---- - -### declaredPredicate -```javascript -t.declaredPredicate(value) -``` - -See also `t.isDeclaredPredicate(node, opts)` and `t.assertDeclaredPredicate(node, opts)`. - -Aliases: `Flow`, `FlowPredicate` - - - `value` (required) - ---- - -### decorator -```javascript -t.decorator(expression) -``` - -See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`. - - - `expression`: `Expression` (required) - ---- - -### directive -```javascript -t.directive(value) -``` - -See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`. - - - `value`: `DirectiveLiteral` (required) - ---- - -### directiveLiteral -```javascript -t.directiveLiteral(value) -``` - -See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`. - - - `value`: `string` (required) - ---- - -### doExpression -```javascript -t.doExpression(body) -``` - -See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`. - -Aliases: `Expression` - - - `body`: `BlockStatement` (required) - ---- - -### doWhileStatement -```javascript -t.doWhileStatement(test, body) -``` - -See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`. +or using yarn: -Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` - - - `test`: `Expression` (required) - - `body`: `Statement` (required) - ---- - -### emptyStatement -```javascript -t.emptyStatement() +```sh +yarn add @babel/types --dev ``` - -See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`. - -Aliases: `Statement` - - ---- - -### emptyTypeAnnotation -```javascript -t.emptyTypeAnnotation() -``` - -See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### existsTypeAnnotation -```javascript -t.existsTypeAnnotation() -``` - -See also `t.isExistsTypeAnnotation(node, opts)` and `t.assertExistsTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - ---- - -### exportAllDeclaration -```javascript -t.exportAllDeclaration(source) -``` - -See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - - - `source`: `StringLiteral` (required) - ---- - -### exportDefaultDeclaration -```javascript -t.exportDefaultDeclaration(declaration) -``` - -See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - - - `declaration`: `FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression` (required) - ---- - -### exportDefaultSpecifier -```javascript -t.exportDefaultSpecifier(exported) -``` - -See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `exported`: `Identifier` (required) - ---- - -### exportNamedDeclaration -```javascript -t.exportNamedDeclaration(declaration, specifiers, source) -``` - -See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - - - `declaration`: `Declaration` (default: `null`) - - `specifiers`: `Array` (required) - - `source`: `StringLiteral` (default: `null`) - ---- - -### exportNamespaceSpecifier -```javascript -t.exportNamespaceSpecifier(exported) -``` - -See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `exported`: `Identifier` (required) - ---- - -### exportSpecifier -```javascript -t.exportSpecifier(local, exported) -``` - -See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `local`: `Identifier` (required) - - `exported`: `Identifier` (required) - ---- - -### expressionStatement -```javascript -t.expressionStatement(expression) -``` - -See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`. - -Aliases: `Statement`, `ExpressionWrapper` - - - `expression`: `Expression` (required) - ---- - -### file -```javascript -t.file(program, comments, tokens) -``` - -See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`. - - - `program`: `Program` (required) - - `comments` (required) - - `tokens` (required) - ---- - -### forInStatement -```javascript -t.forInStatement(left, right, body) -``` - -See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`. - -Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` - - - `left`: `VariableDeclaration | LVal` (required) - - `right`: `Expression` (required) - - `body`: `Statement` (required) - ---- - -### forOfStatement -```javascript -t.forOfStatement(left, right, body) -``` - -See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`. - -Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` - - - `left`: `VariableDeclaration | LVal` (required) - - `right`: `Expression` (required) - - `body`: `Statement` (required) - - `await`: `boolean` (default: `false`) - ---- - -### forStatement -```javascript -t.forStatement(init, test, update, body) -``` - -See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`. - -Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop` - - - `init`: `VariableDeclaration | Expression` (default: `null`) - - `test`: `Expression` (default: `null`) - - `update`: `Expression` (default: `null`) - - `body`: `Statement` (required) - ---- - -### functionDeclaration -```javascript -t.functionDeclaration(id, params, body, generator, async) -``` - -See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`. - -Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, `Pureish`, `Declaration` - - - `id`: `Identifier` (default: `null`) - - `params`: `Array` (required) - - `body`: `BlockStatement` (required) - - `generator`: `boolean` (default: `false`) - - `async`: `boolean` (default: `false`) - - `declare`: `boolean` (default: `null`) - - `returnType`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### functionExpression -```javascript -t.functionExpression(id, params, body, generator, async) -``` - -See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`. - -Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish` - - - `id`: `Identifier` (default: `null`) - - `params`: `Array` (required) - - `body`: `BlockStatement` (required) - - `generator`: `boolean` (default: `false`) - - `async`: `boolean` (default: `false`) - - `returnType`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### functionTypeAnnotation -```javascript -t.functionTypeAnnotation(typeParameters, params, rest, returnType) -``` - -See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `typeParameters` (required) - - `params` (required) - - `rest` (required) - - `returnType` (required) - ---- - -### functionTypeParam -```javascript -t.functionTypeParam(name, typeAnnotation) -``` - -See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`. - -Aliases: `Flow` - - - `name` (required) - - `typeAnnotation` (required) - ---- - -### genericTypeAnnotation -```javascript -t.genericTypeAnnotation(id, typeParameters) -``` - -See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `id` (required) - - `typeParameters` (required) - ---- - -### identifier -```javascript -t.identifier(name) -``` - -See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`. - -Aliases: `Expression`, `PatternLike`, `LVal`, `TSEntityName` - - - `name`: `string` (required) - - `decorators`: `Array` (default: `null`) - - `optional`: `boolean` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - ---- - -### ifStatement -```javascript -t.ifStatement(test, consequent, alternate) -``` - -See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`. - -Aliases: `Statement`, `Conditional` - - - `test`: `Expression` (required) - - `consequent`: `Statement` (required) - - `alternate`: `Statement` (default: `null`) - ---- - -### import -```javascript -t.import() -``` - -See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`. - -Aliases: `Expression` - - ---- - -### importDeclaration -```javascript -t.importDeclaration(specifiers, source) -``` - -See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration`, `ModuleDeclaration` - - - `specifiers`: `Array` (required) - - `source`: `StringLiteral` (required) - ---- - -### importDefaultSpecifier -```javascript -t.importDefaultSpecifier(local) -``` - -See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `local`: `Identifier` (required) - ---- - -### importNamespaceSpecifier -```javascript -t.importNamespaceSpecifier(local) -``` - -See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `local`: `Identifier` (required) - ---- - -### importSpecifier -```javascript -t.importSpecifier(local, imported) -``` - -See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`. - -Aliases: `ModuleSpecifier` - - - `local`: `Identifier` (required) - - `imported`: `Identifier` (required) - - `importKind`: `null | 'type' | 'typeof'` (default: `null`) - ---- - -### inferredPredicate -```javascript -t.inferredPredicate() -``` - -See also `t.isInferredPredicate(node, opts)` and `t.assertInferredPredicate(node, opts)`. - -Aliases: `Flow`, `FlowPredicate` - - ---- - -### interfaceDeclaration -```javascript -t.interfaceDeclaration(id, typeParameters, extends, body) -``` - -See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `extends` (required) - - `body` (required) - ---- - -### interfaceExtends -```javascript -t.interfaceExtends(id, typeParameters) -``` - -See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`. - -Aliases: `Flow` - - - `id` (required) - - `typeParameters` (required) - ---- - -### intersectionTypeAnnotation -```javascript -t.intersectionTypeAnnotation(types) -``` - -See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `types` (required) - ---- - -### jSXAttribute -```javascript -t.jSXAttribute(name, value) -``` - -See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `name`: `JSXIdentifier | JSXNamespacedName` (required) - - `value`: `JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer` (default: `null`) - ---- - -### jSXClosingElement -```javascript -t.jSXClosingElement(name) -``` - -See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `name`: `JSXIdentifier | JSXMemberExpression` (required) - ---- - -### jSXClosingFragment -```javascript -t.jSXClosingFragment() -``` - -See also `t.isJSXClosingFragment(node, opts)` and `t.assertJSXClosingFragment(node, opts)`. - -Aliases: `JSX`, `Immutable` - - ---- - -### jSXElement -```javascript -t.jSXElement(openingElement, closingElement, children, selfClosing) -``` - -See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`. - -Aliases: `JSX`, `Immutable`, `Expression` - - - `openingElement`: `JSXOpeningElement` (required) - - `closingElement`: `JSXClosingElement` (default: `null`) - - `children`: `Array` (required) - - `selfClosing` (required) - ---- - -### jSXEmptyExpression -```javascript -t.jSXEmptyExpression() -``` - -See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`. - -Aliases: `JSX` - - ---- - -### jSXExpressionContainer -```javascript -t.jSXExpressionContainer(expression) -``` - -See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `expression`: `Expression` (required) - ---- - -### jSXFragment -```javascript -t.jSXFragment(openingFragment, closingFragment, children) -``` - -See also `t.isJSXFragment(node, opts)` and `t.assertJSXFragment(node, opts)`. - -Aliases: `JSX`, `Immutable`, `Expression` - - - `openingFragment`: `JSXOpeningFragment` (required) - - `closingFragment`: `JSXClosingFragment` (required) - - `children`: `Array` (required) - ---- - -### jSXIdentifier -```javascript -t.jSXIdentifier(name) -``` - -See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`. - -Aliases: `JSX` - - - `name`: `string` (required) - ---- - -### jSXMemberExpression -```javascript -t.jSXMemberExpression(object, property) -``` - -See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`. - -Aliases: `JSX` - - - `object`: `JSXMemberExpression | JSXIdentifier` (required) - - `property`: `JSXIdentifier` (required) - ---- - -### jSXNamespacedName -```javascript -t.jSXNamespacedName(namespace, name) -``` - -See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`. - -Aliases: `JSX` - - - `namespace`: `JSXIdentifier` (required) - - `name`: `JSXIdentifier` (required) - ---- - -### jSXOpeningElement -```javascript -t.jSXOpeningElement(name, attributes, selfClosing) -``` - -See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `name`: `JSXIdentifier | JSXMemberExpression` (required) - - `attributes`: `Array` (required) - - `selfClosing`: `boolean` (default: `false`) - ---- - -### jSXOpeningFragment -```javascript -t.jSXOpeningFragment() -``` - -See also `t.isJSXOpeningFragment(node, opts)` and `t.assertJSXOpeningFragment(node, opts)`. - -Aliases: `JSX`, `Immutable` - - ---- - -### jSXSpreadAttribute -```javascript -t.jSXSpreadAttribute(argument) -``` - -See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`. - -Aliases: `JSX` - - - `argument`: `Expression` (required) - ---- - -### jSXSpreadChild -```javascript -t.jSXSpreadChild(expression) -``` - -See also `t.isJSXSpreadChild(node, opts)` and `t.assertJSXSpreadChild(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `expression`: `Expression` (required) - ---- - -### jSXText -```javascript -t.jSXText(value) -``` - -See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`. - -Aliases: `JSX`, `Immutable` - - - `value`: `string` (required) - ---- - -### labeledStatement -```javascript -t.labeledStatement(label, body) -``` - -See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`. - -Aliases: `Statement` - - - `label`: `Identifier` (required) - - `body`: `Statement` (required) - ---- - -### logicalExpression -```javascript -t.logicalExpression(operator, left, right) -``` - -See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`. - -Aliases: `Binary`, `Expression` - - - `operator`: `'||' | '&&' | '??'` (required) - - `left`: `Expression` (required) - - `right`: `Expression` (required) - ---- - -### memberExpression -```javascript -t.memberExpression(object, property, computed, optional) -``` - -See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`. - -Aliases: `Expression`, `LVal` - - - `object`: `Expression` (required) - - `property`: if computed then `Expression` else `Identifier` (required) - - `computed`: `boolean` (default: `false`) - - `optional`: `true | false` (default: `null`) - ---- - -### metaProperty -```javascript -t.metaProperty(meta, property) -``` - -See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`. - -Aliases: `Expression` - - - `meta`: `Identifier` (required) - - `property`: `Identifier` (required) - ---- - -### mixedTypeAnnotation -```javascript -t.mixedTypeAnnotation() -``` - -See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### newExpression -```javascript -t.newExpression(callee, arguments) -``` - -See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`. - -Aliases: `Expression` - - - `callee`: `Expression` (required) - - `arguments`: `Array` (required) - - `optional`: `true | false` (default: `null`) - - `typeParameters`: `TypeParameterInstantiation | TSTypeParameterInstantiation` (default: `null`) - ---- - -### noop -```javascript -t.noop() -``` - -See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`. - - ---- - -### nullLiteral -```javascript -t.nullLiteral() -``` - -See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`. - -Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - - ---- - -### nullLiteralTypeAnnotation -```javascript -t.nullLiteralTypeAnnotation() -``` - -See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### nullableTypeAnnotation -```javascript -t.nullableTypeAnnotation(typeAnnotation) -``` - -See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `typeAnnotation` (required) - ---- - -### numberLiteralTypeAnnotation -```javascript -t.numberLiteralTypeAnnotation() -``` - -See also `t.isNumberLiteralTypeAnnotation(node, opts)` and `t.assertNumberLiteralTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - ---- - -### numberTypeAnnotation -```javascript -t.numberTypeAnnotation() -``` - -See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### numericLiteral -```javascript -t.numericLiteral(value) -``` - -See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`. - -Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - - - `value`: `number` (required) - ---- - -### objectExpression -```javascript -t.objectExpression(properties) -``` - -See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`. - -Aliases: `Expression` - - - `properties`: `Array` (required) - ---- - -### objectMethod -```javascript -t.objectMethod(kind, key, params, body, computed) -``` - -See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`. - -Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember` - - - `kind`: `"method" | "get" | "set"` (default: `'method'`) - - `key`: if computed then `Expression` else `Identifier | Literal` (required) - - `params`: `Array` (required) - - `body`: `BlockStatement` (required) - - `computed`: `boolean` (default: `false`) - - `async`: `boolean` (default: `false`) - - `decorators`: `Array` (default: `null`) - - `generator`: `boolean` (default: `false`) - - `returnType`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - - `typeParameters`: `TypeParameterDeclaration | TSTypeParameterDeclaration | Noop` (default: `null`) - ---- - -### objectPattern -```javascript -t.objectPattern(properties) -``` - -See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`. - -Aliases: `Pattern`, `PatternLike`, `LVal` - - - `properties`: `Array` (required) - - `decorators`: `Array` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - ---- - -### objectProperty -```javascript -t.objectProperty(key, value, computed, shorthand, decorators) -``` - -See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`. - -Aliases: `UserWhitespacable`, `Property`, `ObjectMember` - - - `key`: if computed then `Expression` else `Identifier | Literal` (required) - - `value`: `Expression | PatternLike` (required) - - `computed`: `boolean` (default: `false`) - - `shorthand`: `boolean` (default: `false`) - - `decorators`: `Array` (default: `null`) - ---- - -### objectTypeAnnotation -```javascript -t.objectTypeAnnotation(properties, indexers, callProperties) -``` - -See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `properties` (required) - - `indexers` (required) - - `callProperties` (required) - ---- - -### objectTypeCallProperty -```javascript -t.objectTypeCallProperty(value) -``` - -See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`. - -Aliases: `Flow`, `UserWhitespacable` - - - `value` (required) - ---- - -### objectTypeIndexer -```javascript -t.objectTypeIndexer(id, key, value) -``` - -See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`. - -Aliases: `Flow`, `UserWhitespacable` - - - `id` (required) - - `key` (required) - - `value` (required) - ---- - -### objectTypeProperty -```javascript -t.objectTypeProperty(key, value) -``` - -See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`. - -Aliases: `Flow`, `UserWhitespacable` - - - `key` (required) - - `value` (required) - ---- - -### objectTypeSpreadProperty -```javascript -t.objectTypeSpreadProperty(argument) -``` - -See also `t.isObjectTypeSpreadProperty(node, opts)` and `t.assertObjectTypeSpreadProperty(node, opts)`. - -Aliases: `Flow`, `UserWhitespacable` - - - `argument` (required) - ---- - -### opaqueType -```javascript -t.opaqueType(id, typeParameters, supertype, impltype) -``` - -See also `t.isOpaqueType(node, opts)` and `t.assertOpaqueType(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `supertype` (required) - - `impltype` (required) - ---- - -### parenthesizedExpression -```javascript -t.parenthesizedExpression(expression) -``` - -See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`. - -Aliases: `Expression`, `ExpressionWrapper` - - - `expression`: `Expression` (required) - ---- - -### program -```javascript -t.program(body, directives, sourceType) -``` - -See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`. - -Aliases: `Scopable`, `BlockParent`, `Block` - - - `body`: `Array` (required) - - `directives`: `Array` (default: `[]`) - - `sourceType`: `'script' | 'module'` (default: `'script'`) - - `sourceFile`: `string` (default: `null`) - ---- - -### qualifiedTypeIdentifier -```javascript -t.qualifiedTypeIdentifier(id, qualification) -``` - -See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`. - -Aliases: `Flow` - - - `id` (required) - - `qualification` (required) - ---- - -### regExpLiteral -```javascript -t.regExpLiteral(pattern, flags) -``` - -See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`. - -Aliases: `Expression`, `Literal` - - - `pattern`: `string` (required) - - `flags`: `string` (default: `''`) - ---- - -### restElement -```javascript -t.restElement(argument) -``` - -See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`. - -Aliases: `LVal`, `PatternLike` - - - `argument`: `LVal` (required) - - `decorators`: `Array` (default: `null`) - - `typeAnnotation`: `TypeAnnotation | TSTypeAnnotation | Noop` (default: `null`) - ---- - -### returnStatement -```javascript -t.returnStatement(argument) -``` - -See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`. - -Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - - - `argument`: `Expression` (default: `null`) - ---- - -### sequenceExpression -```javascript -t.sequenceExpression(expressions) -``` - -See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`. - -Aliases: `Expression` - - - `expressions`: `Array` (required) - ---- - -### spreadElement -```javascript -t.spreadElement(argument) -``` - -See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`. - -Aliases: `UnaryLike` - - - `argument`: `Expression` (required) - ---- - -### stringLiteral -```javascript -t.stringLiteral(value) -``` - -See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`. - -Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - - - `value`: `string` (required) - ---- - -### stringLiteralTypeAnnotation -```javascript -t.stringLiteralTypeAnnotation() -``` - -See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - ---- - -### stringTypeAnnotation -```javascript -t.stringTypeAnnotation() -``` - -See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### super -```javascript -t.super() -``` - -See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`. - -Aliases: `Expression` - - ---- - -### switchCase -```javascript -t.switchCase(test, consequent) -``` - -See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`. - - - `test`: `Expression` (default: `null`) - - `consequent`: `Array` (required) - ---- - -### switchStatement -```javascript -t.switchStatement(discriminant, cases) -``` - -See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`. - -Aliases: `Statement`, `BlockParent`, `Scopable` - - - `discriminant`: `Expression` (required) - - `cases`: `Array` (required) - ---- - -### tSAnyKeyword -```javascript -t.tSAnyKeyword() -``` - -See also `t.isTSAnyKeyword(node, opts)` and `t.assertTSAnyKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSArrayType -```javascript -t.tSArrayType(elementType) -``` - -See also `t.isTSArrayType(node, opts)` and `t.assertTSArrayType(node, opts)`. - -Aliases: `TSType` - - - `elementType`: `TSType` (required) - ---- - -### tSAsExpression -```javascript -t.tSAsExpression(expression, typeAnnotation) -``` - -See also `t.isTSAsExpression(node, opts)` and `t.assertTSAsExpression(node, opts)`. - -Aliases: `Expression` - - - `expression`: `Expression` (required) - - `typeAnnotation`: `TSType` (required) - ---- - -### tSBooleanKeyword -```javascript -t.tSBooleanKeyword() -``` - -See also `t.isTSBooleanKeyword(node, opts)` and `t.assertTSBooleanKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSCallSignatureDeclaration -```javascript -t.tSCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) -``` - -See also `t.isTSCallSignatureDeclaration(node, opts)` and `t.assertTSCallSignatureDeclaration(node, opts)`. - -Aliases: `TSTypeElement` - - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `parameters`: `Array` (default: `null`) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - ---- - -### tSConstructSignatureDeclaration -```javascript -t.tSConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) -``` - -See also `t.isTSConstructSignatureDeclaration(node, opts)` and `t.assertTSConstructSignatureDeclaration(node, opts)`. - -Aliases: `TSTypeElement` - - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `parameters`: `Array` (default: `null`) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - ---- - -### tSConstructorType -```javascript -t.tSConstructorType(typeParameters, typeAnnotation) -``` - -See also `t.isTSConstructorType(node, opts)` and `t.assertTSConstructorType(node, opts)`. - -Aliases: `TSType` - - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - - `parameters`: `Array` (default: `null`) - ---- - -### tSDeclareFunction -```javascript -t.tSDeclareFunction(id, typeParameters, params, returnType) -``` - -See also `t.isTSDeclareFunction(node, opts)` and `t.assertTSDeclareFunction(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `id`: `Identifier` (default: `null`) - - `typeParameters`: `TSTypeParameterDeclaration | Noop` (default: `null`) - - `params`: `Array` (required) - - `returnType`: `TSTypeAnnotation | Noop` (default: `null`) - - `async`: `boolean` (default: `false`) - - `declare`: `boolean` (default: `null`) - - `generator`: `boolean` (default: `false`) - ---- - -### tSDeclareMethod -```javascript -t.tSDeclareMethod(decorators, key, typeParameters, params, returnType) -``` - -See also `t.isTSDeclareMethod(node, opts)` and `t.assertTSDeclareMethod(node, opts)`. - - - `decorators`: `Array` (default: `null`) - - `key` (required) - - `typeParameters`: `TSTypeParameterDeclaration | Noop` (default: `null`) - - `params`: `Array` (required) - - `returnType`: `TSTypeAnnotation | Noop` (default: `null`) - - `abstract`: `boolean` (default: `null`) - - `access`: `"public" | "private" | "protected"` (default: `null`) - - `accessibility`: `"public" | "private" | "protected"` (default: `null`) - - `async`: `boolean` (default: `false`) - - `computed`: `boolean` (default: `false`) - - `generator`: `boolean` (default: `false`) - - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`) - - `optional`: `boolean` (default: `null`) - - `static`: `boolean` (default: `null`) - ---- - -### tSEnumDeclaration -```javascript -t.tSEnumDeclaration(id, members) -``` - -See also `t.isTSEnumDeclaration(node, opts)` and `t.assertTSEnumDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `id`: `Identifier` (required) - - `members`: `Array` (required) - - `const`: `boolean` (default: `null`) - - `declare`: `boolean` (default: `null`) - - `initializer`: `Expression` (default: `null`) - ---- - -### tSEnumMember -```javascript -t.tSEnumMember(id, initializer) -``` - -See also `t.isTSEnumMember(node, opts)` and `t.assertTSEnumMember(node, opts)`. - - - `id`: `Identifier | StringLiteral` (required) - - `initializer`: `Expression` (default: `null`) - ---- - -### tSExportAssignment -```javascript -t.tSExportAssignment(expression) -``` - -See also `t.isTSExportAssignment(node, opts)` and `t.assertTSExportAssignment(node, opts)`. - -Aliases: `Statement` - - - `expression`: `Expression` (required) - ---- - -### tSExpressionWithTypeArguments -```javascript -t.tSExpressionWithTypeArguments(expression, typeParameters) -``` - -See also `t.isTSExpressionWithTypeArguments(node, opts)` and `t.assertTSExpressionWithTypeArguments(node, opts)`. - -Aliases: `TSType` - - - `expression`: `TSEntityName` (required) - - `typeParameters`: `TSTypeParameterInstantiation` (default: `null`) - ---- - -### tSExternalModuleReference -```javascript -t.tSExternalModuleReference(expression) -``` - -See also `t.isTSExternalModuleReference(node, opts)` and `t.assertTSExternalModuleReference(node, opts)`. - - - `expression`: `StringLiteral` (required) - ---- - -### tSFunctionType -```javascript -t.tSFunctionType(typeParameters, typeAnnotation) -``` - -See also `t.isTSFunctionType(node, opts)` and `t.assertTSFunctionType(node, opts)`. - -Aliases: `TSType` - - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - - `parameters`: `Array` (default: `null`) - ---- - -### tSImportEqualsDeclaration -```javascript -t.tSImportEqualsDeclaration(id, moduleReference) -``` - -See also `t.isTSImportEqualsDeclaration(node, opts)` and `t.assertTSImportEqualsDeclaration(node, opts)`. - -Aliases: `Statement` - - - `id`: `Identifier` (required) - - `moduleReference`: `TSEntityName | TSExternalModuleReference` (required) - - `isExport`: `boolean` (default: `null`) - ---- - -### tSIndexSignature -```javascript -t.tSIndexSignature(parameters, typeAnnotation) -``` - -See also `t.isTSIndexSignature(node, opts)` and `t.assertTSIndexSignature(node, opts)`. - -Aliases: `TSTypeElement` - - - `parameters`: `Array` (required) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - - `readonly`: `boolean` (default: `null`) - ---- - -### tSIndexedAccessType -```javascript -t.tSIndexedAccessType(objectType, indexType) -``` - -See also `t.isTSIndexedAccessType(node, opts)` and `t.assertTSIndexedAccessType(node, opts)`. - -Aliases: `TSType` - - - `objectType`: `TSType` (required) - - `indexType`: `TSType` (required) - ---- - -### tSInterfaceBody -```javascript -t.tSInterfaceBody(body) -``` - -See also `t.isTSInterfaceBody(node, opts)` and `t.assertTSInterfaceBody(node, opts)`. - - - `body`: `Array` (required) - ---- - -### tSInterfaceDeclaration -```javascript -t.tSInterfaceDeclaration(id, typeParameters, extends, body) -``` - -See also `t.isTSInterfaceDeclaration(node, opts)` and `t.assertTSInterfaceDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `id`: `Identifier` (required) - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `extends`: `Array` (default: `null`) - - `body`: `TSInterfaceBody` (required) - - `declare`: `boolean` (default: `null`) - ---- - -### tSIntersectionType -```javascript -t.tSIntersectionType(types) -``` - -See also `t.isTSIntersectionType(node, opts)` and `t.assertTSIntersectionType(node, opts)`. - -Aliases: `TSType` - - - `types`: `Array` (required) - ---- - -### tSLiteralType -```javascript -t.tSLiteralType(literal) -``` - -See also `t.isTSLiteralType(node, opts)` and `t.assertTSLiteralType(node, opts)`. - -Aliases: `TSType` - - - `literal`: `NumericLiteral | StringLiteral | BooleanLiteral` (required) - ---- - -### tSMappedType -```javascript -t.tSMappedType(typeParameter, typeAnnotation) -``` - -See also `t.isTSMappedType(node, opts)` and `t.assertTSMappedType(node, opts)`. - -Aliases: `TSType` - - - `typeParameter`: `TSTypeParameter` (required) - - `typeAnnotation`: `TSType` (default: `null`) - - `optional`: `boolean` (default: `null`) - - `readonly`: `boolean` (default: `null`) - ---- - -### tSMethodSignature -```javascript -t.tSMethodSignature(key, typeParameters, parameters, typeAnnotation) -``` - -See also `t.isTSMethodSignature(node, opts)` and `t.assertTSMethodSignature(node, opts)`. - -Aliases: `TSTypeElement` - - - `key`: `Expression` (required) - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `parameters`: `Array` (default: `null`) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - - `computed`: `boolean` (default: `null`) - - `optional`: `boolean` (default: `null`) - ---- - -### tSModuleBlock -```javascript -t.tSModuleBlock(body) -``` - -See also `t.isTSModuleBlock(node, opts)` and `t.assertTSModuleBlock(node, opts)`. - - - `body`: `Array` (required) - ---- - -### tSModuleDeclaration -```javascript -t.tSModuleDeclaration(id, body) -``` - -See also `t.isTSModuleDeclaration(node, opts)` and `t.assertTSModuleDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `id`: `Identifier | StringLiteral` (required) - - `body`: `TSModuleBlock | TSModuleDeclaration` (required) - - `declare`: `boolean` (default: `null`) - - `global`: `boolean` (default: `null`) - ---- - -### tSNamespaceExportDeclaration -```javascript -t.tSNamespaceExportDeclaration(id) -``` - -See also `t.isTSNamespaceExportDeclaration(node, opts)` and `t.assertTSNamespaceExportDeclaration(node, opts)`. - -Aliases: `Statement` - - - `id`: `Identifier` (required) - ---- - -### tSNeverKeyword -```javascript -t.tSNeverKeyword() -``` - -See also `t.isTSNeverKeyword(node, opts)` and `t.assertTSNeverKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSNonNullExpression -```javascript -t.tSNonNullExpression(expression) -``` - -See also `t.isTSNonNullExpression(node, opts)` and `t.assertTSNonNullExpression(node, opts)`. - -Aliases: `Expression` - - - `expression`: `Expression` (required) - ---- - -### tSNullKeyword -```javascript -t.tSNullKeyword() -``` - -See also `t.isTSNullKeyword(node, opts)` and `t.assertTSNullKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSNumberKeyword -```javascript -t.tSNumberKeyword() -``` - -See also `t.isTSNumberKeyword(node, opts)` and `t.assertTSNumberKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSObjectKeyword -```javascript -t.tSObjectKeyword() -``` - -See also `t.isTSObjectKeyword(node, opts)` and `t.assertTSObjectKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSParameterProperty -```javascript -t.tSParameterProperty(parameter) -``` - -See also `t.isTSParameterProperty(node, opts)` and `t.assertTSParameterProperty(node, opts)`. - -Aliases: `LVal` - - - `parameter`: `Identifier | AssignmentPattern` (required) - - `accessibility`: `'public' | 'private' | 'protected'` (default: `null`) - - `readonly`: `boolean` (default: `null`) - ---- - -### tSParenthesizedType -```javascript -t.tSParenthesizedType(typeAnnotation) -``` - -See also `t.isTSParenthesizedType(node, opts)` and `t.assertTSParenthesizedType(node, opts)`. - -Aliases: `TSType` - - - `typeAnnotation`: `TSType` (required) - ---- - -### tSPropertySignature -```javascript -t.tSPropertySignature(key, typeAnnotation, initializer) -``` - -See also `t.isTSPropertySignature(node, opts)` and `t.assertTSPropertySignature(node, opts)`. - -Aliases: `TSTypeElement` - - - `key`: `Expression` (required) - - `typeAnnotation`: `TSTypeAnnotation` (default: `null`) - - `initializer`: `Expression` (default: `null`) - - `computed`: `boolean` (default: `null`) - - `optional`: `boolean` (default: `null`) - - `readonly`: `boolean` (default: `null`) - ---- - -### tSQualifiedName -```javascript -t.tSQualifiedName(left, right) -``` - -See also `t.isTSQualifiedName(node, opts)` and `t.assertTSQualifiedName(node, opts)`. - -Aliases: `TSEntityName` - - - `left`: `TSEntityName` (required) - - `right`: `Identifier` (required) - ---- - -### tSStringKeyword -```javascript -t.tSStringKeyword() -``` - -See also `t.isTSStringKeyword(node, opts)` and `t.assertTSStringKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSSymbolKeyword -```javascript -t.tSSymbolKeyword() -``` - -See also `t.isTSSymbolKeyword(node, opts)` and `t.assertTSSymbolKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSThisType -```javascript -t.tSThisType() -``` - -See also `t.isTSThisType(node, opts)` and `t.assertTSThisType(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSTupleType -```javascript -t.tSTupleType(elementTypes) -``` - -See also `t.isTSTupleType(node, opts)` and `t.assertTSTupleType(node, opts)`. - -Aliases: `TSType` - - - `elementTypes`: `Array` (required) - ---- - -### tSTypeAliasDeclaration -```javascript -t.tSTypeAliasDeclaration(id, typeParameters, typeAnnotation) -``` - -See also `t.isTSTypeAliasDeclaration(node, opts)` and `t.assertTSTypeAliasDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `id`: `Identifier` (required) - - `typeParameters`: `TSTypeParameterDeclaration` (default: `null`) - - `typeAnnotation`: `TSType` (required) - - `declare`: `boolean` (default: `null`) - ---- - -### tSTypeAnnotation -```javascript -t.tSTypeAnnotation(typeAnnotation) -``` - -See also `t.isTSTypeAnnotation(node, opts)` and `t.assertTSTypeAnnotation(node, opts)`. - - - `typeAnnotation`: `TSType` (required) - ---- - -### tSTypeAssertion -```javascript -t.tSTypeAssertion(typeAnnotation, expression) -``` - -See also `t.isTSTypeAssertion(node, opts)` and `t.assertTSTypeAssertion(node, opts)`. - -Aliases: `Expression` - - - `typeAnnotation`: `TSType` (required) - - `expression`: `Expression` (required) - ---- - -### tSTypeLiteral -```javascript -t.tSTypeLiteral(members) -``` - -See also `t.isTSTypeLiteral(node, opts)` and `t.assertTSTypeLiteral(node, opts)`. - -Aliases: `TSType` - - - `members`: `Array` (required) - ---- - -### tSTypeOperator -```javascript -t.tSTypeOperator(typeAnnotation) -``` - -See also `t.isTSTypeOperator(node, opts)` and `t.assertTSTypeOperator(node, opts)`. - -Aliases: `TSType` - - - `typeAnnotation`: `TSType` (required) - - `operator`: `string` (default: `null`) - ---- - -### tSTypeParameter -```javascript -t.tSTypeParameter(constraint, default) -``` - -See also `t.isTSTypeParameter(node, opts)` and `t.assertTSTypeParameter(node, opts)`. - - - `constraint`: `TSType` (default: `null`) - - `default`: `TSType` (default: `null`) - - `name`: `string` (default: `null`) - ---- - -### tSTypeParameterDeclaration -```javascript -t.tSTypeParameterDeclaration(params) -``` - -See also `t.isTSTypeParameterDeclaration(node, opts)` and `t.assertTSTypeParameterDeclaration(node, opts)`. - - - `params`: `Array` (required) - ---- - -### tSTypeParameterInstantiation -```javascript -t.tSTypeParameterInstantiation(params) -``` - -See also `t.isTSTypeParameterInstantiation(node, opts)` and `t.assertTSTypeParameterInstantiation(node, opts)`. - - - `params`: `Array` (required) - ---- - -### tSTypePredicate -```javascript -t.tSTypePredicate(parameterName, typeAnnotation) -``` - -See also `t.isTSTypePredicate(node, opts)` and `t.assertTSTypePredicate(node, opts)`. - -Aliases: `TSType` - - - `parameterName`: `Identifier | TSThisType` (required) - - `typeAnnotation`: `TSTypeAnnotation` (required) - ---- - -### tSTypeQuery -```javascript -t.tSTypeQuery(exprName) -``` - -See also `t.isTSTypeQuery(node, opts)` and `t.assertTSTypeQuery(node, opts)`. - -Aliases: `TSType` - - - `exprName`: `TSEntityName` (required) - ---- - -### tSTypeReference -```javascript -t.tSTypeReference(typeName, typeParameters) -``` - -See also `t.isTSTypeReference(node, opts)` and `t.assertTSTypeReference(node, opts)`. - -Aliases: `TSType` - - - `typeName`: `TSEntityName` (required) - - `typeParameters`: `TSTypeParameterInstantiation` (default: `null`) - ---- - -### tSUndefinedKeyword -```javascript -t.tSUndefinedKeyword() -``` - -See also `t.isTSUndefinedKeyword(node, opts)` and `t.assertTSUndefinedKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### tSUnionType -```javascript -t.tSUnionType(types) -``` - -See also `t.isTSUnionType(node, opts)` and `t.assertTSUnionType(node, opts)`. - -Aliases: `TSType` - - - `types`: `Array` (required) - ---- - -### tSVoidKeyword -```javascript -t.tSVoidKeyword() -``` - -See also `t.isTSVoidKeyword(node, opts)` and `t.assertTSVoidKeyword(node, opts)`. - -Aliases: `TSType` - - ---- - -### taggedTemplateExpression -```javascript -t.taggedTemplateExpression(tag, quasi) -``` - -See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`. - -Aliases: `Expression` - - - `tag`: `Expression` (required) - - `quasi`: `TemplateLiteral` (required) - ---- - -### templateElement -```javascript -t.templateElement(value, tail) -``` - -See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`. - - - `value` (required) - - `tail`: `boolean` (default: `false`) - ---- - -### templateLiteral -```javascript -t.templateLiteral(quasis, expressions) -``` - -See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`. - -Aliases: `Expression`, `Literal` - - - `quasis`: `Array` (required) - - `expressions`: `Array` (required) - ---- - -### thisExpression -```javascript -t.thisExpression() -``` - -See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`. - -Aliases: `Expression` - - ---- - -### thisTypeAnnotation -```javascript -t.thisTypeAnnotation() -``` - -See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### throwStatement -```javascript -t.throwStatement(argument) -``` - -See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`. - -Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - - - `argument`: `Expression` (required) - ---- - -### tryStatement -```javascript -t.tryStatement(block, handler, finalizer) -``` - -See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`. - -Aliases: `Statement` - - - `block`: `BlockStatement` (required) - - `handler`: `CatchClause` (default: `null`) - - `finalizer`: `BlockStatement` (default: `null`) - ---- - -### tupleTypeAnnotation -```javascript -t.tupleTypeAnnotation(types) -``` - -See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `types` (required) - ---- - -### typeAlias -```javascript -t.typeAlias(id, typeParameters, right) -``` - -See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`. - -Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - - - `id` (required) - - `typeParameters` (required) - - `right` (required) - ---- - -### typeAnnotation -```javascript -t.typeAnnotation(typeAnnotation) -``` - -See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `typeAnnotation`: `Flow` (required) - ---- - -### typeCastExpression -```javascript -t.typeCastExpression(expression, typeAnnotation) -``` - -See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`. - -Aliases: `Flow`, `ExpressionWrapper`, `Expression` - - - `expression` (required) - - `typeAnnotation` (required) - ---- - -### typeParameter -```javascript -t.typeParameter(bound, default) -``` - -See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`. - -Aliases: `Flow` - - - `bound`: `TypeAnnotation` (default: `null`) - - `default`: `Flow` (default: `null`) - - `name`: `string` (default: `null`) - ---- - -### typeParameterDeclaration -```javascript -t.typeParameterDeclaration(params) -``` - -See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`. - -Aliases: `Flow` - - - `params`: `Array` (required) - ---- - -### typeParameterInstantiation -```javascript -t.typeParameterInstantiation(params) -``` - -See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`. - -Aliases: `Flow` - - - `params`: `Array` (required) - ---- - -### typeofTypeAnnotation -```javascript -t.typeofTypeAnnotation(argument) -``` - -See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `argument` (required) - ---- - -### unaryExpression -```javascript -t.unaryExpression(operator, argument, prefix) -``` - -See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`. - -Aliases: `UnaryLike`, `Expression` - - - `operator`: `'void' | 'throw' | 'delete' | '!' | '+' | '-' | '~' | 'typeof'` (required) - - `argument`: `Expression` (required) - - `prefix`: `boolean` (default: `true`) - ---- - -### unionTypeAnnotation -```javascript -t.unionTypeAnnotation(types) -``` - -See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`. - -Aliases: `Flow` - - - `types` (required) - ---- - -### updateExpression -```javascript -t.updateExpression(operator, argument, prefix) -``` - -See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`. - -Aliases: `Expression` - - - `operator`: `'++' | '--'` (required) - - `argument`: `Expression` (required) - - `prefix`: `boolean` (default: `false`) - ---- - -### variableDeclaration -```javascript -t.variableDeclaration(kind, declarations) -``` - -See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`. - -Aliases: `Statement`, `Declaration` - - - `kind`: `"var" | "let" | "const"` (required) - - `declarations`: `Array` (required) - - `declare`: `boolean` (default: `null`) - ---- - -### variableDeclarator -```javascript -t.variableDeclarator(id, init) -``` - -See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`. - - - `id`: `LVal` (required) - - `init`: `Expression` (default: `null`) - ---- - -### voidTypeAnnotation -```javascript -t.voidTypeAnnotation() -``` - -See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`. - -Aliases: `Flow`, `FlowBaseAnnotation` - - ---- - -### whileStatement -```javascript -t.whileStatement(test, body) -``` - -See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`. - -Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` - - - `test`: `Expression` (required) - - `body`: `BlockStatement | Statement` (required) - ---- - -### withStatement -```javascript -t.withStatement(object, body) -``` - -See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`. - -Aliases: `Statement` - - - `object`: `Expression` (required) - - `body`: `BlockStatement | Statement` (required) - ---- - -### yieldExpression -```javascript -t.yieldExpression(argument, delegate) -``` - -See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`. - -Aliases: `Expression`, `Terminatorless` - - - `argument`: `Expression` (default: `null`) - - `delegate`: `boolean` (default: `false`) - ---- - - - - diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js index 783ee0dbccfae8..194ec716814276 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = assertNode; var _isNode = _interopRequireDefault(require("../validators/isNode")); @@ -9,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function assertNode(node) { if (!(0, _isNode.default)(node)) { - var type = node && node.type || JSON.stringify(node); - throw new TypeError("Not a valid node of type \"" + type + "\""); + const type = node && node.type || JSON.stringify(node); + throw new TypeError(`Not a valid node of type "${type}"`); } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js index 8c2b91eed30430..5b5659a1552e69 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js @@ -1,9 +1,12 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.assertArrayExpression = assertArrayExpression; exports.assertAssignmentExpression = assertAssignmentExpression; exports.assertBinaryExpression = assertBinaryExpression; +exports.assertInterpreterDirective = assertInterpreterDirective; exports.assertDirective = assertDirective; exports.assertDirectiveLiteral = assertDirectiveLiteral; exports.assertBlockStatement = assertBlockStatement; @@ -98,6 +101,7 @@ exports.assertGenericTypeAnnotation = assertGenericTypeAnnotation; exports.assertInferredPredicate = assertInferredPredicate; exports.assertInterfaceExtends = assertInterfaceExtends; exports.assertInterfaceDeclaration = assertInterfaceDeclaration; +exports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation; exports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation; exports.assertMixedTypeAnnotation = assertMixedTypeAnnotation; exports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation; @@ -105,6 +109,7 @@ exports.assertNullableTypeAnnotation = assertNullableTypeAnnotation; exports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation; exports.assertNumberTypeAnnotation = assertNumberTypeAnnotation; exports.assertObjectTypeAnnotation = assertObjectTypeAnnotation; +exports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot; exports.assertObjectTypeCallProperty = assertObjectTypeCallProperty; exports.assertObjectTypeIndexer = assertObjectTypeIndexer; exports.assertObjectTypeProperty = assertObjectTypeProperty; @@ -123,6 +128,7 @@ exports.assertTypeParameter = assertTypeParameter; exports.assertTypeParameterDeclaration = assertTypeParameterDeclaration; exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation; exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; +exports.assertVariance = assertVariance; exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; exports.assertJSXAttribute = assertJSXAttribute; exports.assertJSXClosingElement = assertJSXClosingElement; @@ -144,11 +150,20 @@ exports.assertParenthesizedExpression = assertParenthesizedExpression; exports.assertAwaitExpression = assertAwaitExpression; exports.assertBindExpression = assertBindExpression; exports.assertClassProperty = assertClassProperty; +exports.assertOptionalMemberExpression = assertOptionalMemberExpression; +exports.assertPipelineTopicExpression = assertPipelineTopicExpression; +exports.assertPipelineBareFunction = assertPipelineBareFunction; +exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference; +exports.assertOptionalCallExpression = assertOptionalCallExpression; +exports.assertClassPrivateProperty = assertClassPrivateProperty; +exports.assertClassPrivateMethod = assertClassPrivateMethod; exports.assertImport = assertImport; exports.assertDecorator = assertDecorator; exports.assertDoExpression = assertDoExpression; exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier; exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; +exports.assertPrivateName = assertPrivateName; +exports.assertBigIntLiteral = assertBigIntLiteral; exports.assertTSParameterProperty = assertTSParameterProperty; exports.assertTSDeclareFunction = assertTSDeclareFunction; exports.assertTSDeclareMethod = assertTSDeclareMethod; @@ -159,6 +174,7 @@ exports.assertTSPropertySignature = assertTSPropertySignature; exports.assertTSMethodSignature = assertTSMethodSignature; exports.assertTSIndexSignature = assertTSIndexSignature; exports.assertTSAnyKeyword = assertTSAnyKeyword; +exports.assertTSUnknownKeyword = assertTSUnknownKeyword; exports.assertTSNumberKeyword = assertTSNumberKeyword; exports.assertTSObjectKeyword = assertTSObjectKeyword; exports.assertTSBooleanKeyword = assertTSBooleanKeyword; @@ -177,8 +193,12 @@ exports.assertTSTypeQuery = assertTSTypeQuery; exports.assertTSTypeLiteral = assertTSTypeLiteral; exports.assertTSArrayType = assertTSArrayType; exports.assertTSTupleType = assertTSTupleType; +exports.assertTSOptionalType = assertTSOptionalType; +exports.assertTSRestType = assertTSRestType; exports.assertTSUnionType = assertTSUnionType; exports.assertTSIntersectionType = assertTSIntersectionType; +exports.assertTSConditionalType = assertTSConditionalType; +exports.assertTSInferType = assertTSInferType; exports.assertTSParenthesizedType = assertTSParenthesizedType; exports.assertTSTypeOperator = assertTSTypeOperator; exports.assertTSIndexedAccessType = assertTSIndexedAccessType; @@ -194,6 +214,7 @@ exports.assertTSEnumDeclaration = assertTSEnumDeclaration; exports.assertTSEnumMember = assertTSEnumMember; exports.assertTSModuleDeclaration = assertTSModuleDeclaration; exports.assertTSModuleBlock = assertTSModuleBlock; +exports.assertTSImportType = assertTSImportType; exports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration; exports.assertTSExternalModuleReference = assertTSExternalModuleReference; exports.assertTSNonNullExpression = assertTSNonNullExpression; @@ -237,10 +258,12 @@ exports.assertModuleDeclaration = assertModuleDeclaration; exports.assertExportDeclaration = assertExportDeclaration; exports.assertModuleSpecifier = assertModuleSpecifier; exports.assertFlow = assertFlow; +exports.assertFlowType = assertFlowType; exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation; exports.assertFlowDeclaration = assertFlowDeclaration; exports.assertFlowPredicate = assertFlowPredicate; exports.assertJSX = assertJSX; +exports.assertPrivate = assertPrivate; exports.assertTSTypeElement = assertTSTypeElement; exports.assertTSType = assertTSType; exports.assertNumberLiteral = assertNumberLiteral; @@ -254,1943 +277,1059 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function assert(type, node, opts) { if (!(0, _is.default)(type, node, opts)) { - throw new Error("Expected type \"" + type + "\" with option " + JSON.stringify(opts) + ", but instead got \"" + node.type + "\"."); + throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, but instead got "${node.type}".`); } } -function assertArrayExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertArrayExpression(node, opts = {}) { assert("ArrayExpression", node, opts); } -function assertAssignmentExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertAssignmentExpression(node, opts = {}) { assert("AssignmentExpression", node, opts); } -function assertBinaryExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBinaryExpression(node, opts = {}) { assert("BinaryExpression", node, opts); } -function assertDirective(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertInterpreterDirective(node, opts = {}) { + assert("InterpreterDirective", node, opts); +} +function assertDirective(node, opts = {}) { assert("Directive", node, opts); } -function assertDirectiveLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDirectiveLiteral(node, opts = {}) { assert("DirectiveLiteral", node, opts); } -function assertBlockStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBlockStatement(node, opts = {}) { assert("BlockStatement", node, opts); } -function assertBreakStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBreakStatement(node, opts = {}) { assert("BreakStatement", node, opts); } -function assertCallExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertCallExpression(node, opts = {}) { assert("CallExpression", node, opts); } -function assertCatchClause(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertCatchClause(node, opts = {}) { assert("CatchClause", node, opts); } -function assertConditionalExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertConditionalExpression(node, opts = {}) { assert("ConditionalExpression", node, opts); } -function assertContinueStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertContinueStatement(node, opts = {}) { assert("ContinueStatement", node, opts); } -function assertDebuggerStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDebuggerStatement(node, opts = {}) { assert("DebuggerStatement", node, opts); } -function assertDoWhileStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDoWhileStatement(node, opts = {}) { assert("DoWhileStatement", node, opts); } -function assertEmptyStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertEmptyStatement(node, opts = {}) { assert("EmptyStatement", node, opts); } -function assertExpressionStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExpressionStatement(node, opts = {}) { assert("ExpressionStatement", node, opts); } -function assertFile(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFile(node, opts = {}) { assert("File", node, opts); } -function assertForInStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertForInStatement(node, opts = {}) { assert("ForInStatement", node, opts); } -function assertForStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertForStatement(node, opts = {}) { assert("ForStatement", node, opts); } -function assertFunctionDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunctionDeclaration(node, opts = {}) { assert("FunctionDeclaration", node, opts); } -function assertFunctionExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunctionExpression(node, opts = {}) { assert("FunctionExpression", node, opts); } -function assertIdentifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertIdentifier(node, opts = {}) { assert("Identifier", node, opts); } -function assertIfStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertIfStatement(node, opts = {}) { assert("IfStatement", node, opts); } -function assertLabeledStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertLabeledStatement(node, opts = {}) { assert("LabeledStatement", node, opts); } -function assertStringLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertStringLiteral(node, opts = {}) { assert("StringLiteral", node, opts); } -function assertNumericLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNumericLiteral(node, opts = {}) { assert("NumericLiteral", node, opts); } -function assertNullLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNullLiteral(node, opts = {}) { assert("NullLiteral", node, opts); } -function assertBooleanLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBooleanLiteral(node, opts = {}) { assert("BooleanLiteral", node, opts); } -function assertRegExpLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertRegExpLiteral(node, opts = {}) { assert("RegExpLiteral", node, opts); } -function assertLogicalExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertLogicalExpression(node, opts = {}) { assert("LogicalExpression", node, opts); } -function assertMemberExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertMemberExpression(node, opts = {}) { assert("MemberExpression", node, opts); } -function assertNewExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNewExpression(node, opts = {}) { assert("NewExpression", node, opts); } -function assertProgram(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertProgram(node, opts = {}) { assert("Program", node, opts); } -function assertObjectExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectExpression(node, opts = {}) { assert("ObjectExpression", node, opts); } -function assertObjectMethod(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectMethod(node, opts = {}) { assert("ObjectMethod", node, opts); } -function assertObjectProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectProperty(node, opts = {}) { assert("ObjectProperty", node, opts); } -function assertRestElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertRestElement(node, opts = {}) { assert("RestElement", node, opts); } -function assertReturnStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertReturnStatement(node, opts = {}) { assert("ReturnStatement", node, opts); } -function assertSequenceExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertSequenceExpression(node, opts = {}) { assert("SequenceExpression", node, opts); } -function assertSwitchCase(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertSwitchCase(node, opts = {}) { assert("SwitchCase", node, opts); } -function assertSwitchStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertSwitchStatement(node, opts = {}) { assert("SwitchStatement", node, opts); } -function assertThisExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertThisExpression(node, opts = {}) { assert("ThisExpression", node, opts); } -function assertThrowStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertThrowStatement(node, opts = {}) { assert("ThrowStatement", node, opts); } -function assertTryStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTryStatement(node, opts = {}) { assert("TryStatement", node, opts); } -function assertUnaryExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertUnaryExpression(node, opts = {}) { assert("UnaryExpression", node, opts); } -function assertUpdateExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertUpdateExpression(node, opts = {}) { assert("UpdateExpression", node, opts); } -function assertVariableDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertVariableDeclaration(node, opts = {}) { assert("VariableDeclaration", node, opts); } -function assertVariableDeclarator(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertVariableDeclarator(node, opts = {}) { assert("VariableDeclarator", node, opts); } -function assertWhileStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertWhileStatement(node, opts = {}) { assert("WhileStatement", node, opts); } -function assertWithStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertWithStatement(node, opts = {}) { assert("WithStatement", node, opts); } -function assertAssignmentPattern(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertAssignmentPattern(node, opts = {}) { assert("AssignmentPattern", node, opts); } -function assertArrayPattern(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertArrayPattern(node, opts = {}) { assert("ArrayPattern", node, opts); } -function assertArrowFunctionExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertArrowFunctionExpression(node, opts = {}) { assert("ArrowFunctionExpression", node, opts); } -function assertClassBody(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassBody(node, opts = {}) { assert("ClassBody", node, opts); } -function assertClassDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassDeclaration(node, opts = {}) { assert("ClassDeclaration", node, opts); } -function assertClassExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassExpression(node, opts = {}) { assert("ClassExpression", node, opts); } -function assertExportAllDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExportAllDeclaration(node, opts = {}) { assert("ExportAllDeclaration", node, opts); } -function assertExportDefaultDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExportDefaultDeclaration(node, opts = {}) { assert("ExportDefaultDeclaration", node, opts); } -function assertExportNamedDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExportNamedDeclaration(node, opts = {}) { assert("ExportNamedDeclaration", node, opts); } -function assertExportSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExportSpecifier(node, opts = {}) { assert("ExportSpecifier", node, opts); } -function assertForOfStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertForOfStatement(node, opts = {}) { assert("ForOfStatement", node, opts); } -function assertImportDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertImportDeclaration(node, opts = {}) { assert("ImportDeclaration", node, opts); } -function assertImportDefaultSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertImportDefaultSpecifier(node, opts = {}) { assert("ImportDefaultSpecifier", node, opts); } -function assertImportNamespaceSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertImportNamespaceSpecifier(node, opts = {}) { assert("ImportNamespaceSpecifier", node, opts); } -function assertImportSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertImportSpecifier(node, opts = {}) { assert("ImportSpecifier", node, opts); } -function assertMetaProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertMetaProperty(node, opts = {}) { assert("MetaProperty", node, opts); } -function assertClassMethod(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassMethod(node, opts = {}) { assert("ClassMethod", node, opts); } -function assertObjectPattern(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectPattern(node, opts = {}) { assert("ObjectPattern", node, opts); } -function assertSpreadElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertSpreadElement(node, opts = {}) { assert("SpreadElement", node, opts); } -function assertSuper(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertSuper(node, opts = {}) { assert("Super", node, opts); } -function assertTaggedTemplateExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTaggedTemplateExpression(node, opts = {}) { assert("TaggedTemplateExpression", node, opts); } -function assertTemplateElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTemplateElement(node, opts = {}) { assert("TemplateElement", node, opts); } -function assertTemplateLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTemplateLiteral(node, opts = {}) { assert("TemplateLiteral", node, opts); } -function assertYieldExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertYieldExpression(node, opts = {}) { assert("YieldExpression", node, opts); } -function assertAnyTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertAnyTypeAnnotation(node, opts = {}) { assert("AnyTypeAnnotation", node, opts); } -function assertArrayTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertArrayTypeAnnotation(node, opts = {}) { assert("ArrayTypeAnnotation", node, opts); } -function assertBooleanTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBooleanTypeAnnotation(node, opts = {}) { assert("BooleanTypeAnnotation", node, opts); } -function assertBooleanLiteralTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBooleanLiteralTypeAnnotation(node, opts = {}) { assert("BooleanLiteralTypeAnnotation", node, opts); } -function assertNullLiteralTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNullLiteralTypeAnnotation(node, opts = {}) { assert("NullLiteralTypeAnnotation", node, opts); } -function assertClassImplements(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassImplements(node, opts = {}) { assert("ClassImplements", node, opts); } -function assertDeclareClass(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareClass(node, opts = {}) { assert("DeclareClass", node, opts); } -function assertDeclareFunction(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareFunction(node, opts = {}) { assert("DeclareFunction", node, opts); } -function assertDeclareInterface(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareInterface(node, opts = {}) { assert("DeclareInterface", node, opts); } -function assertDeclareModule(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareModule(node, opts = {}) { assert("DeclareModule", node, opts); } -function assertDeclareModuleExports(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareModuleExports(node, opts = {}) { assert("DeclareModuleExports", node, opts); } -function assertDeclareTypeAlias(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareTypeAlias(node, opts = {}) { assert("DeclareTypeAlias", node, opts); } -function assertDeclareOpaqueType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareOpaqueType(node, opts = {}) { assert("DeclareOpaqueType", node, opts); } -function assertDeclareVariable(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareVariable(node, opts = {}) { assert("DeclareVariable", node, opts); } -function assertDeclareExportDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareExportDeclaration(node, opts = {}) { assert("DeclareExportDeclaration", node, opts); } -function assertDeclareExportAllDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclareExportAllDeclaration(node, opts = {}) { assert("DeclareExportAllDeclaration", node, opts); } -function assertDeclaredPredicate(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclaredPredicate(node, opts = {}) { assert("DeclaredPredicate", node, opts); } -function assertExistsTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExistsTypeAnnotation(node, opts = {}) { assert("ExistsTypeAnnotation", node, opts); } -function assertFunctionTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunctionTypeAnnotation(node, opts = {}) { assert("FunctionTypeAnnotation", node, opts); } -function assertFunctionTypeParam(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunctionTypeParam(node, opts = {}) { assert("FunctionTypeParam", node, opts); } -function assertGenericTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertGenericTypeAnnotation(node, opts = {}) { assert("GenericTypeAnnotation", node, opts); } -function assertInferredPredicate(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertInferredPredicate(node, opts = {}) { assert("InferredPredicate", node, opts); } -function assertInterfaceExtends(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertInterfaceExtends(node, opts = {}) { assert("InterfaceExtends", node, opts); } -function assertInterfaceDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertInterfaceDeclaration(node, opts = {}) { assert("InterfaceDeclaration", node, opts); } -function assertIntersectionTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertInterfaceTypeAnnotation(node, opts = {}) { + assert("InterfaceTypeAnnotation", node, opts); +} +function assertIntersectionTypeAnnotation(node, opts = {}) { assert("IntersectionTypeAnnotation", node, opts); } -function assertMixedTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertMixedTypeAnnotation(node, opts = {}) { assert("MixedTypeAnnotation", node, opts); } -function assertEmptyTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertEmptyTypeAnnotation(node, opts = {}) { assert("EmptyTypeAnnotation", node, opts); } -function assertNullableTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNullableTypeAnnotation(node, opts = {}) { assert("NullableTypeAnnotation", node, opts); } -function assertNumberLiteralTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNumberLiteralTypeAnnotation(node, opts = {}) { assert("NumberLiteralTypeAnnotation", node, opts); } -function assertNumberTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNumberTypeAnnotation(node, opts = {}) { assert("NumberTypeAnnotation", node, opts); } -function assertObjectTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectTypeAnnotation(node, opts = {}) { assert("ObjectTypeAnnotation", node, opts); } -function assertObjectTypeCallProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertObjectTypeInternalSlot(node, opts = {}) { + assert("ObjectTypeInternalSlot", node, opts); +} +function assertObjectTypeCallProperty(node, opts = {}) { assert("ObjectTypeCallProperty", node, opts); } -function assertObjectTypeIndexer(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectTypeIndexer(node, opts = {}) { assert("ObjectTypeIndexer", node, opts); } -function assertObjectTypeProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectTypeProperty(node, opts = {}) { assert("ObjectTypeProperty", node, opts); } -function assertObjectTypeSpreadProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectTypeSpreadProperty(node, opts = {}) { assert("ObjectTypeSpreadProperty", node, opts); } -function assertOpaqueType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertOpaqueType(node, opts = {}) { assert("OpaqueType", node, opts); } -function assertQualifiedTypeIdentifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertQualifiedTypeIdentifier(node, opts = {}) { assert("QualifiedTypeIdentifier", node, opts); } -function assertStringLiteralTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertStringLiteralTypeAnnotation(node, opts = {}) { assert("StringLiteralTypeAnnotation", node, opts); } -function assertStringTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertStringTypeAnnotation(node, opts = {}) { assert("StringTypeAnnotation", node, opts); } -function assertThisTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertThisTypeAnnotation(node, opts = {}) { assert("ThisTypeAnnotation", node, opts); } -function assertTupleTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTupleTypeAnnotation(node, opts = {}) { assert("TupleTypeAnnotation", node, opts); } -function assertTypeofTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeofTypeAnnotation(node, opts = {}) { assert("TypeofTypeAnnotation", node, opts); } -function assertTypeAlias(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeAlias(node, opts = {}) { assert("TypeAlias", node, opts); } -function assertTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeAnnotation(node, opts = {}) { assert("TypeAnnotation", node, opts); } -function assertTypeCastExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeCastExpression(node, opts = {}) { assert("TypeCastExpression", node, opts); } -function assertTypeParameter(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeParameter(node, opts = {}) { assert("TypeParameter", node, opts); } -function assertTypeParameterDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeParameterDeclaration(node, opts = {}) { assert("TypeParameterDeclaration", node, opts); } -function assertTypeParameterInstantiation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTypeParameterInstantiation(node, opts = {}) { assert("TypeParameterInstantiation", node, opts); } -function assertUnionTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertUnionTypeAnnotation(node, opts = {}) { assert("UnionTypeAnnotation", node, opts); } -function assertVoidTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertVariance(node, opts = {}) { + assert("Variance", node, opts); +} +function assertVoidTypeAnnotation(node, opts = {}) { assert("VoidTypeAnnotation", node, opts); } -function assertJSXAttribute(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXAttribute(node, opts = {}) { assert("JSXAttribute", node, opts); } -function assertJSXClosingElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXClosingElement(node, opts = {}) { assert("JSXClosingElement", node, opts); } -function assertJSXElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXElement(node, opts = {}) { assert("JSXElement", node, opts); } -function assertJSXEmptyExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXEmptyExpression(node, opts = {}) { assert("JSXEmptyExpression", node, opts); } -function assertJSXExpressionContainer(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXExpressionContainer(node, opts = {}) { assert("JSXExpressionContainer", node, opts); } -function assertJSXSpreadChild(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXSpreadChild(node, opts = {}) { assert("JSXSpreadChild", node, opts); } -function assertJSXIdentifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXIdentifier(node, opts = {}) { assert("JSXIdentifier", node, opts); } -function assertJSXMemberExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXMemberExpression(node, opts = {}) { assert("JSXMemberExpression", node, opts); } -function assertJSXNamespacedName(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXNamespacedName(node, opts = {}) { assert("JSXNamespacedName", node, opts); } -function assertJSXOpeningElement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXOpeningElement(node, opts = {}) { assert("JSXOpeningElement", node, opts); } -function assertJSXSpreadAttribute(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXSpreadAttribute(node, opts = {}) { assert("JSXSpreadAttribute", node, opts); } -function assertJSXText(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXText(node, opts = {}) { assert("JSXText", node, opts); } -function assertJSXFragment(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXFragment(node, opts = {}) { assert("JSXFragment", node, opts); } -function assertJSXOpeningFragment(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXOpeningFragment(node, opts = {}) { assert("JSXOpeningFragment", node, opts); } -function assertJSXClosingFragment(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSXClosingFragment(node, opts = {}) { assert("JSXClosingFragment", node, opts); } -function assertNoop(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertNoop(node, opts = {}) { assert("Noop", node, opts); } -function assertParenthesizedExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertParenthesizedExpression(node, opts = {}) { assert("ParenthesizedExpression", node, opts); } -function assertAwaitExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertAwaitExpression(node, opts = {}) { assert("AwaitExpression", node, opts); } -function assertBindExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBindExpression(node, opts = {}) { assert("BindExpression", node, opts); } -function assertClassProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClassProperty(node, opts = {}) { assert("ClassProperty", node, opts); } -function assertImport(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertOptionalMemberExpression(node, opts = {}) { + assert("OptionalMemberExpression", node, opts); +} - assert("Import", node, opts); +function assertPipelineTopicExpression(node, opts = {}) { + assert("PipelineTopicExpression", node, opts); } -function assertDecorator(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertPipelineBareFunction(node, opts = {}) { + assert("PipelineBareFunction", node, opts); +} - assert("Decorator", node, opts); +function assertPipelinePrimaryTopicReference(node, opts = {}) { + assert("PipelinePrimaryTopicReference", node, opts); } -function assertDoExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertOptionalCallExpression(node, opts = {}) { + assert("OptionalCallExpression", node, opts); +} - assert("DoExpression", node, opts); +function assertClassPrivateProperty(node, opts = {}) { + assert("ClassPrivateProperty", node, opts); } -function assertExportDefaultSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertClassPrivateMethod(node, opts = {}) { + assert("ClassPrivateMethod", node, opts); +} - assert("ExportDefaultSpecifier", node, opts); +function assertImport(node, opts = {}) { + assert("Import", node, opts); } -function assertExportNamespaceSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertDecorator(node, opts = {}) { + assert("Decorator", node, opts); +} + +function assertDoExpression(node, opts = {}) { + assert("DoExpression", node, opts); +} +function assertExportDefaultSpecifier(node, opts = {}) { + assert("ExportDefaultSpecifier", node, opts); +} + +function assertExportNamespaceSpecifier(node, opts = {}) { assert("ExportNamespaceSpecifier", node, opts); } -function assertTSParameterProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertPrivateName(node, opts = {}) { + assert("PrivateName", node, opts); +} - assert("TSParameterProperty", node, opts); +function assertBigIntLiteral(node, opts = {}) { + assert("BigIntLiteral", node, opts); } -function assertTSDeclareFunction(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSParameterProperty(node, opts = {}) { + assert("TSParameterProperty", node, opts); +} +function assertTSDeclareFunction(node, opts = {}) { assert("TSDeclareFunction", node, opts); } -function assertTSDeclareMethod(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSDeclareMethod(node, opts = {}) { assert("TSDeclareMethod", node, opts); } -function assertTSQualifiedName(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSQualifiedName(node, opts = {}) { assert("TSQualifiedName", node, opts); } -function assertTSCallSignatureDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSCallSignatureDeclaration(node, opts = {}) { assert("TSCallSignatureDeclaration", node, opts); } -function assertTSConstructSignatureDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSConstructSignatureDeclaration(node, opts = {}) { assert("TSConstructSignatureDeclaration", node, opts); } -function assertTSPropertySignature(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSPropertySignature(node, opts = {}) { assert("TSPropertySignature", node, opts); } -function assertTSMethodSignature(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSMethodSignature(node, opts = {}) { assert("TSMethodSignature", node, opts); } -function assertTSIndexSignature(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSIndexSignature(node, opts = {}) { assert("TSIndexSignature", node, opts); } -function assertTSAnyKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSAnyKeyword(node, opts = {}) { assert("TSAnyKeyword", node, opts); } -function assertTSNumberKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSUnknownKeyword(node, opts = {}) { + assert("TSUnknownKeyword", node, opts); +} +function assertTSNumberKeyword(node, opts = {}) { assert("TSNumberKeyword", node, opts); } -function assertTSObjectKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSObjectKeyword(node, opts = {}) { assert("TSObjectKeyword", node, opts); } -function assertTSBooleanKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSBooleanKeyword(node, opts = {}) { assert("TSBooleanKeyword", node, opts); } -function assertTSStringKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSStringKeyword(node, opts = {}) { assert("TSStringKeyword", node, opts); } -function assertTSSymbolKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSSymbolKeyword(node, opts = {}) { assert("TSSymbolKeyword", node, opts); } -function assertTSVoidKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSVoidKeyword(node, opts = {}) { assert("TSVoidKeyword", node, opts); } -function assertTSUndefinedKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSUndefinedKeyword(node, opts = {}) { assert("TSUndefinedKeyword", node, opts); } -function assertTSNullKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSNullKeyword(node, opts = {}) { assert("TSNullKeyword", node, opts); } -function assertTSNeverKeyword(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSNeverKeyword(node, opts = {}) { assert("TSNeverKeyword", node, opts); } -function assertTSThisType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSThisType(node, opts = {}) { assert("TSThisType", node, opts); } -function assertTSFunctionType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSFunctionType(node, opts = {}) { assert("TSFunctionType", node, opts); } -function assertTSConstructorType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSConstructorType(node, opts = {}) { assert("TSConstructorType", node, opts); } -function assertTSTypeReference(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeReference(node, opts = {}) { assert("TSTypeReference", node, opts); } -function assertTSTypePredicate(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypePredicate(node, opts = {}) { assert("TSTypePredicate", node, opts); } -function assertTSTypeQuery(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeQuery(node, opts = {}) { assert("TSTypeQuery", node, opts); } -function assertTSTypeLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeLiteral(node, opts = {}) { assert("TSTypeLiteral", node, opts); } -function assertTSArrayType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSArrayType(node, opts = {}) { assert("TSArrayType", node, opts); } -function assertTSTupleType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTupleType(node, opts = {}) { assert("TSTupleType", node, opts); } -function assertTSUnionType(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSOptionalType(node, opts = {}) { + assert("TSOptionalType", node, opts); +} - assert("TSUnionType", node, opts); +function assertTSRestType(node, opts = {}) { + assert("TSRestType", node, opts); } -function assertTSIntersectionType(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSUnionType(node, opts = {}) { + assert("TSUnionType", node, opts); +} +function assertTSIntersectionType(node, opts = {}) { assert("TSIntersectionType", node, opts); } -function assertTSParenthesizedType(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSConditionalType(node, opts = {}) { + assert("TSConditionalType", node, opts); +} - assert("TSParenthesizedType", node, opts); +function assertTSInferType(node, opts = {}) { + assert("TSInferType", node, opts); } -function assertTSTypeOperator(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSParenthesizedType(node, opts = {}) { + assert("TSParenthesizedType", node, opts); +} +function assertTSTypeOperator(node, opts = {}) { assert("TSTypeOperator", node, opts); } -function assertTSIndexedAccessType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSIndexedAccessType(node, opts = {}) { assert("TSIndexedAccessType", node, opts); } -function assertTSMappedType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSMappedType(node, opts = {}) { assert("TSMappedType", node, opts); } -function assertTSLiteralType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSLiteralType(node, opts = {}) { assert("TSLiteralType", node, opts); } -function assertTSExpressionWithTypeArguments(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSExpressionWithTypeArguments(node, opts = {}) { assert("TSExpressionWithTypeArguments", node, opts); } -function assertTSInterfaceDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSInterfaceDeclaration(node, opts = {}) { assert("TSInterfaceDeclaration", node, opts); } -function assertTSInterfaceBody(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSInterfaceBody(node, opts = {}) { assert("TSInterfaceBody", node, opts); } -function assertTSTypeAliasDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeAliasDeclaration(node, opts = {}) { assert("TSTypeAliasDeclaration", node, opts); } -function assertTSAsExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSAsExpression(node, opts = {}) { assert("TSAsExpression", node, opts); } -function assertTSTypeAssertion(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeAssertion(node, opts = {}) { assert("TSTypeAssertion", node, opts); } -function assertTSEnumDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSEnumDeclaration(node, opts = {}) { assert("TSEnumDeclaration", node, opts); } -function assertTSEnumMember(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSEnumMember(node, opts = {}) { assert("TSEnumMember", node, opts); } -function assertTSModuleDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSModuleDeclaration(node, opts = {}) { assert("TSModuleDeclaration", node, opts); } -function assertTSModuleBlock(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSModuleBlock(node, opts = {}) { assert("TSModuleBlock", node, opts); } -function assertTSImportEqualsDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertTSImportType(node, opts = {}) { + assert("TSImportType", node, opts); +} +function assertTSImportEqualsDeclaration(node, opts = {}) { assert("TSImportEqualsDeclaration", node, opts); } -function assertTSExternalModuleReference(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSExternalModuleReference(node, opts = {}) { assert("TSExternalModuleReference", node, opts); } -function assertTSNonNullExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSNonNullExpression(node, opts = {}) { assert("TSNonNullExpression", node, opts); } -function assertTSExportAssignment(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSExportAssignment(node, opts = {}) { assert("TSExportAssignment", node, opts); } -function assertTSNamespaceExportDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSNamespaceExportDeclaration(node, opts = {}) { assert("TSNamespaceExportDeclaration", node, opts); } -function assertTSTypeAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeAnnotation(node, opts = {}) { assert("TSTypeAnnotation", node, opts); } -function assertTSTypeParameterInstantiation(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeParameterInstantiation(node, opts = {}) { assert("TSTypeParameterInstantiation", node, opts); } -function assertTSTypeParameterDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeParameterDeclaration(node, opts = {}) { assert("TSTypeParameterDeclaration", node, opts); } -function assertTSTypeParameter(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSTypeParameter(node, opts = {}) { assert("TSTypeParameter", node, opts); } -function assertExpression(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExpression(node, opts = {}) { assert("Expression", node, opts); } -function assertBinary(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBinary(node, opts = {}) { assert("Binary", node, opts); } -function assertScopable(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertScopable(node, opts = {}) { assert("Scopable", node, opts); } -function assertBlockParent(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBlockParent(node, opts = {}) { assert("BlockParent", node, opts); } -function assertBlock(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertBlock(node, opts = {}) { assert("Block", node, opts); } -function assertStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertStatement(node, opts = {}) { assert("Statement", node, opts); } -function assertTerminatorless(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTerminatorless(node, opts = {}) { assert("Terminatorless", node, opts); } -function assertCompletionStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertCompletionStatement(node, opts = {}) { assert("CompletionStatement", node, opts); } -function assertConditional(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertConditional(node, opts = {}) { assert("Conditional", node, opts); } -function assertLoop(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertLoop(node, opts = {}) { assert("Loop", node, opts); } -function assertWhile(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertWhile(node, opts = {}) { assert("While", node, opts); } -function assertExpressionWrapper(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExpressionWrapper(node, opts = {}) { assert("ExpressionWrapper", node, opts); } -function assertFor(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFor(node, opts = {}) { assert("For", node, opts); } -function assertForXStatement(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertForXStatement(node, opts = {}) { assert("ForXStatement", node, opts); } -function assertFunction(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunction(node, opts = {}) { assert("Function", node, opts); } -function assertFunctionParent(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFunctionParent(node, opts = {}) { assert("FunctionParent", node, opts); } -function assertPureish(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertPureish(node, opts = {}) { assert("Pureish", node, opts); } -function assertDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertDeclaration(node, opts = {}) { assert("Declaration", node, opts); } -function assertPatternLike(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertPatternLike(node, opts = {}) { assert("PatternLike", node, opts); } -function assertLVal(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertLVal(node, opts = {}) { assert("LVal", node, opts); } -function assertTSEntityName(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSEntityName(node, opts = {}) { assert("TSEntityName", node, opts); } -function assertLiteral(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertLiteral(node, opts = {}) { assert("Literal", node, opts); } -function assertImmutable(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertImmutable(node, opts = {}) { assert("Immutable", node, opts); } -function assertUserWhitespacable(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertUserWhitespacable(node, opts = {}) { assert("UserWhitespacable", node, opts); } -function assertMethod(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertMethod(node, opts = {}) { assert("Method", node, opts); } -function assertObjectMember(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertObjectMember(node, opts = {}) { assert("ObjectMember", node, opts); } -function assertProperty(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertProperty(node, opts = {}) { assert("Property", node, opts); } -function assertUnaryLike(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertUnaryLike(node, opts = {}) { assert("UnaryLike", node, opts); } -function assertPattern(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertPattern(node, opts = {}) { assert("Pattern", node, opts); } -function assertClass(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertClass(node, opts = {}) { assert("Class", node, opts); } -function assertModuleDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertModuleDeclaration(node, opts = {}) { assert("ModuleDeclaration", node, opts); } -function assertExportDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertExportDeclaration(node, opts = {}) { assert("ExportDeclaration", node, opts); } -function assertModuleSpecifier(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertModuleSpecifier(node, opts = {}) { assert("ModuleSpecifier", node, opts); } -function assertFlow(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFlow(node, opts = {}) { assert("Flow", node, opts); } -function assertFlowBaseAnnotation(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertFlowType(node, opts = {}) { + assert("FlowType", node, opts); +} +function assertFlowBaseAnnotation(node, opts = {}) { assert("FlowBaseAnnotation", node, opts); } -function assertFlowDeclaration(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFlowDeclaration(node, opts = {}) { assert("FlowDeclaration", node, opts); } -function assertFlowPredicate(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertFlowPredicate(node, opts = {}) { assert("FlowPredicate", node, opts); } -function assertJSX(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertJSX(node, opts = {}) { assert("JSX", node, opts); } -function assertTSTypeElement(node, opts) { - if (opts === void 0) { - opts = {}; - } +function assertPrivate(node, opts = {}) { + assert("Private", node, opts); +} +function assertTSTypeElement(node, opts = {}) { assert("TSTypeElement", node, opts); } -function assertTSType(node, opts) { - if (opts === void 0) { - opts = {}; - } - +function assertTSType(node, opts = {}) { assert("TSType", node, opts); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js index 4adf87032d41f1..50d1b2a95f5bbf 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js @@ -1,9 +1,19 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = builder; -var _clone = _interopRequireDefault(require("lodash/clone")); +function _clone() { + const data = _interopRequireDefault(require("lodash/clone")); + + _clone = function () { + return data; + }; + + return data; +} var _definitions = require("../definitions"); @@ -11,32 +21,28 @@ var _validate = _interopRequireDefault(require("../validators/validate")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function builder(type) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var keys = _definitions.BUILDER_KEYS[type]; - var countArgs = args.length; +function builder(type, ...args) { + const keys = _definitions.BUILDER_KEYS[type]; + const countArgs = args.length; if (countArgs > keys.length) { - throw new Error(type + ": Too many arguments passed. Received " + countArgs + " but can receive no more than " + keys.length); + throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`); } - var node = { - type: type + const node = { + type }; - var i = 0; - keys.forEach(function (key) { - var field = _definitions.NODE_FIELDS[type][key]; - var arg; + let i = 0; + keys.forEach(key => { + const field = _definitions.NODE_FIELDS[type][key]; + let arg; if (i < countArgs) arg = args[i]; - if (arg === undefined) arg = (0, _clone.default)(field.default); + if (arg === undefined) arg = (0, _clone().default)(field.default); node[key] = arg; i++; }); - for (var key in node) { + for (const key in node) { (0, _validate.default)(node, key, node[key]); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js index bff3b99b3f62e5..4724335f2ab71e 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = createTypeAnnotationBasedOnTypeof; var _generated = require("../generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js index 932e45972962ce..df76b0107ff09f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = createUnionTypeAnnotation; var _generated = require("../generated"); @@ -10,7 +12,7 @@ var _removeTypeDuplicates = _interopRequireDefault(require("../../modifications/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function createUnionTypeAnnotation(types) { - var flattened = (0, _removeTypeDuplicates.default)(types); + const flattened = (0, _removeTypeDuplicates.default)(types); if (flattened.length === 1) { return flattened[0]; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js index 632b628f8dd6bb..e77a2dd345fe92 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js @@ -1,9 +1,12 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.arrayExpression = exports.ArrayExpression = ArrayExpression; exports.assignmentExpression = exports.AssignmentExpression = AssignmentExpression; exports.binaryExpression = exports.BinaryExpression = BinaryExpression; +exports.interpreterDirective = exports.InterpreterDirective = InterpreterDirective; exports.directive = exports.Directive = Directive; exports.directiveLiteral = exports.DirectiveLiteral = DirectiveLiteral; exports.blockStatement = exports.BlockStatement = BlockStatement; @@ -98,6 +101,7 @@ exports.genericTypeAnnotation = exports.GenericTypeAnnotation = GenericTypeAnnot exports.inferredPredicate = exports.InferredPredicate = InferredPredicate; exports.interfaceExtends = exports.InterfaceExtends = InterfaceExtends; exports.interfaceDeclaration = exports.InterfaceDeclaration = InterfaceDeclaration; +exports.interfaceTypeAnnotation = exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; exports.intersectionTypeAnnotation = exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; exports.mixedTypeAnnotation = exports.MixedTypeAnnotation = MixedTypeAnnotation; exports.emptyTypeAnnotation = exports.EmptyTypeAnnotation = EmptyTypeAnnotation; @@ -105,6 +109,7 @@ exports.nullableTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAn exports.numberLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = NumberLiteralTypeAnnotation; exports.numberTypeAnnotation = exports.NumberTypeAnnotation = NumberTypeAnnotation; exports.objectTypeAnnotation = exports.ObjectTypeAnnotation = ObjectTypeAnnotation; +exports.objectTypeInternalSlot = exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; exports.objectTypeCallProperty = exports.ObjectTypeCallProperty = ObjectTypeCallProperty; exports.objectTypeIndexer = exports.ObjectTypeIndexer = ObjectTypeIndexer; exports.objectTypeProperty = exports.ObjectTypeProperty = ObjectTypeProperty; @@ -123,6 +128,7 @@ exports.typeParameter = exports.TypeParameter = TypeParameter; exports.typeParameterDeclaration = exports.TypeParameterDeclaration = TypeParameterDeclaration; exports.typeParameterInstantiation = exports.TypeParameterInstantiation = TypeParameterInstantiation; exports.unionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; +exports.variance = exports.Variance = Variance; exports.voidTypeAnnotation = exports.VoidTypeAnnotation = VoidTypeAnnotation; exports.jSXAttribute = exports.jsxAttribute = exports.JSXAttribute = JSXAttribute; exports.jSXClosingElement = exports.jsxClosingElement = exports.JSXClosingElement = JSXClosingElement; @@ -144,11 +150,20 @@ exports.parenthesizedExpression = exports.ParenthesizedExpression = Parenthesize exports.awaitExpression = exports.AwaitExpression = AwaitExpression; exports.bindExpression = exports.BindExpression = BindExpression; exports.classProperty = exports.ClassProperty = ClassProperty; +exports.optionalMemberExpression = exports.OptionalMemberExpression = OptionalMemberExpression; +exports.pipelineTopicExpression = exports.PipelineTopicExpression = PipelineTopicExpression; +exports.pipelineBareFunction = exports.PipelineBareFunction = PipelineBareFunction; +exports.pipelinePrimaryTopicReference = exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; +exports.optionalCallExpression = exports.OptionalCallExpression = OptionalCallExpression; +exports.classPrivateProperty = exports.ClassPrivateProperty = ClassPrivateProperty; +exports.classPrivateMethod = exports.ClassPrivateMethod = ClassPrivateMethod; exports.import = exports.Import = Import; exports.decorator = exports.Decorator = Decorator; exports.doExpression = exports.DoExpression = DoExpression; exports.exportDefaultSpecifier = exports.ExportDefaultSpecifier = ExportDefaultSpecifier; exports.exportNamespaceSpecifier = exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; +exports.privateName = exports.PrivateName = PrivateName; +exports.bigIntLiteral = exports.BigIntLiteral = BigIntLiteral; exports.tSParameterProperty = exports.tsParameterProperty = exports.TSParameterProperty = TSParameterProperty; exports.tSDeclareFunction = exports.tsDeclareFunction = exports.TSDeclareFunction = TSDeclareFunction; exports.tSDeclareMethod = exports.tsDeclareMethod = exports.TSDeclareMethod = TSDeclareMethod; @@ -159,6 +174,7 @@ exports.tSPropertySignature = exports.tsPropertySignature = exports.TSPropertySi exports.tSMethodSignature = exports.tsMethodSignature = exports.TSMethodSignature = TSMethodSignature; exports.tSIndexSignature = exports.tsIndexSignature = exports.TSIndexSignature = TSIndexSignature; exports.tSAnyKeyword = exports.tsAnyKeyword = exports.TSAnyKeyword = TSAnyKeyword; +exports.tSUnknownKeyword = exports.tsUnknownKeyword = exports.TSUnknownKeyword = TSUnknownKeyword; exports.tSNumberKeyword = exports.tsNumberKeyword = exports.TSNumberKeyword = TSNumberKeyword; exports.tSObjectKeyword = exports.tsObjectKeyword = exports.TSObjectKeyword = TSObjectKeyword; exports.tSBooleanKeyword = exports.tsBooleanKeyword = exports.TSBooleanKeyword = TSBooleanKeyword; @@ -177,8 +193,12 @@ exports.tSTypeQuery = exports.tsTypeQuery = exports.TSTypeQuery = TSTypeQuery; exports.tSTypeLiteral = exports.tsTypeLiteral = exports.TSTypeLiteral = TSTypeLiteral; exports.tSArrayType = exports.tsArrayType = exports.TSArrayType = TSArrayType; exports.tSTupleType = exports.tsTupleType = exports.TSTupleType = TSTupleType; +exports.tSOptionalType = exports.tsOptionalType = exports.TSOptionalType = TSOptionalType; +exports.tSRestType = exports.tsRestType = exports.TSRestType = TSRestType; exports.tSUnionType = exports.tsUnionType = exports.TSUnionType = TSUnionType; exports.tSIntersectionType = exports.tsIntersectionType = exports.TSIntersectionType = TSIntersectionType; +exports.tSConditionalType = exports.tsConditionalType = exports.TSConditionalType = TSConditionalType; +exports.tSInferType = exports.tsInferType = exports.TSInferType = TSInferType; exports.tSParenthesizedType = exports.tsParenthesizedType = exports.TSParenthesizedType = TSParenthesizedType; exports.tSTypeOperator = exports.tsTypeOperator = exports.TSTypeOperator = TSTypeOperator; exports.tSIndexedAccessType = exports.tsIndexedAccessType = exports.TSIndexedAccessType = TSIndexedAccessType; @@ -194,6 +214,7 @@ exports.tSEnumDeclaration = exports.tsEnumDeclaration = exports.TSEnumDeclaratio exports.tSEnumMember = exports.tsEnumMember = exports.TSEnumMember = TSEnumMember; exports.tSModuleDeclaration = exports.tsModuleDeclaration = exports.TSModuleDeclaration = TSModuleDeclaration; exports.tSModuleBlock = exports.tsModuleBlock = exports.TSModuleBlock = TSModuleBlock; +exports.tSImportType = exports.tsImportType = exports.TSImportType = TSImportType; exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; exports.tSExternalModuleReference = exports.tsExternalModuleReference = exports.TSExternalModuleReference = TSExternalModuleReference; exports.tSNonNullExpression = exports.tsNonNullExpression = exports.TSNonNullExpression = TSNonNullExpression; @@ -212,1658 +233,906 @@ var _builder = _interopRequireDefault(require("../builder")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function ArrayExpression() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _builder.default.apply(void 0, ["ArrayExpression"].concat(args)); +function ArrayExpression(...args) { + return (0, _builder.default)("ArrayExpression", ...args); } -function AssignmentExpression() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return _builder.default.apply(void 0, ["AssignmentExpression"].concat(args)); +function AssignmentExpression(...args) { + return (0, _builder.default)("AssignmentExpression", ...args); } -function BinaryExpression() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - return _builder.default.apply(void 0, ["BinaryExpression"].concat(args)); +function BinaryExpression(...args) { + return (0, _builder.default)("BinaryExpression", ...args); } -function Directive() { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - return _builder.default.apply(void 0, ["Directive"].concat(args)); +function InterpreterDirective(...args) { + return (0, _builder.default)("InterpreterDirective", ...args); } -function DirectiveLiteral() { - for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - return _builder.default.apply(void 0, ["DirectiveLiteral"].concat(args)); +function Directive(...args) { + return (0, _builder.default)("Directive", ...args); } -function BlockStatement() { - for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - args[_key6] = arguments[_key6]; - } - - return _builder.default.apply(void 0, ["BlockStatement"].concat(args)); +function DirectiveLiteral(...args) { + return (0, _builder.default)("DirectiveLiteral", ...args); } -function BreakStatement() { - for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { - args[_key7] = arguments[_key7]; - } - - return _builder.default.apply(void 0, ["BreakStatement"].concat(args)); +function BlockStatement(...args) { + return (0, _builder.default)("BlockStatement", ...args); } -function CallExpression() { - for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { - args[_key8] = arguments[_key8]; - } - - return _builder.default.apply(void 0, ["CallExpression"].concat(args)); +function BreakStatement(...args) { + return (0, _builder.default)("BreakStatement", ...args); } -function CatchClause() { - for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { - args[_key9] = arguments[_key9]; - } - - return _builder.default.apply(void 0, ["CatchClause"].concat(args)); +function CallExpression(...args) { + return (0, _builder.default)("CallExpression", ...args); } -function ConditionalExpression() { - for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { - args[_key10] = arguments[_key10]; - } - - return _builder.default.apply(void 0, ["ConditionalExpression"].concat(args)); +function CatchClause(...args) { + return (0, _builder.default)("CatchClause", ...args); } -function ContinueStatement() { - for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { - args[_key11] = arguments[_key11]; - } - - return _builder.default.apply(void 0, ["ContinueStatement"].concat(args)); +function ConditionalExpression(...args) { + return (0, _builder.default)("ConditionalExpression", ...args); } -function DebuggerStatement() { - for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { - args[_key12] = arguments[_key12]; - } - - return _builder.default.apply(void 0, ["DebuggerStatement"].concat(args)); +function ContinueStatement(...args) { + return (0, _builder.default)("ContinueStatement", ...args); } -function DoWhileStatement() { - for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) { - args[_key13] = arguments[_key13]; - } - - return _builder.default.apply(void 0, ["DoWhileStatement"].concat(args)); +function DebuggerStatement(...args) { + return (0, _builder.default)("DebuggerStatement", ...args); } -function EmptyStatement() { - for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) { - args[_key14] = arguments[_key14]; - } - - return _builder.default.apply(void 0, ["EmptyStatement"].concat(args)); +function DoWhileStatement(...args) { + return (0, _builder.default)("DoWhileStatement", ...args); } -function ExpressionStatement() { - for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) { - args[_key15] = arguments[_key15]; - } - - return _builder.default.apply(void 0, ["ExpressionStatement"].concat(args)); +function EmptyStatement(...args) { + return (0, _builder.default)("EmptyStatement", ...args); } -function File() { - for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) { - args[_key16] = arguments[_key16]; - } - - return _builder.default.apply(void 0, ["File"].concat(args)); +function ExpressionStatement(...args) { + return (0, _builder.default)("ExpressionStatement", ...args); } -function ForInStatement() { - for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) { - args[_key17] = arguments[_key17]; - } - - return _builder.default.apply(void 0, ["ForInStatement"].concat(args)); +function File(...args) { + return (0, _builder.default)("File", ...args); } -function ForStatement() { - for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) { - args[_key18] = arguments[_key18]; - } - - return _builder.default.apply(void 0, ["ForStatement"].concat(args)); +function ForInStatement(...args) { + return (0, _builder.default)("ForInStatement", ...args); } -function FunctionDeclaration() { - for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) { - args[_key19] = arguments[_key19]; - } - - return _builder.default.apply(void 0, ["FunctionDeclaration"].concat(args)); +function ForStatement(...args) { + return (0, _builder.default)("ForStatement", ...args); } -function FunctionExpression() { - for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) { - args[_key20] = arguments[_key20]; - } - - return _builder.default.apply(void 0, ["FunctionExpression"].concat(args)); +function FunctionDeclaration(...args) { + return (0, _builder.default)("FunctionDeclaration", ...args); } -function Identifier() { - for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) { - args[_key21] = arguments[_key21]; - } - - return _builder.default.apply(void 0, ["Identifier"].concat(args)); +function FunctionExpression(...args) { + return (0, _builder.default)("FunctionExpression", ...args); } -function IfStatement() { - for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) { - args[_key22] = arguments[_key22]; - } - - return _builder.default.apply(void 0, ["IfStatement"].concat(args)); +function Identifier(...args) { + return (0, _builder.default)("Identifier", ...args); } -function LabeledStatement() { - for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) { - args[_key23] = arguments[_key23]; - } - - return _builder.default.apply(void 0, ["LabeledStatement"].concat(args)); +function IfStatement(...args) { + return (0, _builder.default)("IfStatement", ...args); } -function StringLiteral() { - for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) { - args[_key24] = arguments[_key24]; - } - - return _builder.default.apply(void 0, ["StringLiteral"].concat(args)); +function LabeledStatement(...args) { + return (0, _builder.default)("LabeledStatement", ...args); } -function NumericLiteral() { - for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) { - args[_key25] = arguments[_key25]; - } - - return _builder.default.apply(void 0, ["NumericLiteral"].concat(args)); +function StringLiteral(...args) { + return (0, _builder.default)("StringLiteral", ...args); } -function NullLiteral() { - for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) { - args[_key26] = arguments[_key26]; - } - - return _builder.default.apply(void 0, ["NullLiteral"].concat(args)); +function NumericLiteral(...args) { + return (0, _builder.default)("NumericLiteral", ...args); } -function BooleanLiteral() { - for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) { - args[_key27] = arguments[_key27]; - } - - return _builder.default.apply(void 0, ["BooleanLiteral"].concat(args)); +function NullLiteral(...args) { + return (0, _builder.default)("NullLiteral", ...args); } -function RegExpLiteral() { - for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) { - args[_key28] = arguments[_key28]; - } - - return _builder.default.apply(void 0, ["RegExpLiteral"].concat(args)); +function BooleanLiteral(...args) { + return (0, _builder.default)("BooleanLiteral", ...args); } -function LogicalExpression() { - for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) { - args[_key29] = arguments[_key29]; - } - - return _builder.default.apply(void 0, ["LogicalExpression"].concat(args)); +function RegExpLiteral(...args) { + return (0, _builder.default)("RegExpLiteral", ...args); } -function MemberExpression() { - for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) { - args[_key30] = arguments[_key30]; - } - - return _builder.default.apply(void 0, ["MemberExpression"].concat(args)); +function LogicalExpression(...args) { + return (0, _builder.default)("LogicalExpression", ...args); } -function NewExpression() { - for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) { - args[_key31] = arguments[_key31]; - } - - return _builder.default.apply(void 0, ["NewExpression"].concat(args)); +function MemberExpression(...args) { + return (0, _builder.default)("MemberExpression", ...args); } -function Program() { - for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) { - args[_key32] = arguments[_key32]; - } - - return _builder.default.apply(void 0, ["Program"].concat(args)); +function NewExpression(...args) { + return (0, _builder.default)("NewExpression", ...args); } -function ObjectExpression() { - for (var _len33 = arguments.length, args = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) { - args[_key33] = arguments[_key33]; - } - - return _builder.default.apply(void 0, ["ObjectExpression"].concat(args)); +function Program(...args) { + return (0, _builder.default)("Program", ...args); } -function ObjectMethod() { - for (var _len34 = arguments.length, args = new Array(_len34), _key34 = 0; _key34 < _len34; _key34++) { - args[_key34] = arguments[_key34]; - } - - return _builder.default.apply(void 0, ["ObjectMethod"].concat(args)); +function ObjectExpression(...args) { + return (0, _builder.default)("ObjectExpression", ...args); } -function ObjectProperty() { - for (var _len35 = arguments.length, args = new Array(_len35), _key35 = 0; _key35 < _len35; _key35++) { - args[_key35] = arguments[_key35]; - } - - return _builder.default.apply(void 0, ["ObjectProperty"].concat(args)); +function ObjectMethod(...args) { + return (0, _builder.default)("ObjectMethod", ...args); } -function RestElement() { - for (var _len36 = arguments.length, args = new Array(_len36), _key36 = 0; _key36 < _len36; _key36++) { - args[_key36] = arguments[_key36]; - } - - return _builder.default.apply(void 0, ["RestElement"].concat(args)); +function ObjectProperty(...args) { + return (0, _builder.default)("ObjectProperty", ...args); } -function ReturnStatement() { - for (var _len37 = arguments.length, args = new Array(_len37), _key37 = 0; _key37 < _len37; _key37++) { - args[_key37] = arguments[_key37]; - } - - return _builder.default.apply(void 0, ["ReturnStatement"].concat(args)); +function RestElement(...args) { + return (0, _builder.default)("RestElement", ...args); } -function SequenceExpression() { - for (var _len38 = arguments.length, args = new Array(_len38), _key38 = 0; _key38 < _len38; _key38++) { - args[_key38] = arguments[_key38]; - } - - return _builder.default.apply(void 0, ["SequenceExpression"].concat(args)); +function ReturnStatement(...args) { + return (0, _builder.default)("ReturnStatement", ...args); } -function SwitchCase() { - for (var _len39 = arguments.length, args = new Array(_len39), _key39 = 0; _key39 < _len39; _key39++) { - args[_key39] = arguments[_key39]; - } - - return _builder.default.apply(void 0, ["SwitchCase"].concat(args)); +function SequenceExpression(...args) { + return (0, _builder.default)("SequenceExpression", ...args); } -function SwitchStatement() { - for (var _len40 = arguments.length, args = new Array(_len40), _key40 = 0; _key40 < _len40; _key40++) { - args[_key40] = arguments[_key40]; - } - - return _builder.default.apply(void 0, ["SwitchStatement"].concat(args)); +function SwitchCase(...args) { + return (0, _builder.default)("SwitchCase", ...args); } -function ThisExpression() { - for (var _len41 = arguments.length, args = new Array(_len41), _key41 = 0; _key41 < _len41; _key41++) { - args[_key41] = arguments[_key41]; - } - - return _builder.default.apply(void 0, ["ThisExpression"].concat(args)); +function SwitchStatement(...args) { + return (0, _builder.default)("SwitchStatement", ...args); } -function ThrowStatement() { - for (var _len42 = arguments.length, args = new Array(_len42), _key42 = 0; _key42 < _len42; _key42++) { - args[_key42] = arguments[_key42]; - } - - return _builder.default.apply(void 0, ["ThrowStatement"].concat(args)); +function ThisExpression(...args) { + return (0, _builder.default)("ThisExpression", ...args); } -function TryStatement() { - for (var _len43 = arguments.length, args = new Array(_len43), _key43 = 0; _key43 < _len43; _key43++) { - args[_key43] = arguments[_key43]; - } - - return _builder.default.apply(void 0, ["TryStatement"].concat(args)); +function ThrowStatement(...args) { + return (0, _builder.default)("ThrowStatement", ...args); } -function UnaryExpression() { - for (var _len44 = arguments.length, args = new Array(_len44), _key44 = 0; _key44 < _len44; _key44++) { - args[_key44] = arguments[_key44]; - } - - return _builder.default.apply(void 0, ["UnaryExpression"].concat(args)); +function TryStatement(...args) { + return (0, _builder.default)("TryStatement", ...args); } -function UpdateExpression() { - for (var _len45 = arguments.length, args = new Array(_len45), _key45 = 0; _key45 < _len45; _key45++) { - args[_key45] = arguments[_key45]; - } - - return _builder.default.apply(void 0, ["UpdateExpression"].concat(args)); +function UnaryExpression(...args) { + return (0, _builder.default)("UnaryExpression", ...args); } -function VariableDeclaration() { - for (var _len46 = arguments.length, args = new Array(_len46), _key46 = 0; _key46 < _len46; _key46++) { - args[_key46] = arguments[_key46]; - } - - return _builder.default.apply(void 0, ["VariableDeclaration"].concat(args)); +function UpdateExpression(...args) { + return (0, _builder.default)("UpdateExpression", ...args); } -function VariableDeclarator() { - for (var _len47 = arguments.length, args = new Array(_len47), _key47 = 0; _key47 < _len47; _key47++) { - args[_key47] = arguments[_key47]; - } - - return _builder.default.apply(void 0, ["VariableDeclarator"].concat(args)); +function VariableDeclaration(...args) { + return (0, _builder.default)("VariableDeclaration", ...args); } -function WhileStatement() { - for (var _len48 = arguments.length, args = new Array(_len48), _key48 = 0; _key48 < _len48; _key48++) { - args[_key48] = arguments[_key48]; - } - - return _builder.default.apply(void 0, ["WhileStatement"].concat(args)); +function VariableDeclarator(...args) { + return (0, _builder.default)("VariableDeclarator", ...args); } -function WithStatement() { - for (var _len49 = arguments.length, args = new Array(_len49), _key49 = 0; _key49 < _len49; _key49++) { - args[_key49] = arguments[_key49]; - } - - return _builder.default.apply(void 0, ["WithStatement"].concat(args)); +function WhileStatement(...args) { + return (0, _builder.default)("WhileStatement", ...args); } -function AssignmentPattern() { - for (var _len50 = arguments.length, args = new Array(_len50), _key50 = 0; _key50 < _len50; _key50++) { - args[_key50] = arguments[_key50]; - } - - return _builder.default.apply(void 0, ["AssignmentPattern"].concat(args)); +function WithStatement(...args) { + return (0, _builder.default)("WithStatement", ...args); } -function ArrayPattern() { - for (var _len51 = arguments.length, args = new Array(_len51), _key51 = 0; _key51 < _len51; _key51++) { - args[_key51] = arguments[_key51]; - } - - return _builder.default.apply(void 0, ["ArrayPattern"].concat(args)); +function AssignmentPattern(...args) { + return (0, _builder.default)("AssignmentPattern", ...args); } -function ArrowFunctionExpression() { - for (var _len52 = arguments.length, args = new Array(_len52), _key52 = 0; _key52 < _len52; _key52++) { - args[_key52] = arguments[_key52]; - } - - return _builder.default.apply(void 0, ["ArrowFunctionExpression"].concat(args)); +function ArrayPattern(...args) { + return (0, _builder.default)("ArrayPattern", ...args); } -function ClassBody() { - for (var _len53 = arguments.length, args = new Array(_len53), _key53 = 0; _key53 < _len53; _key53++) { - args[_key53] = arguments[_key53]; - } - - return _builder.default.apply(void 0, ["ClassBody"].concat(args)); +function ArrowFunctionExpression(...args) { + return (0, _builder.default)("ArrowFunctionExpression", ...args); } -function ClassDeclaration() { - for (var _len54 = arguments.length, args = new Array(_len54), _key54 = 0; _key54 < _len54; _key54++) { - args[_key54] = arguments[_key54]; - } - - return _builder.default.apply(void 0, ["ClassDeclaration"].concat(args)); +function ClassBody(...args) { + return (0, _builder.default)("ClassBody", ...args); } -function ClassExpression() { - for (var _len55 = arguments.length, args = new Array(_len55), _key55 = 0; _key55 < _len55; _key55++) { - args[_key55] = arguments[_key55]; - } - - return _builder.default.apply(void 0, ["ClassExpression"].concat(args)); +function ClassDeclaration(...args) { + return (0, _builder.default)("ClassDeclaration", ...args); } -function ExportAllDeclaration() { - for (var _len56 = arguments.length, args = new Array(_len56), _key56 = 0; _key56 < _len56; _key56++) { - args[_key56] = arguments[_key56]; - } - - return _builder.default.apply(void 0, ["ExportAllDeclaration"].concat(args)); +function ClassExpression(...args) { + return (0, _builder.default)("ClassExpression", ...args); } -function ExportDefaultDeclaration() { - for (var _len57 = arguments.length, args = new Array(_len57), _key57 = 0; _key57 < _len57; _key57++) { - args[_key57] = arguments[_key57]; - } - - return _builder.default.apply(void 0, ["ExportDefaultDeclaration"].concat(args)); +function ExportAllDeclaration(...args) { + return (0, _builder.default)("ExportAllDeclaration", ...args); } -function ExportNamedDeclaration() { - for (var _len58 = arguments.length, args = new Array(_len58), _key58 = 0; _key58 < _len58; _key58++) { - args[_key58] = arguments[_key58]; - } - - return _builder.default.apply(void 0, ["ExportNamedDeclaration"].concat(args)); +function ExportDefaultDeclaration(...args) { + return (0, _builder.default)("ExportDefaultDeclaration", ...args); } -function ExportSpecifier() { - for (var _len59 = arguments.length, args = new Array(_len59), _key59 = 0; _key59 < _len59; _key59++) { - args[_key59] = arguments[_key59]; - } - - return _builder.default.apply(void 0, ["ExportSpecifier"].concat(args)); +function ExportNamedDeclaration(...args) { + return (0, _builder.default)("ExportNamedDeclaration", ...args); } -function ForOfStatement() { - for (var _len60 = arguments.length, args = new Array(_len60), _key60 = 0; _key60 < _len60; _key60++) { - args[_key60] = arguments[_key60]; - } - - return _builder.default.apply(void 0, ["ForOfStatement"].concat(args)); +function ExportSpecifier(...args) { + return (0, _builder.default)("ExportSpecifier", ...args); } -function ImportDeclaration() { - for (var _len61 = arguments.length, args = new Array(_len61), _key61 = 0; _key61 < _len61; _key61++) { - args[_key61] = arguments[_key61]; - } - - return _builder.default.apply(void 0, ["ImportDeclaration"].concat(args)); +function ForOfStatement(...args) { + return (0, _builder.default)("ForOfStatement", ...args); } -function ImportDefaultSpecifier() { - for (var _len62 = arguments.length, args = new Array(_len62), _key62 = 0; _key62 < _len62; _key62++) { - args[_key62] = arguments[_key62]; - } - - return _builder.default.apply(void 0, ["ImportDefaultSpecifier"].concat(args)); +function ImportDeclaration(...args) { + return (0, _builder.default)("ImportDeclaration", ...args); } -function ImportNamespaceSpecifier() { - for (var _len63 = arguments.length, args = new Array(_len63), _key63 = 0; _key63 < _len63; _key63++) { - args[_key63] = arguments[_key63]; - } - - return _builder.default.apply(void 0, ["ImportNamespaceSpecifier"].concat(args)); +function ImportDefaultSpecifier(...args) { + return (0, _builder.default)("ImportDefaultSpecifier", ...args); } -function ImportSpecifier() { - for (var _len64 = arguments.length, args = new Array(_len64), _key64 = 0; _key64 < _len64; _key64++) { - args[_key64] = arguments[_key64]; - } - - return _builder.default.apply(void 0, ["ImportSpecifier"].concat(args)); +function ImportNamespaceSpecifier(...args) { + return (0, _builder.default)("ImportNamespaceSpecifier", ...args); } -function MetaProperty() { - for (var _len65 = arguments.length, args = new Array(_len65), _key65 = 0; _key65 < _len65; _key65++) { - args[_key65] = arguments[_key65]; - } - - return _builder.default.apply(void 0, ["MetaProperty"].concat(args)); +function ImportSpecifier(...args) { + return (0, _builder.default)("ImportSpecifier", ...args); } -function ClassMethod() { - for (var _len66 = arguments.length, args = new Array(_len66), _key66 = 0; _key66 < _len66; _key66++) { - args[_key66] = arguments[_key66]; - } - - return _builder.default.apply(void 0, ["ClassMethod"].concat(args)); +function MetaProperty(...args) { + return (0, _builder.default)("MetaProperty", ...args); } -function ObjectPattern() { - for (var _len67 = arguments.length, args = new Array(_len67), _key67 = 0; _key67 < _len67; _key67++) { - args[_key67] = arguments[_key67]; - } - - return _builder.default.apply(void 0, ["ObjectPattern"].concat(args)); +function ClassMethod(...args) { + return (0, _builder.default)("ClassMethod", ...args); } -function SpreadElement() { - for (var _len68 = arguments.length, args = new Array(_len68), _key68 = 0; _key68 < _len68; _key68++) { - args[_key68] = arguments[_key68]; - } - - return _builder.default.apply(void 0, ["SpreadElement"].concat(args)); +function ObjectPattern(...args) { + return (0, _builder.default)("ObjectPattern", ...args); } -function Super() { - for (var _len69 = arguments.length, args = new Array(_len69), _key69 = 0; _key69 < _len69; _key69++) { - args[_key69] = arguments[_key69]; - } - - return _builder.default.apply(void 0, ["Super"].concat(args)); +function SpreadElement(...args) { + return (0, _builder.default)("SpreadElement", ...args); } -function TaggedTemplateExpression() { - for (var _len70 = arguments.length, args = new Array(_len70), _key70 = 0; _key70 < _len70; _key70++) { - args[_key70] = arguments[_key70]; - } - - return _builder.default.apply(void 0, ["TaggedTemplateExpression"].concat(args)); +function Super(...args) { + return (0, _builder.default)("Super", ...args); } -function TemplateElement() { - for (var _len71 = arguments.length, args = new Array(_len71), _key71 = 0; _key71 < _len71; _key71++) { - args[_key71] = arguments[_key71]; - } - - return _builder.default.apply(void 0, ["TemplateElement"].concat(args)); +function TaggedTemplateExpression(...args) { + return (0, _builder.default)("TaggedTemplateExpression", ...args); } -function TemplateLiteral() { - for (var _len72 = arguments.length, args = new Array(_len72), _key72 = 0; _key72 < _len72; _key72++) { - args[_key72] = arguments[_key72]; - } - - return _builder.default.apply(void 0, ["TemplateLiteral"].concat(args)); +function TemplateElement(...args) { + return (0, _builder.default)("TemplateElement", ...args); } -function YieldExpression() { - for (var _len73 = arguments.length, args = new Array(_len73), _key73 = 0; _key73 < _len73; _key73++) { - args[_key73] = arguments[_key73]; - } - - return _builder.default.apply(void 0, ["YieldExpression"].concat(args)); +function TemplateLiteral(...args) { + return (0, _builder.default)("TemplateLiteral", ...args); } -function AnyTypeAnnotation() { - for (var _len74 = arguments.length, args = new Array(_len74), _key74 = 0; _key74 < _len74; _key74++) { - args[_key74] = arguments[_key74]; - } - - return _builder.default.apply(void 0, ["AnyTypeAnnotation"].concat(args)); +function YieldExpression(...args) { + return (0, _builder.default)("YieldExpression", ...args); } -function ArrayTypeAnnotation() { - for (var _len75 = arguments.length, args = new Array(_len75), _key75 = 0; _key75 < _len75; _key75++) { - args[_key75] = arguments[_key75]; - } - - return _builder.default.apply(void 0, ["ArrayTypeAnnotation"].concat(args)); +function AnyTypeAnnotation(...args) { + return (0, _builder.default)("AnyTypeAnnotation", ...args); } -function BooleanTypeAnnotation() { - for (var _len76 = arguments.length, args = new Array(_len76), _key76 = 0; _key76 < _len76; _key76++) { - args[_key76] = arguments[_key76]; - } - - return _builder.default.apply(void 0, ["BooleanTypeAnnotation"].concat(args)); +function ArrayTypeAnnotation(...args) { + return (0, _builder.default)("ArrayTypeAnnotation", ...args); } -function BooleanLiteralTypeAnnotation() { - for (var _len77 = arguments.length, args = new Array(_len77), _key77 = 0; _key77 < _len77; _key77++) { - args[_key77] = arguments[_key77]; - } - - return _builder.default.apply(void 0, ["BooleanLiteralTypeAnnotation"].concat(args)); +function BooleanTypeAnnotation(...args) { + return (0, _builder.default)("BooleanTypeAnnotation", ...args); } -function NullLiteralTypeAnnotation() { - for (var _len78 = arguments.length, args = new Array(_len78), _key78 = 0; _key78 < _len78; _key78++) { - args[_key78] = arguments[_key78]; - } - - return _builder.default.apply(void 0, ["NullLiteralTypeAnnotation"].concat(args)); +function BooleanLiteralTypeAnnotation(...args) { + return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...args); } -function ClassImplements() { - for (var _len79 = arguments.length, args = new Array(_len79), _key79 = 0; _key79 < _len79; _key79++) { - args[_key79] = arguments[_key79]; - } - - return _builder.default.apply(void 0, ["ClassImplements"].concat(args)); +function NullLiteralTypeAnnotation(...args) { + return (0, _builder.default)("NullLiteralTypeAnnotation", ...args); } -function DeclareClass() { - for (var _len80 = arguments.length, args = new Array(_len80), _key80 = 0; _key80 < _len80; _key80++) { - args[_key80] = arguments[_key80]; - } - - return _builder.default.apply(void 0, ["DeclareClass"].concat(args)); +function ClassImplements(...args) { + return (0, _builder.default)("ClassImplements", ...args); } -function DeclareFunction() { - for (var _len81 = arguments.length, args = new Array(_len81), _key81 = 0; _key81 < _len81; _key81++) { - args[_key81] = arguments[_key81]; - } - - return _builder.default.apply(void 0, ["DeclareFunction"].concat(args)); +function DeclareClass(...args) { + return (0, _builder.default)("DeclareClass", ...args); } -function DeclareInterface() { - for (var _len82 = arguments.length, args = new Array(_len82), _key82 = 0; _key82 < _len82; _key82++) { - args[_key82] = arguments[_key82]; - } - - return _builder.default.apply(void 0, ["DeclareInterface"].concat(args)); +function DeclareFunction(...args) { + return (0, _builder.default)("DeclareFunction", ...args); } -function DeclareModule() { - for (var _len83 = arguments.length, args = new Array(_len83), _key83 = 0; _key83 < _len83; _key83++) { - args[_key83] = arguments[_key83]; - } - - return _builder.default.apply(void 0, ["DeclareModule"].concat(args)); +function DeclareInterface(...args) { + return (0, _builder.default)("DeclareInterface", ...args); } -function DeclareModuleExports() { - for (var _len84 = arguments.length, args = new Array(_len84), _key84 = 0; _key84 < _len84; _key84++) { - args[_key84] = arguments[_key84]; - } - - return _builder.default.apply(void 0, ["DeclareModuleExports"].concat(args)); +function DeclareModule(...args) { + return (0, _builder.default)("DeclareModule", ...args); } -function DeclareTypeAlias() { - for (var _len85 = arguments.length, args = new Array(_len85), _key85 = 0; _key85 < _len85; _key85++) { - args[_key85] = arguments[_key85]; - } - - return _builder.default.apply(void 0, ["DeclareTypeAlias"].concat(args)); +function DeclareModuleExports(...args) { + return (0, _builder.default)("DeclareModuleExports", ...args); } -function DeclareOpaqueType() { - for (var _len86 = arguments.length, args = new Array(_len86), _key86 = 0; _key86 < _len86; _key86++) { - args[_key86] = arguments[_key86]; - } - - return _builder.default.apply(void 0, ["DeclareOpaqueType"].concat(args)); +function DeclareTypeAlias(...args) { + return (0, _builder.default)("DeclareTypeAlias", ...args); } -function DeclareVariable() { - for (var _len87 = arguments.length, args = new Array(_len87), _key87 = 0; _key87 < _len87; _key87++) { - args[_key87] = arguments[_key87]; - } - - return _builder.default.apply(void 0, ["DeclareVariable"].concat(args)); +function DeclareOpaqueType(...args) { + return (0, _builder.default)("DeclareOpaqueType", ...args); } -function DeclareExportDeclaration() { - for (var _len88 = arguments.length, args = new Array(_len88), _key88 = 0; _key88 < _len88; _key88++) { - args[_key88] = arguments[_key88]; - } - - return _builder.default.apply(void 0, ["DeclareExportDeclaration"].concat(args)); +function DeclareVariable(...args) { + return (0, _builder.default)("DeclareVariable", ...args); } -function DeclareExportAllDeclaration() { - for (var _len89 = arguments.length, args = new Array(_len89), _key89 = 0; _key89 < _len89; _key89++) { - args[_key89] = arguments[_key89]; - } - - return _builder.default.apply(void 0, ["DeclareExportAllDeclaration"].concat(args)); +function DeclareExportDeclaration(...args) { + return (0, _builder.default)("DeclareExportDeclaration", ...args); } -function DeclaredPredicate() { - for (var _len90 = arguments.length, args = new Array(_len90), _key90 = 0; _key90 < _len90; _key90++) { - args[_key90] = arguments[_key90]; - } - - return _builder.default.apply(void 0, ["DeclaredPredicate"].concat(args)); +function DeclareExportAllDeclaration(...args) { + return (0, _builder.default)("DeclareExportAllDeclaration", ...args); } -function ExistsTypeAnnotation() { - for (var _len91 = arguments.length, args = new Array(_len91), _key91 = 0; _key91 < _len91; _key91++) { - args[_key91] = arguments[_key91]; - } - - return _builder.default.apply(void 0, ["ExistsTypeAnnotation"].concat(args)); +function DeclaredPredicate(...args) { + return (0, _builder.default)("DeclaredPredicate", ...args); } -function FunctionTypeAnnotation() { - for (var _len92 = arguments.length, args = new Array(_len92), _key92 = 0; _key92 < _len92; _key92++) { - args[_key92] = arguments[_key92]; - } - - return _builder.default.apply(void 0, ["FunctionTypeAnnotation"].concat(args)); +function ExistsTypeAnnotation(...args) { + return (0, _builder.default)("ExistsTypeAnnotation", ...args); } -function FunctionTypeParam() { - for (var _len93 = arguments.length, args = new Array(_len93), _key93 = 0; _key93 < _len93; _key93++) { - args[_key93] = arguments[_key93]; - } - - return _builder.default.apply(void 0, ["FunctionTypeParam"].concat(args)); +function FunctionTypeAnnotation(...args) { + return (0, _builder.default)("FunctionTypeAnnotation", ...args); } -function GenericTypeAnnotation() { - for (var _len94 = arguments.length, args = new Array(_len94), _key94 = 0; _key94 < _len94; _key94++) { - args[_key94] = arguments[_key94]; - } - - return _builder.default.apply(void 0, ["GenericTypeAnnotation"].concat(args)); +function FunctionTypeParam(...args) { + return (0, _builder.default)("FunctionTypeParam", ...args); } -function InferredPredicate() { - for (var _len95 = arguments.length, args = new Array(_len95), _key95 = 0; _key95 < _len95; _key95++) { - args[_key95] = arguments[_key95]; - } - - return _builder.default.apply(void 0, ["InferredPredicate"].concat(args)); +function GenericTypeAnnotation(...args) { + return (0, _builder.default)("GenericTypeAnnotation", ...args); } -function InterfaceExtends() { - for (var _len96 = arguments.length, args = new Array(_len96), _key96 = 0; _key96 < _len96; _key96++) { - args[_key96] = arguments[_key96]; - } - - return _builder.default.apply(void 0, ["InterfaceExtends"].concat(args)); +function InferredPredicate(...args) { + return (0, _builder.default)("InferredPredicate", ...args); } -function InterfaceDeclaration() { - for (var _len97 = arguments.length, args = new Array(_len97), _key97 = 0; _key97 < _len97; _key97++) { - args[_key97] = arguments[_key97]; - } - - return _builder.default.apply(void 0, ["InterfaceDeclaration"].concat(args)); +function InterfaceExtends(...args) { + return (0, _builder.default)("InterfaceExtends", ...args); } -function IntersectionTypeAnnotation() { - for (var _len98 = arguments.length, args = new Array(_len98), _key98 = 0; _key98 < _len98; _key98++) { - args[_key98] = arguments[_key98]; - } - - return _builder.default.apply(void 0, ["IntersectionTypeAnnotation"].concat(args)); +function InterfaceDeclaration(...args) { + return (0, _builder.default)("InterfaceDeclaration", ...args); } -function MixedTypeAnnotation() { - for (var _len99 = arguments.length, args = new Array(_len99), _key99 = 0; _key99 < _len99; _key99++) { - args[_key99] = arguments[_key99]; - } - - return _builder.default.apply(void 0, ["MixedTypeAnnotation"].concat(args)); +function InterfaceTypeAnnotation(...args) { + return (0, _builder.default)("InterfaceTypeAnnotation", ...args); } -function EmptyTypeAnnotation() { - for (var _len100 = arguments.length, args = new Array(_len100), _key100 = 0; _key100 < _len100; _key100++) { - args[_key100] = arguments[_key100]; - } - - return _builder.default.apply(void 0, ["EmptyTypeAnnotation"].concat(args)); +function IntersectionTypeAnnotation(...args) { + return (0, _builder.default)("IntersectionTypeAnnotation", ...args); } -function NullableTypeAnnotation() { - for (var _len101 = arguments.length, args = new Array(_len101), _key101 = 0; _key101 < _len101; _key101++) { - args[_key101] = arguments[_key101]; - } - - return _builder.default.apply(void 0, ["NullableTypeAnnotation"].concat(args)); +function MixedTypeAnnotation(...args) { + return (0, _builder.default)("MixedTypeAnnotation", ...args); } -function NumberLiteralTypeAnnotation() { - for (var _len102 = arguments.length, args = new Array(_len102), _key102 = 0; _key102 < _len102; _key102++) { - args[_key102] = arguments[_key102]; - } - - return _builder.default.apply(void 0, ["NumberLiteralTypeAnnotation"].concat(args)); +function EmptyTypeAnnotation(...args) { + return (0, _builder.default)("EmptyTypeAnnotation", ...args); } -function NumberTypeAnnotation() { - for (var _len103 = arguments.length, args = new Array(_len103), _key103 = 0; _key103 < _len103; _key103++) { - args[_key103] = arguments[_key103]; - } - - return _builder.default.apply(void 0, ["NumberTypeAnnotation"].concat(args)); +function NullableTypeAnnotation(...args) { + return (0, _builder.default)("NullableTypeAnnotation", ...args); } -function ObjectTypeAnnotation() { - for (var _len104 = arguments.length, args = new Array(_len104), _key104 = 0; _key104 < _len104; _key104++) { - args[_key104] = arguments[_key104]; - } - - return _builder.default.apply(void 0, ["ObjectTypeAnnotation"].concat(args)); +function NumberLiteralTypeAnnotation(...args) { + return (0, _builder.default)("NumberLiteralTypeAnnotation", ...args); } -function ObjectTypeCallProperty() { - for (var _len105 = arguments.length, args = new Array(_len105), _key105 = 0; _key105 < _len105; _key105++) { - args[_key105] = arguments[_key105]; - } - - return _builder.default.apply(void 0, ["ObjectTypeCallProperty"].concat(args)); +function NumberTypeAnnotation(...args) { + return (0, _builder.default)("NumberTypeAnnotation", ...args); } -function ObjectTypeIndexer() { - for (var _len106 = arguments.length, args = new Array(_len106), _key106 = 0; _key106 < _len106; _key106++) { - args[_key106] = arguments[_key106]; - } - - return _builder.default.apply(void 0, ["ObjectTypeIndexer"].concat(args)); +function ObjectTypeAnnotation(...args) { + return (0, _builder.default)("ObjectTypeAnnotation", ...args); } -function ObjectTypeProperty() { - for (var _len107 = arguments.length, args = new Array(_len107), _key107 = 0; _key107 < _len107; _key107++) { - args[_key107] = arguments[_key107]; - } - - return _builder.default.apply(void 0, ["ObjectTypeProperty"].concat(args)); +function ObjectTypeInternalSlot(...args) { + return (0, _builder.default)("ObjectTypeInternalSlot", ...args); } -function ObjectTypeSpreadProperty() { - for (var _len108 = arguments.length, args = new Array(_len108), _key108 = 0; _key108 < _len108; _key108++) { - args[_key108] = arguments[_key108]; - } - - return _builder.default.apply(void 0, ["ObjectTypeSpreadProperty"].concat(args)); +function ObjectTypeCallProperty(...args) { + return (0, _builder.default)("ObjectTypeCallProperty", ...args); } -function OpaqueType() { - for (var _len109 = arguments.length, args = new Array(_len109), _key109 = 0; _key109 < _len109; _key109++) { - args[_key109] = arguments[_key109]; - } - - return _builder.default.apply(void 0, ["OpaqueType"].concat(args)); +function ObjectTypeIndexer(...args) { + return (0, _builder.default)("ObjectTypeIndexer", ...args); } -function QualifiedTypeIdentifier() { - for (var _len110 = arguments.length, args = new Array(_len110), _key110 = 0; _key110 < _len110; _key110++) { - args[_key110] = arguments[_key110]; - } - - return _builder.default.apply(void 0, ["QualifiedTypeIdentifier"].concat(args)); +function ObjectTypeProperty(...args) { + return (0, _builder.default)("ObjectTypeProperty", ...args); } -function StringLiteralTypeAnnotation() { - for (var _len111 = arguments.length, args = new Array(_len111), _key111 = 0; _key111 < _len111; _key111++) { - args[_key111] = arguments[_key111]; - } - - return _builder.default.apply(void 0, ["StringLiteralTypeAnnotation"].concat(args)); +function ObjectTypeSpreadProperty(...args) { + return (0, _builder.default)("ObjectTypeSpreadProperty", ...args); } -function StringTypeAnnotation() { - for (var _len112 = arguments.length, args = new Array(_len112), _key112 = 0; _key112 < _len112; _key112++) { - args[_key112] = arguments[_key112]; - } - - return _builder.default.apply(void 0, ["StringTypeAnnotation"].concat(args)); +function OpaqueType(...args) { + return (0, _builder.default)("OpaqueType", ...args); } -function ThisTypeAnnotation() { - for (var _len113 = arguments.length, args = new Array(_len113), _key113 = 0; _key113 < _len113; _key113++) { - args[_key113] = arguments[_key113]; - } - - return _builder.default.apply(void 0, ["ThisTypeAnnotation"].concat(args)); +function QualifiedTypeIdentifier(...args) { + return (0, _builder.default)("QualifiedTypeIdentifier", ...args); } -function TupleTypeAnnotation() { - for (var _len114 = arguments.length, args = new Array(_len114), _key114 = 0; _key114 < _len114; _key114++) { - args[_key114] = arguments[_key114]; - } - - return _builder.default.apply(void 0, ["TupleTypeAnnotation"].concat(args)); +function StringLiteralTypeAnnotation(...args) { + return (0, _builder.default)("StringLiteralTypeAnnotation", ...args); } -function TypeofTypeAnnotation() { - for (var _len115 = arguments.length, args = new Array(_len115), _key115 = 0; _key115 < _len115; _key115++) { - args[_key115] = arguments[_key115]; - } - - return _builder.default.apply(void 0, ["TypeofTypeAnnotation"].concat(args)); +function StringTypeAnnotation(...args) { + return (0, _builder.default)("StringTypeAnnotation", ...args); } -function TypeAlias() { - for (var _len116 = arguments.length, args = new Array(_len116), _key116 = 0; _key116 < _len116; _key116++) { - args[_key116] = arguments[_key116]; - } - - return _builder.default.apply(void 0, ["TypeAlias"].concat(args)); +function ThisTypeAnnotation(...args) { + return (0, _builder.default)("ThisTypeAnnotation", ...args); } -function TypeAnnotation() { - for (var _len117 = arguments.length, args = new Array(_len117), _key117 = 0; _key117 < _len117; _key117++) { - args[_key117] = arguments[_key117]; - } - - return _builder.default.apply(void 0, ["TypeAnnotation"].concat(args)); +function TupleTypeAnnotation(...args) { + return (0, _builder.default)("TupleTypeAnnotation", ...args); } -function TypeCastExpression() { - for (var _len118 = arguments.length, args = new Array(_len118), _key118 = 0; _key118 < _len118; _key118++) { - args[_key118] = arguments[_key118]; - } - - return _builder.default.apply(void 0, ["TypeCastExpression"].concat(args)); +function TypeofTypeAnnotation(...args) { + return (0, _builder.default)("TypeofTypeAnnotation", ...args); } -function TypeParameter() { - for (var _len119 = arguments.length, args = new Array(_len119), _key119 = 0; _key119 < _len119; _key119++) { - args[_key119] = arguments[_key119]; - } - - return _builder.default.apply(void 0, ["TypeParameter"].concat(args)); +function TypeAlias(...args) { + return (0, _builder.default)("TypeAlias", ...args); } -function TypeParameterDeclaration() { - for (var _len120 = arguments.length, args = new Array(_len120), _key120 = 0; _key120 < _len120; _key120++) { - args[_key120] = arguments[_key120]; - } - - return _builder.default.apply(void 0, ["TypeParameterDeclaration"].concat(args)); +function TypeAnnotation(...args) { + return (0, _builder.default)("TypeAnnotation", ...args); } -function TypeParameterInstantiation() { - for (var _len121 = arguments.length, args = new Array(_len121), _key121 = 0; _key121 < _len121; _key121++) { - args[_key121] = arguments[_key121]; - } - - return _builder.default.apply(void 0, ["TypeParameterInstantiation"].concat(args)); +function TypeCastExpression(...args) { + return (0, _builder.default)("TypeCastExpression", ...args); } -function UnionTypeAnnotation() { - for (var _len122 = arguments.length, args = new Array(_len122), _key122 = 0; _key122 < _len122; _key122++) { - args[_key122] = arguments[_key122]; - } - - return _builder.default.apply(void 0, ["UnionTypeAnnotation"].concat(args)); +function TypeParameter(...args) { + return (0, _builder.default)("TypeParameter", ...args); } -function VoidTypeAnnotation() { - for (var _len123 = arguments.length, args = new Array(_len123), _key123 = 0; _key123 < _len123; _key123++) { - args[_key123] = arguments[_key123]; - } - - return _builder.default.apply(void 0, ["VoidTypeAnnotation"].concat(args)); +function TypeParameterDeclaration(...args) { + return (0, _builder.default)("TypeParameterDeclaration", ...args); } -function JSXAttribute() { - for (var _len124 = arguments.length, args = new Array(_len124), _key124 = 0; _key124 < _len124; _key124++) { - args[_key124] = arguments[_key124]; - } - - return _builder.default.apply(void 0, ["JSXAttribute"].concat(args)); +function TypeParameterInstantiation(...args) { + return (0, _builder.default)("TypeParameterInstantiation", ...args); } -function JSXClosingElement() { - for (var _len125 = arguments.length, args = new Array(_len125), _key125 = 0; _key125 < _len125; _key125++) { - args[_key125] = arguments[_key125]; - } - - return _builder.default.apply(void 0, ["JSXClosingElement"].concat(args)); +function UnionTypeAnnotation(...args) { + return (0, _builder.default)("UnionTypeAnnotation", ...args); } -function JSXElement() { - for (var _len126 = arguments.length, args = new Array(_len126), _key126 = 0; _key126 < _len126; _key126++) { - args[_key126] = arguments[_key126]; - } - - return _builder.default.apply(void 0, ["JSXElement"].concat(args)); +function Variance(...args) { + return (0, _builder.default)("Variance", ...args); } -function JSXEmptyExpression() { - for (var _len127 = arguments.length, args = new Array(_len127), _key127 = 0; _key127 < _len127; _key127++) { - args[_key127] = arguments[_key127]; - } - - return _builder.default.apply(void 0, ["JSXEmptyExpression"].concat(args)); +function VoidTypeAnnotation(...args) { + return (0, _builder.default)("VoidTypeAnnotation", ...args); } -function JSXExpressionContainer() { - for (var _len128 = arguments.length, args = new Array(_len128), _key128 = 0; _key128 < _len128; _key128++) { - args[_key128] = arguments[_key128]; - } - - return _builder.default.apply(void 0, ["JSXExpressionContainer"].concat(args)); +function JSXAttribute(...args) { + return (0, _builder.default)("JSXAttribute", ...args); } -function JSXSpreadChild() { - for (var _len129 = arguments.length, args = new Array(_len129), _key129 = 0; _key129 < _len129; _key129++) { - args[_key129] = arguments[_key129]; - } - - return _builder.default.apply(void 0, ["JSXSpreadChild"].concat(args)); +function JSXClosingElement(...args) { + return (0, _builder.default)("JSXClosingElement", ...args); } -function JSXIdentifier() { - for (var _len130 = arguments.length, args = new Array(_len130), _key130 = 0; _key130 < _len130; _key130++) { - args[_key130] = arguments[_key130]; - } - - return _builder.default.apply(void 0, ["JSXIdentifier"].concat(args)); +function JSXElement(...args) { + return (0, _builder.default)("JSXElement", ...args); } -function JSXMemberExpression() { - for (var _len131 = arguments.length, args = new Array(_len131), _key131 = 0; _key131 < _len131; _key131++) { - args[_key131] = arguments[_key131]; - } - - return _builder.default.apply(void 0, ["JSXMemberExpression"].concat(args)); +function JSXEmptyExpression(...args) { + return (0, _builder.default)("JSXEmptyExpression", ...args); } -function JSXNamespacedName() { - for (var _len132 = arguments.length, args = new Array(_len132), _key132 = 0; _key132 < _len132; _key132++) { - args[_key132] = arguments[_key132]; - } - - return _builder.default.apply(void 0, ["JSXNamespacedName"].concat(args)); +function JSXExpressionContainer(...args) { + return (0, _builder.default)("JSXExpressionContainer", ...args); } -function JSXOpeningElement() { - for (var _len133 = arguments.length, args = new Array(_len133), _key133 = 0; _key133 < _len133; _key133++) { - args[_key133] = arguments[_key133]; - } - - return _builder.default.apply(void 0, ["JSXOpeningElement"].concat(args)); +function JSXSpreadChild(...args) { + return (0, _builder.default)("JSXSpreadChild", ...args); } -function JSXSpreadAttribute() { - for (var _len134 = arguments.length, args = new Array(_len134), _key134 = 0; _key134 < _len134; _key134++) { - args[_key134] = arguments[_key134]; - } - - return _builder.default.apply(void 0, ["JSXSpreadAttribute"].concat(args)); +function JSXIdentifier(...args) { + return (0, _builder.default)("JSXIdentifier", ...args); } -function JSXText() { - for (var _len135 = arguments.length, args = new Array(_len135), _key135 = 0; _key135 < _len135; _key135++) { - args[_key135] = arguments[_key135]; - } - - return _builder.default.apply(void 0, ["JSXText"].concat(args)); +function JSXMemberExpression(...args) { + return (0, _builder.default)("JSXMemberExpression", ...args); } -function JSXFragment() { - for (var _len136 = arguments.length, args = new Array(_len136), _key136 = 0; _key136 < _len136; _key136++) { - args[_key136] = arguments[_key136]; - } - - return _builder.default.apply(void 0, ["JSXFragment"].concat(args)); +function JSXNamespacedName(...args) { + return (0, _builder.default)("JSXNamespacedName", ...args); } -function JSXOpeningFragment() { - for (var _len137 = arguments.length, args = new Array(_len137), _key137 = 0; _key137 < _len137; _key137++) { - args[_key137] = arguments[_key137]; - } - - return _builder.default.apply(void 0, ["JSXOpeningFragment"].concat(args)); +function JSXOpeningElement(...args) { + return (0, _builder.default)("JSXOpeningElement", ...args); } -function JSXClosingFragment() { - for (var _len138 = arguments.length, args = new Array(_len138), _key138 = 0; _key138 < _len138; _key138++) { - args[_key138] = arguments[_key138]; - } - - return _builder.default.apply(void 0, ["JSXClosingFragment"].concat(args)); +function JSXSpreadAttribute(...args) { + return (0, _builder.default)("JSXSpreadAttribute", ...args); } -function Noop() { - for (var _len139 = arguments.length, args = new Array(_len139), _key139 = 0; _key139 < _len139; _key139++) { - args[_key139] = arguments[_key139]; - } - - return _builder.default.apply(void 0, ["Noop"].concat(args)); +function JSXText(...args) { + return (0, _builder.default)("JSXText", ...args); } -function ParenthesizedExpression() { - for (var _len140 = arguments.length, args = new Array(_len140), _key140 = 0; _key140 < _len140; _key140++) { - args[_key140] = arguments[_key140]; - } - - return _builder.default.apply(void 0, ["ParenthesizedExpression"].concat(args)); +function JSXFragment(...args) { + return (0, _builder.default)("JSXFragment", ...args); } -function AwaitExpression() { - for (var _len141 = arguments.length, args = new Array(_len141), _key141 = 0; _key141 < _len141; _key141++) { - args[_key141] = arguments[_key141]; - } - - return _builder.default.apply(void 0, ["AwaitExpression"].concat(args)); +function JSXOpeningFragment(...args) { + return (0, _builder.default)("JSXOpeningFragment", ...args); } -function BindExpression() { - for (var _len142 = arguments.length, args = new Array(_len142), _key142 = 0; _key142 < _len142; _key142++) { - args[_key142] = arguments[_key142]; - } - - return _builder.default.apply(void 0, ["BindExpression"].concat(args)); +function JSXClosingFragment(...args) { + return (0, _builder.default)("JSXClosingFragment", ...args); } -function ClassProperty() { - for (var _len143 = arguments.length, args = new Array(_len143), _key143 = 0; _key143 < _len143; _key143++) { - args[_key143] = arguments[_key143]; - } - - return _builder.default.apply(void 0, ["ClassProperty"].concat(args)); +function Noop(...args) { + return (0, _builder.default)("Noop", ...args); } -function Import() { - for (var _len144 = arguments.length, args = new Array(_len144), _key144 = 0; _key144 < _len144; _key144++) { - args[_key144] = arguments[_key144]; - } - - return _builder.default.apply(void 0, ["Import"].concat(args)); +function ParenthesizedExpression(...args) { + return (0, _builder.default)("ParenthesizedExpression", ...args); } -function Decorator() { - for (var _len145 = arguments.length, args = new Array(_len145), _key145 = 0; _key145 < _len145; _key145++) { - args[_key145] = arguments[_key145]; - } - - return _builder.default.apply(void 0, ["Decorator"].concat(args)); +function AwaitExpression(...args) { + return (0, _builder.default)("AwaitExpression", ...args); } -function DoExpression() { - for (var _len146 = arguments.length, args = new Array(_len146), _key146 = 0; _key146 < _len146; _key146++) { - args[_key146] = arguments[_key146]; - } - - return _builder.default.apply(void 0, ["DoExpression"].concat(args)); +function BindExpression(...args) { + return (0, _builder.default)("BindExpression", ...args); } -function ExportDefaultSpecifier() { - for (var _len147 = arguments.length, args = new Array(_len147), _key147 = 0; _key147 < _len147; _key147++) { - args[_key147] = arguments[_key147]; - } - - return _builder.default.apply(void 0, ["ExportDefaultSpecifier"].concat(args)); +function ClassProperty(...args) { + return (0, _builder.default)("ClassProperty", ...args); } -function ExportNamespaceSpecifier() { - for (var _len148 = arguments.length, args = new Array(_len148), _key148 = 0; _key148 < _len148; _key148++) { - args[_key148] = arguments[_key148]; - } - - return _builder.default.apply(void 0, ["ExportNamespaceSpecifier"].concat(args)); +function OptionalMemberExpression(...args) { + return (0, _builder.default)("OptionalMemberExpression", ...args); } -function TSParameterProperty() { - for (var _len149 = arguments.length, args = new Array(_len149), _key149 = 0; _key149 < _len149; _key149++) { - args[_key149] = arguments[_key149]; - } - - return _builder.default.apply(void 0, ["TSParameterProperty"].concat(args)); +function PipelineTopicExpression(...args) { + return (0, _builder.default)("PipelineTopicExpression", ...args); } -function TSDeclareFunction() { - for (var _len150 = arguments.length, args = new Array(_len150), _key150 = 0; _key150 < _len150; _key150++) { - args[_key150] = arguments[_key150]; - } - - return _builder.default.apply(void 0, ["TSDeclareFunction"].concat(args)); +function PipelineBareFunction(...args) { + return (0, _builder.default)("PipelineBareFunction", ...args); } -function TSDeclareMethod() { - for (var _len151 = arguments.length, args = new Array(_len151), _key151 = 0; _key151 < _len151; _key151++) { - args[_key151] = arguments[_key151]; - } - - return _builder.default.apply(void 0, ["TSDeclareMethod"].concat(args)); +function PipelinePrimaryTopicReference(...args) { + return (0, _builder.default)("PipelinePrimaryTopicReference", ...args); } -function TSQualifiedName() { - for (var _len152 = arguments.length, args = new Array(_len152), _key152 = 0; _key152 < _len152; _key152++) { - args[_key152] = arguments[_key152]; - } - - return _builder.default.apply(void 0, ["TSQualifiedName"].concat(args)); +function OptionalCallExpression(...args) { + return (0, _builder.default)("OptionalCallExpression", ...args); } -function TSCallSignatureDeclaration() { - for (var _len153 = arguments.length, args = new Array(_len153), _key153 = 0; _key153 < _len153; _key153++) { - args[_key153] = arguments[_key153]; - } - - return _builder.default.apply(void 0, ["TSCallSignatureDeclaration"].concat(args)); +function ClassPrivateProperty(...args) { + return (0, _builder.default)("ClassPrivateProperty", ...args); } -function TSConstructSignatureDeclaration() { - for (var _len154 = arguments.length, args = new Array(_len154), _key154 = 0; _key154 < _len154; _key154++) { - args[_key154] = arguments[_key154]; - } - - return _builder.default.apply(void 0, ["TSConstructSignatureDeclaration"].concat(args)); +function ClassPrivateMethod(...args) { + return (0, _builder.default)("ClassPrivateMethod", ...args); } -function TSPropertySignature() { - for (var _len155 = arguments.length, args = new Array(_len155), _key155 = 0; _key155 < _len155; _key155++) { - args[_key155] = arguments[_key155]; - } - - return _builder.default.apply(void 0, ["TSPropertySignature"].concat(args)); +function Import(...args) { + return (0, _builder.default)("Import", ...args); } -function TSMethodSignature() { - for (var _len156 = arguments.length, args = new Array(_len156), _key156 = 0; _key156 < _len156; _key156++) { - args[_key156] = arguments[_key156]; - } - - return _builder.default.apply(void 0, ["TSMethodSignature"].concat(args)); +function Decorator(...args) { + return (0, _builder.default)("Decorator", ...args); } -function TSIndexSignature() { - for (var _len157 = arguments.length, args = new Array(_len157), _key157 = 0; _key157 < _len157; _key157++) { - args[_key157] = arguments[_key157]; - } - - return _builder.default.apply(void 0, ["TSIndexSignature"].concat(args)); +function DoExpression(...args) { + return (0, _builder.default)("DoExpression", ...args); } -function TSAnyKeyword() { - for (var _len158 = arguments.length, args = new Array(_len158), _key158 = 0; _key158 < _len158; _key158++) { - args[_key158] = arguments[_key158]; - } - - return _builder.default.apply(void 0, ["TSAnyKeyword"].concat(args)); +function ExportDefaultSpecifier(...args) { + return (0, _builder.default)("ExportDefaultSpecifier", ...args); } -function TSNumberKeyword() { - for (var _len159 = arguments.length, args = new Array(_len159), _key159 = 0; _key159 < _len159; _key159++) { - args[_key159] = arguments[_key159]; - } - - return _builder.default.apply(void 0, ["TSNumberKeyword"].concat(args)); +function ExportNamespaceSpecifier(...args) { + return (0, _builder.default)("ExportNamespaceSpecifier", ...args); } -function TSObjectKeyword() { - for (var _len160 = arguments.length, args = new Array(_len160), _key160 = 0; _key160 < _len160; _key160++) { - args[_key160] = arguments[_key160]; - } - - return _builder.default.apply(void 0, ["TSObjectKeyword"].concat(args)); +function PrivateName(...args) { + return (0, _builder.default)("PrivateName", ...args); } -function TSBooleanKeyword() { - for (var _len161 = arguments.length, args = new Array(_len161), _key161 = 0; _key161 < _len161; _key161++) { - args[_key161] = arguments[_key161]; - } - - return _builder.default.apply(void 0, ["TSBooleanKeyword"].concat(args)); +function BigIntLiteral(...args) { + return (0, _builder.default)("BigIntLiteral", ...args); } -function TSStringKeyword() { - for (var _len162 = arguments.length, args = new Array(_len162), _key162 = 0; _key162 < _len162; _key162++) { - args[_key162] = arguments[_key162]; - } - - return _builder.default.apply(void 0, ["TSStringKeyword"].concat(args)); +function TSParameterProperty(...args) { + return (0, _builder.default)("TSParameterProperty", ...args); } -function TSSymbolKeyword() { - for (var _len163 = arguments.length, args = new Array(_len163), _key163 = 0; _key163 < _len163; _key163++) { - args[_key163] = arguments[_key163]; - } - - return _builder.default.apply(void 0, ["TSSymbolKeyword"].concat(args)); +function TSDeclareFunction(...args) { + return (0, _builder.default)("TSDeclareFunction", ...args); } -function TSVoidKeyword() { - for (var _len164 = arguments.length, args = new Array(_len164), _key164 = 0; _key164 < _len164; _key164++) { - args[_key164] = arguments[_key164]; - } - - return _builder.default.apply(void 0, ["TSVoidKeyword"].concat(args)); +function TSDeclareMethod(...args) { + return (0, _builder.default)("TSDeclareMethod", ...args); } -function TSUndefinedKeyword() { - for (var _len165 = arguments.length, args = new Array(_len165), _key165 = 0; _key165 < _len165; _key165++) { - args[_key165] = arguments[_key165]; - } - - return _builder.default.apply(void 0, ["TSUndefinedKeyword"].concat(args)); +function TSQualifiedName(...args) { + return (0, _builder.default)("TSQualifiedName", ...args); } -function TSNullKeyword() { - for (var _len166 = arguments.length, args = new Array(_len166), _key166 = 0; _key166 < _len166; _key166++) { - args[_key166] = arguments[_key166]; - } - - return _builder.default.apply(void 0, ["TSNullKeyword"].concat(args)); +function TSCallSignatureDeclaration(...args) { + return (0, _builder.default)("TSCallSignatureDeclaration", ...args); } -function TSNeverKeyword() { - for (var _len167 = arguments.length, args = new Array(_len167), _key167 = 0; _key167 < _len167; _key167++) { - args[_key167] = arguments[_key167]; - } - - return _builder.default.apply(void 0, ["TSNeverKeyword"].concat(args)); +function TSConstructSignatureDeclaration(...args) { + return (0, _builder.default)("TSConstructSignatureDeclaration", ...args); } -function TSThisType() { - for (var _len168 = arguments.length, args = new Array(_len168), _key168 = 0; _key168 < _len168; _key168++) { - args[_key168] = arguments[_key168]; - } - - return _builder.default.apply(void 0, ["TSThisType"].concat(args)); +function TSPropertySignature(...args) { + return (0, _builder.default)("TSPropertySignature", ...args); } -function TSFunctionType() { - for (var _len169 = arguments.length, args = new Array(_len169), _key169 = 0; _key169 < _len169; _key169++) { - args[_key169] = arguments[_key169]; - } - - return _builder.default.apply(void 0, ["TSFunctionType"].concat(args)); +function TSMethodSignature(...args) { + return (0, _builder.default)("TSMethodSignature", ...args); } -function TSConstructorType() { - for (var _len170 = arguments.length, args = new Array(_len170), _key170 = 0; _key170 < _len170; _key170++) { - args[_key170] = arguments[_key170]; - } - - return _builder.default.apply(void 0, ["TSConstructorType"].concat(args)); +function TSIndexSignature(...args) { + return (0, _builder.default)("TSIndexSignature", ...args); } -function TSTypeReference() { - for (var _len171 = arguments.length, args = new Array(_len171), _key171 = 0; _key171 < _len171; _key171++) { - args[_key171] = arguments[_key171]; - } - - return _builder.default.apply(void 0, ["TSTypeReference"].concat(args)); +function TSAnyKeyword(...args) { + return (0, _builder.default)("TSAnyKeyword", ...args); } -function TSTypePredicate() { - for (var _len172 = arguments.length, args = new Array(_len172), _key172 = 0; _key172 < _len172; _key172++) { - args[_key172] = arguments[_key172]; - } - - return _builder.default.apply(void 0, ["TSTypePredicate"].concat(args)); +function TSUnknownKeyword(...args) { + return (0, _builder.default)("TSUnknownKeyword", ...args); } -function TSTypeQuery() { - for (var _len173 = arguments.length, args = new Array(_len173), _key173 = 0; _key173 < _len173; _key173++) { - args[_key173] = arguments[_key173]; - } - - return _builder.default.apply(void 0, ["TSTypeQuery"].concat(args)); +function TSNumberKeyword(...args) { + return (0, _builder.default)("TSNumberKeyword", ...args); } -function TSTypeLiteral() { - for (var _len174 = arguments.length, args = new Array(_len174), _key174 = 0; _key174 < _len174; _key174++) { - args[_key174] = arguments[_key174]; - } - - return _builder.default.apply(void 0, ["TSTypeLiteral"].concat(args)); +function TSObjectKeyword(...args) { + return (0, _builder.default)("TSObjectKeyword", ...args); } -function TSArrayType() { - for (var _len175 = arguments.length, args = new Array(_len175), _key175 = 0; _key175 < _len175; _key175++) { - args[_key175] = arguments[_key175]; - } - - return _builder.default.apply(void 0, ["TSArrayType"].concat(args)); +function TSBooleanKeyword(...args) { + return (0, _builder.default)("TSBooleanKeyword", ...args); } -function TSTupleType() { - for (var _len176 = arguments.length, args = new Array(_len176), _key176 = 0; _key176 < _len176; _key176++) { - args[_key176] = arguments[_key176]; - } - - return _builder.default.apply(void 0, ["TSTupleType"].concat(args)); +function TSStringKeyword(...args) { + return (0, _builder.default)("TSStringKeyword", ...args); } -function TSUnionType() { - for (var _len177 = arguments.length, args = new Array(_len177), _key177 = 0; _key177 < _len177; _key177++) { - args[_key177] = arguments[_key177]; - } - - return _builder.default.apply(void 0, ["TSUnionType"].concat(args)); +function TSSymbolKeyword(...args) { + return (0, _builder.default)("TSSymbolKeyword", ...args); } -function TSIntersectionType() { - for (var _len178 = arguments.length, args = new Array(_len178), _key178 = 0; _key178 < _len178; _key178++) { - args[_key178] = arguments[_key178]; - } - - return _builder.default.apply(void 0, ["TSIntersectionType"].concat(args)); +function TSVoidKeyword(...args) { + return (0, _builder.default)("TSVoidKeyword", ...args); } -function TSParenthesizedType() { - for (var _len179 = arguments.length, args = new Array(_len179), _key179 = 0; _key179 < _len179; _key179++) { - args[_key179] = arguments[_key179]; - } - - return _builder.default.apply(void 0, ["TSParenthesizedType"].concat(args)); +function TSUndefinedKeyword(...args) { + return (0, _builder.default)("TSUndefinedKeyword", ...args); } -function TSTypeOperator() { - for (var _len180 = arguments.length, args = new Array(_len180), _key180 = 0; _key180 < _len180; _key180++) { - args[_key180] = arguments[_key180]; - } - - return _builder.default.apply(void 0, ["TSTypeOperator"].concat(args)); +function TSNullKeyword(...args) { + return (0, _builder.default)("TSNullKeyword", ...args); } -function TSIndexedAccessType() { - for (var _len181 = arguments.length, args = new Array(_len181), _key181 = 0; _key181 < _len181; _key181++) { - args[_key181] = arguments[_key181]; - } - - return _builder.default.apply(void 0, ["TSIndexedAccessType"].concat(args)); +function TSNeverKeyword(...args) { + return (0, _builder.default)("TSNeverKeyword", ...args); } -function TSMappedType() { - for (var _len182 = arguments.length, args = new Array(_len182), _key182 = 0; _key182 < _len182; _key182++) { - args[_key182] = arguments[_key182]; - } - - return _builder.default.apply(void 0, ["TSMappedType"].concat(args)); +function TSThisType(...args) { + return (0, _builder.default)("TSThisType", ...args); } -function TSLiteralType() { - for (var _len183 = arguments.length, args = new Array(_len183), _key183 = 0; _key183 < _len183; _key183++) { - args[_key183] = arguments[_key183]; - } - - return _builder.default.apply(void 0, ["TSLiteralType"].concat(args)); +function TSFunctionType(...args) { + return (0, _builder.default)("TSFunctionType", ...args); } -function TSExpressionWithTypeArguments() { - for (var _len184 = arguments.length, args = new Array(_len184), _key184 = 0; _key184 < _len184; _key184++) { - args[_key184] = arguments[_key184]; - } +function TSConstructorType(...args) { + return (0, _builder.default)("TSConstructorType", ...args); +} - return _builder.default.apply(void 0, ["TSExpressionWithTypeArguments"].concat(args)); +function TSTypeReference(...args) { + return (0, _builder.default)("TSTypeReference", ...args); } -function TSInterfaceDeclaration() { - for (var _len185 = arguments.length, args = new Array(_len185), _key185 = 0; _key185 < _len185; _key185++) { - args[_key185] = arguments[_key185]; - } +function TSTypePredicate(...args) { + return (0, _builder.default)("TSTypePredicate", ...args); +} - return _builder.default.apply(void 0, ["TSInterfaceDeclaration"].concat(args)); +function TSTypeQuery(...args) { + return (0, _builder.default)("TSTypeQuery", ...args); } -function TSInterfaceBody() { - for (var _len186 = arguments.length, args = new Array(_len186), _key186 = 0; _key186 < _len186; _key186++) { - args[_key186] = arguments[_key186]; - } +function TSTypeLiteral(...args) { + return (0, _builder.default)("TSTypeLiteral", ...args); +} - return _builder.default.apply(void 0, ["TSInterfaceBody"].concat(args)); +function TSArrayType(...args) { + return (0, _builder.default)("TSArrayType", ...args); } -function TSTypeAliasDeclaration() { - for (var _len187 = arguments.length, args = new Array(_len187), _key187 = 0; _key187 < _len187; _key187++) { - args[_key187] = arguments[_key187]; - } +function TSTupleType(...args) { + return (0, _builder.default)("TSTupleType", ...args); +} - return _builder.default.apply(void 0, ["TSTypeAliasDeclaration"].concat(args)); +function TSOptionalType(...args) { + return (0, _builder.default)("TSOptionalType", ...args); } -function TSAsExpression() { - for (var _len188 = arguments.length, args = new Array(_len188), _key188 = 0; _key188 < _len188; _key188++) { - args[_key188] = arguments[_key188]; - } +function TSRestType(...args) { + return (0, _builder.default)("TSRestType", ...args); +} - return _builder.default.apply(void 0, ["TSAsExpression"].concat(args)); +function TSUnionType(...args) { + return (0, _builder.default)("TSUnionType", ...args); } -function TSTypeAssertion() { - for (var _len189 = arguments.length, args = new Array(_len189), _key189 = 0; _key189 < _len189; _key189++) { - args[_key189] = arguments[_key189]; - } +function TSIntersectionType(...args) { + return (0, _builder.default)("TSIntersectionType", ...args); +} - return _builder.default.apply(void 0, ["TSTypeAssertion"].concat(args)); +function TSConditionalType(...args) { + return (0, _builder.default)("TSConditionalType", ...args); } -function TSEnumDeclaration() { - for (var _len190 = arguments.length, args = new Array(_len190), _key190 = 0; _key190 < _len190; _key190++) { - args[_key190] = arguments[_key190]; - } +function TSInferType(...args) { + return (0, _builder.default)("TSInferType", ...args); +} - return _builder.default.apply(void 0, ["TSEnumDeclaration"].concat(args)); +function TSParenthesizedType(...args) { + return (0, _builder.default)("TSParenthesizedType", ...args); } -function TSEnumMember() { - for (var _len191 = arguments.length, args = new Array(_len191), _key191 = 0; _key191 < _len191; _key191++) { - args[_key191] = arguments[_key191]; - } +function TSTypeOperator(...args) { + return (0, _builder.default)("TSTypeOperator", ...args); +} - return _builder.default.apply(void 0, ["TSEnumMember"].concat(args)); +function TSIndexedAccessType(...args) { + return (0, _builder.default)("TSIndexedAccessType", ...args); } -function TSModuleDeclaration() { - for (var _len192 = arguments.length, args = new Array(_len192), _key192 = 0; _key192 < _len192; _key192++) { - args[_key192] = arguments[_key192]; - } +function TSMappedType(...args) { + return (0, _builder.default)("TSMappedType", ...args); +} - return _builder.default.apply(void 0, ["TSModuleDeclaration"].concat(args)); +function TSLiteralType(...args) { + return (0, _builder.default)("TSLiteralType", ...args); } -function TSModuleBlock() { - for (var _len193 = arguments.length, args = new Array(_len193), _key193 = 0; _key193 < _len193; _key193++) { - args[_key193] = arguments[_key193]; - } +function TSExpressionWithTypeArguments(...args) { + return (0, _builder.default)("TSExpressionWithTypeArguments", ...args); +} - return _builder.default.apply(void 0, ["TSModuleBlock"].concat(args)); +function TSInterfaceDeclaration(...args) { + return (0, _builder.default)("TSInterfaceDeclaration", ...args); } -function TSImportEqualsDeclaration() { - for (var _len194 = arguments.length, args = new Array(_len194), _key194 = 0; _key194 < _len194; _key194++) { - args[_key194] = arguments[_key194]; - } +function TSInterfaceBody(...args) { + return (0, _builder.default)("TSInterfaceBody", ...args); +} - return _builder.default.apply(void 0, ["TSImportEqualsDeclaration"].concat(args)); +function TSTypeAliasDeclaration(...args) { + return (0, _builder.default)("TSTypeAliasDeclaration", ...args); } -function TSExternalModuleReference() { - for (var _len195 = arguments.length, args = new Array(_len195), _key195 = 0; _key195 < _len195; _key195++) { - args[_key195] = arguments[_key195]; - } +function TSAsExpression(...args) { + return (0, _builder.default)("TSAsExpression", ...args); +} - return _builder.default.apply(void 0, ["TSExternalModuleReference"].concat(args)); +function TSTypeAssertion(...args) { + return (0, _builder.default)("TSTypeAssertion", ...args); } -function TSNonNullExpression() { - for (var _len196 = arguments.length, args = new Array(_len196), _key196 = 0; _key196 < _len196; _key196++) { - args[_key196] = arguments[_key196]; - } +function TSEnumDeclaration(...args) { + return (0, _builder.default)("TSEnumDeclaration", ...args); +} - return _builder.default.apply(void 0, ["TSNonNullExpression"].concat(args)); +function TSEnumMember(...args) { + return (0, _builder.default)("TSEnumMember", ...args); } -function TSExportAssignment() { - for (var _len197 = arguments.length, args = new Array(_len197), _key197 = 0; _key197 < _len197; _key197++) { - args[_key197] = arguments[_key197]; - } +function TSModuleDeclaration(...args) { + return (0, _builder.default)("TSModuleDeclaration", ...args); +} - return _builder.default.apply(void 0, ["TSExportAssignment"].concat(args)); +function TSModuleBlock(...args) { + return (0, _builder.default)("TSModuleBlock", ...args); } -function TSNamespaceExportDeclaration() { - for (var _len198 = arguments.length, args = new Array(_len198), _key198 = 0; _key198 < _len198; _key198++) { - args[_key198] = arguments[_key198]; - } +function TSImportType(...args) { + return (0, _builder.default)("TSImportType", ...args); +} - return _builder.default.apply(void 0, ["TSNamespaceExportDeclaration"].concat(args)); +function TSImportEqualsDeclaration(...args) { + return (0, _builder.default)("TSImportEqualsDeclaration", ...args); } -function TSTypeAnnotation() { - for (var _len199 = arguments.length, args = new Array(_len199), _key199 = 0; _key199 < _len199; _key199++) { - args[_key199] = arguments[_key199]; - } +function TSExternalModuleReference(...args) { + return (0, _builder.default)("TSExternalModuleReference", ...args); +} - return _builder.default.apply(void 0, ["TSTypeAnnotation"].concat(args)); +function TSNonNullExpression(...args) { + return (0, _builder.default)("TSNonNullExpression", ...args); } -function TSTypeParameterInstantiation() { - for (var _len200 = arguments.length, args = new Array(_len200), _key200 = 0; _key200 < _len200; _key200++) { - args[_key200] = arguments[_key200]; - } +function TSExportAssignment(...args) { + return (0, _builder.default)("TSExportAssignment", ...args); +} - return _builder.default.apply(void 0, ["TSTypeParameterInstantiation"].concat(args)); +function TSNamespaceExportDeclaration(...args) { + return (0, _builder.default)("TSNamespaceExportDeclaration", ...args); } -function TSTypeParameterDeclaration() { - for (var _len201 = arguments.length, args = new Array(_len201), _key201 = 0; _key201 < _len201; _key201++) { - args[_key201] = arguments[_key201]; - } +function TSTypeAnnotation(...args) { + return (0, _builder.default)("TSTypeAnnotation", ...args); +} - return _builder.default.apply(void 0, ["TSTypeParameterDeclaration"].concat(args)); +function TSTypeParameterInstantiation(...args) { + return (0, _builder.default)("TSTypeParameterInstantiation", ...args); } -function TSTypeParameter() { - for (var _len202 = arguments.length, args = new Array(_len202), _key202 = 0; _key202 < _len202; _key202++) { - args[_key202] = arguments[_key202]; - } +function TSTypeParameterDeclaration(...args) { + return (0, _builder.default)("TSTypeParameterDeclaration", ...args); +} - return _builder.default.apply(void 0, ["TSTypeParameter"].concat(args)); +function TSTypeParameter(...args) { + return (0, _builder.default)("TSTypeParameter", ...args); } -function NumberLiteral() { +function NumberLiteral(...args) { console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - - for (var _len203 = arguments.length, args = new Array(_len203), _key203 = 0; _key203 < _len203; _key203++) { - args[_key203] = arguments[_key203]; - } - - return NumberLiteral.apply(void 0, ["NumberLiteral"].concat(args)); + return NumberLiteral("NumberLiteral", ...args); } -function RegexLiteral() { +function RegexLiteral(...args) { console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - - for (var _len204 = arguments.length, args = new Array(_len204), _key204 = 0; _key204 < _len204; _key204++) { - args[_key204] = arguments[_key204]; - } - - return RegexLiteral.apply(void 0, ["RegexLiteral"].concat(args)); + return RegexLiteral("RegexLiteral", ...args); } -function RestProperty() { +function RestProperty(...args) { console.trace("The node type RestProperty has been renamed to RestElement"); - - for (var _len205 = arguments.length, args = new Array(_len205), _key205 = 0; _key205 < _len205; _key205++) { - args[_key205] = arguments[_key205]; - } - - return RestProperty.apply(void 0, ["RestProperty"].concat(args)); + return RestProperty("RestProperty", ...args); } -function SpreadProperty() { +function SpreadProperty(...args) { console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - - for (var _len206 = arguments.length, args = new Array(_len206), _key206 = 0; _key206 < _len206; _key206++) { - args[_key206] = arguments[_key206]; - } - - return SpreadProperty.apply(void 0, ["SpreadProperty"].concat(args)); + return SpreadProperty("SpreadProperty", ...args); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js index 26c3068fd38658..91e7cbd9cabd9d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = buildChildren; var _generated = require("../../validators/generated"); @@ -10,10 +12,10 @@ var _cleanJSXElementLiteralChild = _interopRequireDefault(require("../../utils/r function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function buildChildren(node) { - var elements = []; + const elements = []; - for (var i = 0; i < node.children.length; i++) { - var child = node.children[i]; + for (let i = 0; i < node.children.length; i++) { + let child = node.children[i]; if ((0, _generated.isJSXText)(child)) { (0, _cleanJSXElementLiteralChild.default)(child, elements); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js index 2677f9023a063d..9595f6e25cfdee 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js @@ -1,14 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = clone; +var _cloneNode = _interopRequireDefault(require("./cloneNode")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function clone(node) { - if (!node) return node; - var newNode = {}; - Object.keys(node).forEach(function (key) { - if (key[0] === "_") return; - newNode[key] = node[key]; - }); - return newNode; + return (0, _cloneNode.default)(node, false); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js index 4212edd2bc7482..eb29c536227bc8 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js @@ -1,24 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = cloneDeep; -function cloneDeep(node) { - if (!node) return node; - var newNode = {}; - Object.keys(node).forEach(function (key) { - if (key[0] === "_") return; - var val = node[key]; +var _cloneNode = _interopRequireDefault(require("./cloneNode")); - if (val) { - if (val.type) { - val = cloneDeep(val); - } else if (Array.isArray(val)) { - val = val.map(cloneDeep); - } - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - newNode[key] = val; - }); - return newNode; +function cloneDeep(node) { + return (0, _cloneNode.default)(node); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js new file mode 100644 index 00000000000000..bcccddcf475327 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cloneNode; + +var _definitions = require("../definitions"); + +const has = Function.call.bind(Object.prototype.hasOwnProperty); + +function cloneIfNode(obj, deep) { + if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") { + return cloneNode(obj, deep); + } + + return obj; +} + +function cloneIfNodeOrArray(obj, deep) { + if (Array.isArray(obj)) { + return obj.map(node => cloneIfNode(node, deep)); + } + + return cloneIfNode(obj, deep); +} + +function cloneNode(node, deep = true) { + if (!node) return node; + const { + type + } = node; + const newNode = { + type + }; + + if (type === "Identifier") { + newNode.name = node.name; + + if (has(node, "optional") && typeof node.optional === "boolean") { + newNode.optional = node.optional; + } + + if (has(node, "typeAnnotation")) { + newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true) : node.typeAnnotation; + } + } else if (!has(_definitions.NODE_FIELDS, type)) { + throw new Error(`Unknown node type: "${type}"`); + } else { + for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { + if (has(node, field)) { + newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field]; + } + } + } + + if (has(node, "loc")) { + newNode.loc = node.loc; + } + + if (has(node, "leadingComments")) { + newNode.leadingComments = node.leadingComments; + } + + if (has(node, "innerComments")) { + newNode.innerComments = node.innerCmments; + } + + if (has(node, "trailingComments")) { + newNode.trailingComments = node.trailingComments; + } + + if (has(node, "extra")) { + newNode.extra = Object.assign({}, node.extra); + } + + return newNode; +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js index a32214294208dc..5622af7b0220d7 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = cloneWithoutLoc; var _clone = _interopRequireDefault(require("./clone")); @@ -8,7 +10,7 @@ var _clone = _interopRequireDefault(require("./clone")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function cloneWithoutLoc(node) { - var newNode = (0, _clone.default)(node); + const newNode = (0, _clone.default)(node); newNode.loc = null; return newNode; } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js index bbe3c969549b34..ff586514e7eb4d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = addComment; var _addComments = _interopRequireDefault(require("./addComments")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js index 1f7c52931da182..f3a61df7131657 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js @@ -1,11 +1,13 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = addComments; function addComments(node, type, comments) { if (!comments || !node) return node; - var key = type + "Comments"; + const key = `${type}Comments`; if (node[key]) { if (type === "leading") { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js index 02f1ad5092e29e..fbe59dec623663 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inheritInnerComments; var _inherit = _interopRequireDefault(require("../utils/inherit")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js index f5c213be1fcddd..ccb02ec55bef0e 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inheritLeadingComments; var _inherit = _interopRequireDefault(require("../utils/inherit")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js index 81d60f74148d4e..bce1e2d9ac77a6 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inheritTrailingComments; var _inherit = _interopRequireDefault(require("../utils/inherit")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js index f0446776df81ac..fd942d86cdc54b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inheritsComments; var _inheritTrailingComments = _interopRequireDefault(require("./inheritTrailingComments")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js index 30319b1c9c5144..fe34f1a8905b31 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js @@ -1,12 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = removeComments; var _constants = require("../constants"); function removeComments(node) { - _constants.COMMENT_KEYS.forEach(function (key) { + _constants.COMMENT_KEYS.forEach(key => { node[key] = null; }); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js index 20f182ed1def1f..6072495e206be0 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js @@ -1,87 +1,93 @@ "use strict"; -exports.__esModule = true; -exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.JSX_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; var _definitions = require("../../definitions"); -var EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; +const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; exports.EXPRESSION_TYPES = EXPRESSION_TYPES; -var BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; +const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; exports.BINARY_TYPES = BINARY_TYPES; -var SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; +const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; exports.SCOPABLE_TYPES = SCOPABLE_TYPES; -var BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; +const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES; -var BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; +const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; exports.BLOCK_TYPES = BLOCK_TYPES; -var STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; +const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; exports.STATEMENT_TYPES = STATEMENT_TYPES; -var TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; +const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES; -var COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; +const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES; -var CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; +const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES; -var LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; +const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; exports.LOOP_TYPES = LOOP_TYPES; -var WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; +const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; exports.WHILE_TYPES = WHILE_TYPES; -var EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; +const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES; -var FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; +const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; exports.FOR_TYPES = FOR_TYPES; -var FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; +const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES; -var FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; +const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; exports.FUNCTION_TYPES = FUNCTION_TYPES; -var FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; +const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES; -var PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; +const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; exports.PUREISH_TYPES = PUREISH_TYPES; -var DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; +const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; exports.DECLARATION_TYPES = DECLARATION_TYPES; -var PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; +const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES; -var LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; +const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; exports.LVAL_TYPES = LVAL_TYPES; -var TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; +const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES; -var LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; +const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; exports.LITERAL_TYPES = LITERAL_TYPES; -var IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; +const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES; -var USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; +const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES; -var METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; +const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; exports.METHOD_TYPES = METHOD_TYPES; -var OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; +const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES; -var PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; +const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; exports.PROPERTY_TYPES = PROPERTY_TYPES; -var UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; +const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES; -var PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; +const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; exports.PATTERN_TYPES = PATTERN_TYPES; -var CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; +const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; exports.CLASS_TYPES = CLASS_TYPES; -var MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; +const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES; -var EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; +const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES; -var MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; +const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES; -var FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; +const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; exports.FLOW_TYPES = FLOW_TYPES; -var FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; +const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"]; +exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES; +const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES; -var FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; +const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES; -var FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; +const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES; -var JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; +const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; exports.JSX_TYPES = JSX_TYPES; -var TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; +const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; +exports.PRIVATE_TYPES = PRIVATE_TYPES; +const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES; -var TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; +const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; exports.TSTYPE_TYPES = TSTYPE_TYPES; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js index f8eb31b9eed64c..a60b106fdad394 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js @@ -1,45 +1,47 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; -var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; +const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS; -var FLATTENABLE_KEYS = ["body", "expressions"]; +const FLATTENABLE_KEYS = ["body", "expressions"]; exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS; -var FOR_INIT_KEYS = ["left", "init"]; +const FOR_INIT_KEYS = ["left", "init"]; exports.FOR_INIT_KEYS = FOR_INIT_KEYS; -var COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; +const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; exports.COMMENT_KEYS = COMMENT_KEYS; -var LOGICAL_OPERATORS = ["||", "&&", "??"]; +const LOGICAL_OPERATORS = ["||", "&&", "??"]; exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS; -var UPDATE_OPERATORS = ["++", "--"]; +const UPDATE_OPERATORS = ["++", "--"]; exports.UPDATE_OPERATORS = UPDATE_OPERATORS; -var BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; +const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS; -var EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; +const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS; -var COMPARISON_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS.concat(["in", "instanceof"]); +const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"]; exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS; -var BOOLEAN_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS.concat(BOOLEAN_NUMBER_BINARY_OPERATORS); +const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS]; exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS; -var NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; +const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS; -var BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS); +const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS]; exports.BINARY_OPERATORS = BINARY_OPERATORS; -var BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; +const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS; -var NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; +const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS; -var STRING_UNARY_OPERATORS = ["typeof"]; +const STRING_UNARY_OPERATORS = ["typeof"]; exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS; -var UNARY_OPERATORS = ["void", "throw"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS); +const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS]; exports.UNARY_OPERATORS = UNARY_OPERATORS; -var INHERIT_KEYS = { +const INHERIT_KEYS = { optional: ["typeAnnotation", "typeParameters", "returnType"], force: ["start", "loc", "end"] }; exports.INHERIT_KEYS = INHERIT_KEYS; -var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); +const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL; -var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); +const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js index da69103d9ef20b..2836b3657814f7 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js @@ -1,16 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = ensureBlock; var _toBlock = _interopRequireDefault(require("./toBlock")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function ensureBlock(node, key) { - if (key === void 0) { - key = "body"; - } - +function ensureBlock(node, key = "body") { return node[key] = (0, _toBlock.default)(node[key], node); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js index 0e07cbe18f0e3e..2d05485b80e042 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = gatherSequenceExpressions; var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBindingIdentifiers")); @@ -9,43 +11,31 @@ var _generated = require("../validators/generated"); var _generated2 = require("../builders/generated"); +var _cloneNode = _interopRequireDefault(require("../clone/cloneNode")); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function gatherSequenceExpressions(nodes, scope, declars) { - var exprs = []; - var ensureLastUndefined = true; - - for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } + const exprs = []; + let ensureLastUndefined = true; - var _node = _ref; + for (const node of nodes) { ensureLastUndefined = false; - if ((0, _generated.isExpression)(_node)) { - exprs.push(_node); - } else if ((0, _generated.isExpressionStatement)(_node)) { - exprs.push(_node.expression); - } else if ((0, _generated.isVariableDeclaration)(_node)) { - if (_node.kind !== "var") return; - var _arr = _node.declarations; + if ((0, _generated.isExpression)(node)) { + exprs.push(node); + } else if ((0, _generated.isExpressionStatement)(node)) { + exprs.push(node.expression); + } else if ((0, _generated.isVariableDeclaration)(node)) { + if (node.kind !== "var") return; - for (var _i2 = 0; _i2 < _arr.length; _i2++) { - var declar = _arr[_i2]; - var bindings = (0, _getBindingIdentifiers.default)(declar); + for (const declar of node.declarations) { + const bindings = (0, _getBindingIdentifiers.default)(declar); - for (var key in bindings) { + for (const key in bindings) { declars.push({ - kind: _node.kind, - id: bindings[key] + kind: node.kind, + id: (0, _cloneNode.default)(bindings[key]) }); } @@ -55,16 +45,16 @@ function gatherSequenceExpressions(nodes, scope, declars) { } ensureLastUndefined = true; - } else if ((0, _generated.isIfStatement)(_node)) { - var consequent = _node.consequent ? gatherSequenceExpressions([_node.consequent], scope, declars) : scope.buildUndefinedNode(); - var alternate = _node.alternate ? gatherSequenceExpressions([_node.alternate], scope, declars) : scope.buildUndefinedNode(); + } else if ((0, _generated.isIfStatement)(node)) { + const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); + const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); if (!consequent || !alternate) return; - exprs.push((0, _generated2.conditionalExpression)(_node.test, consequent, alternate)); - } else if ((0, _generated.isBlockStatement)(_node)) { - var body = gatherSequenceExpressions(_node.body, scope, declars); + exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate)); + } else if ((0, _generated.isBlockStatement)(node)) { + const body = gatherSequenceExpressions(node.body, scope, declars); if (!body) return; exprs.push(body); - } else if ((0, _generated.isEmptyStatement)(_node)) { + } else if ((0, _generated.isEmptyStatement)(node)) { ensureLastUndefined = true; } else { return; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js index 3bda98aa834e10..b9d165b6fd1d20 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toBindingIdentifierName; var _toIdentifier = _interopRequireDefault(require("./toIdentifier")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js index 542ff552103516..19886833fa300e 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toBlock; var _generated = require("../validators/generated"); @@ -12,7 +14,7 @@ function toBlock(node, parent) { return node; } - var blockNodes = []; + let blockNodes = []; if ((0, _generated.isEmptyStatement)(node)) { blockNodes = []; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js index 71bd8e4a6628cb..31e6770f6f770f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js @@ -1,17 +1,15 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toComputedKey; var _generated = require("../validators/generated"); var _generated2 = require("../builders/generated"); -function toComputedKey(node, key) { - if (key === void 0) { - key = node.key || node.property; - } - +function toComputedKey(node, key = node.key || node.property) { if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name); return key; } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js index dfb5bb87b84743..6e58b0de4d6e60 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toExpression; var _generated = require("../validators/generated"); @@ -21,7 +23,7 @@ function toExpression(node) { } if (!(0, _generated.isExpression)(node)) { - throw new Error("cannot turn " + node.type + " to an expression"); + throw new Error(`cannot turn ${node.type} to an expression`); } return node; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js index d929872af5e553..e55db41fc4fd17 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toIdentifier; var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); @@ -16,7 +18,7 @@ function toIdentifier(name) { }); if (!(0, _isValidIdentifier.default)(name)) { - name = "_" + name; + name = `_${name}`; } return name || "_"; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js index 88aa30ed979b77..c48fd0e7f319e2 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js @@ -1,22 +1,20 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toKeyAlias; var _generated = require("../validators/generated"); -var _cloneDeep = _interopRequireDefault(require("../clone/cloneDeep")); +var _cloneNode = _interopRequireDefault(require("../clone/cloneNode")); var _removePropertiesDeep = _interopRequireDefault(require("../modifications/removePropertiesDeep")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function toKeyAlias(node, key) { - if (key === void 0) { - key = node.key; - } - - var alias; +function toKeyAlias(node, key = node.key) { + let alias; if (node.kind === "method") { return toKeyAlias.increment() + ""; @@ -25,15 +23,15 @@ function toKeyAlias(node, key) { } else if ((0, _generated.isStringLiteral)(key)) { alias = JSON.stringify(key.value); } else { - alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneDeep.default)(key))); + alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key))); } if (node.computed) { - alias = "[" + alias + "]"; + alias = `[${alias}]`; } if (node.static) { - alias = "static:" + alias; + alias = `static:${alias}`; } return alias; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js index c5488ef9d5526f..2e221db4e07042 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toSequenceExpression; var _gatherSequenceExpressions = _interopRequireDefault(require("./gatherSequenceExpressions")); @@ -9,12 +11,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function toSequenceExpression(nodes, scope) { if (!nodes || !nodes.length) return; - var declars = []; - var result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); + const declars = []; + const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); if (!result) return; - for (var _i = 0; _i < declars.length; _i++) { - var declar = declars[_i]; + for (const declar of declars) { scope.push(declar); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js index 8fa5a97e20d9cc..69b22ae09cc6ce 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = toStatement; var _generated = require("../validators/generated"); @@ -12,8 +14,8 @@ function toStatement(node, ignore) { return node; } - var mustHaveId = false; - var newType; + let mustHaveId = false; + let newType; if ((0, _generated.isClass)(node)) { mustHaveId = true; @@ -33,7 +35,7 @@ function toStatement(node, ignore) { if (ignore) { return false; } else { - throw new Error("cannot turn " + node.type + " to a statement"); + throw new Error(`cannot turn ${node.type} to a statement`); } } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js index d8f82ffd05e606..a7456ebfb0c785 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js @@ -1,11 +1,29 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = valueToNode; -var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject")); +function _isPlainObject() { + const data = _interopRequireDefault(require("lodash/isPlainObject")); -var _isRegExp = _interopRequireDefault(require("lodash/isRegExp")); + _isPlainObject = function () { + return data; + }; + + return data; +} + +function _isRegExp() { + const data = _interopRequireDefault(require("lodash/isRegExp")); + + _isRegExp = function () { + return data; + }; + + return data; +} var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); @@ -31,12 +49,32 @@ function valueToNode(value) { } if (typeof value === "number") { - return (0, _generated.numericLiteral)(value); + let result; + + if (Number.isFinite(value)) { + result = (0, _generated.numericLiteral)(Math.abs(value)); + } else { + let numerator; + + if (Number.isNaN(value)) { + numerator = (0, _generated.numericLiteral)(0); + } else { + numerator = (0, _generated.numericLiteral)(1); + } + + result = (0, _generated.binaryExpression)("/", numerator, (0, _generated.numericLiteral)(0)); + } + + if (value < 0 || Object.is(value, -0)) { + result = (0, _generated.unaryExpression)("-", result); + } + + return result; } - if ((0, _isRegExp.default)(value)) { - var pattern = value.source; - var flags = value.toString().match(/\/([a-z]+|)$/)[1]; + if ((0, _isRegExp().default)(value)) { + const pattern = value.source; + const flags = value.toString().match(/\/([a-z]+|)$/)[1]; return (0, _generated.regExpLiteral)(pattern, flags); } @@ -44,11 +82,11 @@ function valueToNode(value) { return (0, _generated.arrayExpression)(value.map(valueToNode)); } - if ((0, _isPlainObject.default)(value)) { - var props = []; + if ((0, _isPlainObject().default)(value)) { + const props = []; - for (var key in value) { - var nodeKey = void 0; + for (const key in value) { + let nodeKey; if ((0, _isValidIdentifier.default)(key)) { nodeKey = (0, _generated.identifier)(key); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js index d8abe51f151946..b2bcbd9c2ff6ea 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); @@ -43,7 +45,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de builder: ["operator", "left", "right"], fields: { operator: { - validate: _utils.assertOneOf.apply(void 0, _constants.BINARY_OPERATORS) + validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) }, left: { validate: (0, _utils.assertNodeType)("Expression") @@ -55,6 +57,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de visitor: ["left", "right"], aliases: ["Binary", "Expression"] }); +(0, _utils.default)("InterpreterDirective", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + } +}); (0, _utils.default)("Directive", { visitor: ["value"], fields: { @@ -96,7 +106,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de aliases: ["Statement", "Terminatorless", "CompletionStatement"] }); (0, _utils.default)("CallExpression", { - visitor: ["callee", "arguments", "typeParameters"], + visitor: ["callee", "arguments", "typeParameters", "typeArguments"], builder: ["callee", "arguments"], aliases: ["Expression"], fields: { @@ -110,8 +120,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de validate: (0, _utils.assertOneOf)(true, false), optional: true }, + typeArguments: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), + optional: true + }, typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), optional: true } } @@ -226,9 +240,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de } } }); -var functionCommon = { +const functionCommon = { params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("LVal"))) + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty"))) }, generator: { default: false, @@ -240,7 +254,7 @@ var functionCommon = { } }; exports.functionCommon = functionCommon; -var functionTypeAnnotationCommon = { +const functionTypeAnnotationCommon = { returnType: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true @@ -251,7 +265,7 @@ var functionTypeAnnotationCommon = { } }; exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; -var functionDeclarationCommon = Object.assign({}, functionCommon, { +const functionDeclarationCommon = Object.assign({}, functionCommon, { declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true @@ -285,7 +299,7 @@ exports.functionDeclarationCommon = functionDeclarationCommon; } }) }); -var patternLikeCommon = { +const patternLikeCommon = { typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true @@ -297,13 +311,13 @@ var patternLikeCommon = { exports.patternLikeCommon = patternLikeCommon; (0, _utils.default)("Identifier", { builder: ["name"], - visitor: ["typeAnnotation"], + visitor: ["typeAnnotation", "decorators"], aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], fields: Object.assign({}, patternLikeCommon, { name: { - validate: function validate(node, key, val) { + validate: (0, _utils.chain)(function (node, key, val) { if (!(0, _isValidIdentifier.default)(val)) {} - } + }, (0, _utils.assertValueType)("string")) }, optional: { validate: (0, _utils.assertValueType)("boolean"), @@ -390,7 +404,7 @@ exports.patternLikeCommon = patternLikeCommon; aliases: ["Binary", "Expression"], fields: { operator: { - validate: _utils.assertOneOf.apply(void 0, _constants.LOGICAL_OPERATORS) + validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) }, left: { validate: (0, _utils.assertNodeType)("Expression") @@ -410,10 +424,10 @@ exports.patternLikeCommon = patternLikeCommon; }, property: { validate: function () { - var normal = (0, _utils.assertNodeType)("Identifier"); - var computed = (0, _utils.assertNodeType)("Expression"); + const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); + const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { - var validator = node.computed ? computed : normal; + const validator = node.computed ? computed : normal; validator(node, key, val); }; }() @@ -432,7 +446,7 @@ exports.patternLikeCommon = patternLikeCommon; }); (0, _utils.default)("Program", { visitor: ["directives", "body"], - builder: ["body", "directives", "sourceType"], + builder: ["body", "directives", "sourceType", "interpreter"], fields: { sourceFile: { validate: (0, _utils.assertValueType)("string") @@ -441,6 +455,11 @@ exports.patternLikeCommon = patternLikeCommon; validate: (0, _utils.assertOneOf)("script", "module"), default: "script" }, + interpreter: { + validate: (0, _utils.assertNodeType)("InterpreterDirective"), + default: null, + optional: true + }, directives: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), default: [] @@ -473,10 +492,10 @@ exports.patternLikeCommon = patternLikeCommon; }, key: { validate: function () { - var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - var computed = (0, _utils.assertNodeType)("Expression"); + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { - var validator = node.computed ? computed : normal; + const validator = node.computed ? computed : normal; validator(node, key, val); }; }() @@ -500,10 +519,10 @@ exports.patternLikeCommon = patternLikeCommon; }, key: { validate: function () { - var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - var computed = (0, _utils.assertNodeType)("Expression"); + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { - var validator = node.computed ? computed : normal; + const validator = node.computed ? computed : normal; validator(node, key, val); }; }() @@ -616,7 +635,7 @@ exports.patternLikeCommon = patternLikeCommon; validate: (0, _utils.assertNodeType)("Expression") }, operator: { - validate: _utils.assertOneOf.apply(void 0, _constants.UNARY_OPERATORS) + validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) } }, visitor: ["argument"], @@ -632,7 +651,7 @@ exports.patternLikeCommon = patternLikeCommon; validate: (0, _utils.assertNodeType)("Expression") }, operator: { - validate: _utils.assertOneOf.apply(void 0, _constants.UPDATE_OPERATORS) + validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) } }, visitor: ["argument"], @@ -661,6 +680,10 @@ exports.patternLikeCommon = patternLikeCommon; id: { validate: (0, _utils.assertNodeType)("LVal") }, + definite: { + optional: true, + validate: (0, _utils.assertValueType)("boolean") + }, init: { optional: true, validate: (0, _utils.assertNodeType)("Expression") 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 62e2b4b0c27848..b4ce6fa04d99af 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 @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0; var _utils = _interopRequireWildcard(require("./utils")); @@ -10,7 +12,7 @@ var _core = require("./core"); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } (0, _utils.default)("AssignmentPattern", { - visitor: ["left", "right"], + visitor: ["left", "right", "decorators"], builder: ["left", "right"], aliases: ["Pattern", "PatternLike", "LVal"], fields: Object.assign({}, _core.patternLikeCommon, { @@ -55,11 +57,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; visitor: ["body"], fields: { body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassProperty", "TSDeclareMethod", "TSIndexSignature"))) + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature"))) } } }); -var classCommon = { +const classCommon = { typeParameters: { validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), optional: true @@ -76,7 +78,7 @@ var classCommon = { optional: true }, implements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "FlowClassImplements"))), + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), optional: true } }; @@ -199,6 +201,10 @@ var classCommon = { }, source: { validate: (0, _utils.assertNodeType)("StringLiteral") + }, + importKind: { + validate: (0, _utils.assertOneOf)("type", "typeof", "value"), + optional: true } } }); @@ -231,7 +237,8 @@ var classCommon = { validate: (0, _utils.assertNodeType)("Identifier") }, importKind: { - validate: (0, _utils.assertOneOf)(null, "type", "typeof") + validate: (0, _utils.assertOneOf)("type", "typeof"), + optional: true } } }); @@ -247,7 +254,7 @@ var classCommon = { } } }); -var classMethodOrPropertyCommon = { +const classMethodOrPropertyCommon = { abstract: { validate: (0, _utils.assertValueType)("boolean"), optional: true @@ -269,18 +276,18 @@ var classMethodOrPropertyCommon = { optional: true }, key: { - validate: function () { - var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - var computed = (0, _utils.assertNodeType)("Expression"); + validate: (0, _utils.chain)(function () { + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { - var validator = node.computed ? computed : normal; + const validator = node.computed ? computed : normal; validator(node, key, val); }; - }() + }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) } }; exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; -var classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, { +const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, { kind: { validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("get", "set", "method", "constructor")), default: "method" @@ -306,7 +313,7 @@ exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; }) }); (0, _utils.default)("ObjectPattern", { - visitor: ["properties", "typeAnnotation"], + visitor: ["properties", "typeAnnotation", "decorators"], builder: ["properties"], aliases: ["Pattern", "PatternLike", "LVal"], fields: Object.assign({}, _core.patternLikeCommon, { @@ -337,6 +344,10 @@ exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; }, quasi: { validate: (0, _utils.assertNodeType)("TemplateLiteral") + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + optional: true } } }); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js index 968f3009d868b9..e31b9fb7b93168 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js @@ -30,6 +30,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; validate: (0, _utils.assertNodeType)("Expression"), optional: true }, + definite: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true @@ -44,6 +48,104 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } }) }); +(0, _utils.default)("OptionalMemberExpression", { + builder: ["object", "property", "computed", "optional"], + visitor: ["object", "property"], + aliases: ["Expression"], + fields: { + object: { + validate: (0, _utils.assertNodeType)("Expression") + }, + property: { + validate: function () { + const normal = (0, _utils.assertNodeType)("Identifier"); + const computed = (0, _utils.assertNodeType)("Expression"); + return function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + }() + }, + computed: { + default: false + }, + optional: { + validate: (0, _utils.assertValueType)("boolean") + } + } +}); +(0, _utils.default)("PipelineTopicExpression", { + builder: ["expression"], + visitor: ["expression"], + fields: { + expression: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("PipelineBareFunction", { + builder: ["callee"], + visitor: ["callee"], + fields: { + callee: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("PipelinePrimaryTopicReference", { + aliases: ["Expression"] +}); +(0, _utils.default)("OptionalCallExpression", { + visitor: ["callee", "arguments", "typeParameters", "typeArguments"], + builder: ["callee", "arguments", "optional"], + aliases: ["Expression"], + fields: { + callee: { + validate: (0, _utils.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName"))) + }, + optional: { + validate: (0, _utils.assertValueType)("boolean") + }, + typeArguments: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), + optional: true + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), + optional: true + } + } +}); +(0, _utils.default)("ClassPrivateProperty", { + visitor: ["key", "value"], + builder: ["key", "value"], + aliases: ["Property", "Private"], + fields: { + key: { + validate: (0, _utils.assertNodeType)("PrivateName") + }, + value: { + validate: (0, _utils.assertNodeType)("Expression"), + optional: true + } + } +}); +(0, _utils.default)("ClassPrivateMethod", { + builder: ["kind", "key", "params", "body", "static"], + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"], + fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, { + key: { + validate: (0, _utils.assertNodeType)("PrivateName") + }, + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }) +}); (0, _utils.default)("Import", { aliases: ["Expression"] }); @@ -81,4 +183,22 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; validate: (0, _utils.assertNodeType)("Identifier") } } +}); +(0, _utils.default)("PrivateName", { + visitor: ["id"], + aliases: ["Private"], + fields: { + id: { + validate: (0, _utils.assertNodeType)("Identifier") + } + } +}); +(0, _utils.default)("BigIntLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); \ No newline at end of file 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 db54ee1a953b9e..6969237dfa3dbc 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 @@ -4,260 +4,383 @@ var _utils = _interopRequireWildcard(require("./utils")); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { + (0, _utils.default)(name, { + builder: ["id", "typeParameters", "extends", "body"], + visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)(typeParameterType), + extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), + mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), + implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")), + body: (0, _utils.validateType)("ObjectTypeAnnotation") + } + }); +}; + (0, _utils.default)("AnyTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("ArrayTypeAnnotation", { visitor: ["elementType"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + elementType: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("BooleanTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("BooleanLiteralTypeAnnotation", { - aliases: ["Flow"], - fields: {} + builder: ["value"], + aliases: ["Flow", "FlowType"], + fields: { + value: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) + } }); (0, _utils.default)("NullLiteralTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("ClassImplements", { visitor: ["id", "typeParameters"], aliases: ["Flow"], - fields: {} -}); -(0, _utils.default)("DeclareClass", { - visitor: ["id", "typeParameters", "extends", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") + } }); +defineInterfaceishType("DeclareClass"); (0, _utils.default)("DeclareFunction", { visitor: ["id"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} -}); -(0, _utils.default)("DeclareInterface", { - visitor: ["id", "typeParameters", "extends", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + predicate: (0, _utils.validateOptionalType)("DeclaredPredicate") + } }); +defineInterfaceishType("DeclareInterface"); (0, _utils.default)("DeclareModule", { + builder: ["id", "body", "kind"], visitor: ["id", "body"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), + body: (0, _utils.validateType)("BlockStatement"), + kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES")) + } }); (0, _utils.default)("DeclareModuleExports", { visitor: ["typeAnnotation"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + typeAnnotation: (0, _utils.validateType)("TypeAnnotation") + } }); (0, _utils.default)("DeclareTypeAlias", { visitor: ["id", "typeParameters", "right"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), + right: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("DeclareOpaqueType", { visitor: ["id", "typeParameters", "supertype"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), + supertype: (0, _utils.validateOptionalType)("FlowType") + } }); (0, _utils.default)("DeclareVariable", { visitor: ["id"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier") + } }); (0, _utils.default)("DeclareExportDeclaration", { visitor: ["declaration", "specifiers", "source"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + declaration: (0, _utils.validateOptionalType)("Flow"), + specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])), + source: (0, _utils.validateOptionalType)("StringLiteral"), + default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) + } }); (0, _utils.default)("DeclareExportAllDeclaration", { visitor: ["source"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + source: (0, _utils.validateType)("StringLiteral"), + exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)(["type", "value"])) + } }); (0, _utils.default)("DeclaredPredicate", { visitor: ["value"], aliases: ["Flow", "FlowPredicate"], - fields: {} + fields: { + value: (0, _utils.validateType)("Flow") + } }); (0, _utils.default)("ExistsTypeAnnotation", { - aliases: ["Flow"] + aliases: ["Flow", "FlowType"] }); (0, _utils.default)("FunctionTypeAnnotation", { visitor: ["typeParameters", "params", "rest", "returnType"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), + params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")), + rest: (0, _utils.validateOptionalType)("FunctionTypeParam"), + returnType: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("FunctionTypeParam", { visitor: ["name", "typeAnnotation"], aliases: ["Flow"], - fields: {} + fields: { + name: (0, _utils.validateOptionalType)("Identifier"), + typeAnnotation: (0, _utils.validateType)("FlowType"), + optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) + } }); (0, _utils.default)("GenericTypeAnnotation", { visitor: ["id", "typeParameters"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") + } }); (0, _utils.default)("InferredPredicate", { - aliases: ["Flow", "FlowPredicate"], - fields: {} + aliases: ["Flow", "FlowPredicate"] }); (0, _utils.default)("InterfaceExtends", { visitor: ["id", "typeParameters"], aliases: ["Flow"], - fields: {} + fields: { + id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") + } }); -(0, _utils.default)("InterfaceDeclaration", { - visitor: ["id", "typeParameters", "extends", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} +defineInterfaceishType("InterfaceDeclaration"); +(0, _utils.default)("InterfaceTypeAnnotation", { + visitor: ["extends", "body"], + aliases: ["Flow", "FlowType"], + fields: { + extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), + body: (0, _utils.validateType)("ObjectTypeAnnotation") + } }); (0, _utils.default)("IntersectionTypeAnnotation", { visitor: ["types"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) + } }); (0, _utils.default)("MixedTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"] + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("EmptyTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"] + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("NullableTypeAnnotation", { visitor: ["typeAnnotation"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + typeAnnotation: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("NumberLiteralTypeAnnotation", { - aliases: ["Flow"], - fields: {} + builder: ["value"], + aliases: ["Flow", "FlowType"], + fields: { + value: (0, _utils.validate)((0, _utils.assertValueType)("number")) + } }); (0, _utils.default)("NumberTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("ObjectTypeAnnotation", { - visitor: ["properties", "indexers", "callProperties"], - aliases: ["Flow"], - fields: {} + visitor: ["properties", "indexers", "callProperties", "internalSlots"], + aliases: ["Flow", "FlowType"], + builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"], + fields: { + properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])), + indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")), + callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")), + internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")), + exact: { + validate: (0, _utils.assertValueType)("boolean"), + default: false + }, + inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) + } +}); +(0, _utils.default)("ObjectTypeInternalSlot", { + visitor: ["id", "value", "optional", "static", "method"], + aliases: ["Flow", "UserWhitespacable"], + fields: { + id: (0, _utils.validateType)("Identifier"), + value: (0, _utils.validateType)("FlowType"), + optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) + } }); (0, _utils.default)("ObjectTypeCallProperty", { visitor: ["value"], aliases: ["Flow", "UserWhitespacable"], - fields: {} + fields: { + value: (0, _utils.validateType)("FlowType"), + static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) + } }); (0, _utils.default)("ObjectTypeIndexer", { - visitor: ["id", "key", "value"], + visitor: ["id", "key", "value", "variance"], aliases: ["Flow", "UserWhitespacable"], - fields: {} + fields: { + id: (0, _utils.validateOptionalType)("Identifier"), + key: (0, _utils.validateType)("FlowType"), + value: (0, _utils.validateType)("FlowType"), + static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + variance: (0, _utils.validateOptionalType)("Variance") + } }); (0, _utils.default)("ObjectTypeProperty", { - visitor: ["key", "value"], + visitor: ["key", "value", "variance"], aliases: ["Flow", "UserWhitespacable"], - fields: {} + fields: { + key: (0, _utils.validateType)(["Identifier", "StringLiteral"]), + value: (0, _utils.validateType)("FlowType"), + kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")), + static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + variance: (0, _utils.validateOptionalType)("Variance") + } }); (0, _utils.default)("ObjectTypeSpreadProperty", { visitor: ["argument"], aliases: ["Flow", "UserWhitespacable"], - fields: {} + fields: { + argument: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("OpaqueType", { visitor: ["id", "typeParameters", "supertype", "impltype"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), + supertype: (0, _utils.validateOptionalType)("FlowType"), + impltype: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("QualifiedTypeIdentifier", { visitor: ["id", "qualification"], aliases: ["Flow"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]) + } }); (0, _utils.default)("StringLiteralTypeAnnotation", { - aliases: ["Flow"], - fields: {} + builder: ["value"], + aliases: ["Flow", "FlowType"], + fields: { + value: (0, _utils.validate)((0, _utils.assertValueType)("string")) + } }); (0, _utils.default)("StringTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("ThisTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); (0, _utils.default)("TupleTypeAnnotation", { visitor: ["types"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) + } }); (0, _utils.default)("TypeofTypeAnnotation", { visitor: ["argument"], - aliases: ["Flow"], - fields: {} + aliases: ["Flow", "FlowType"], + fields: { + argument: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("TypeAlias", { visitor: ["id", "typeParameters", "right"], aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: {} + fields: { + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), + right: (0, _utils.validateType)("FlowType") + } }); (0, _utils.default)("TypeAnnotation", { aliases: ["Flow"], visitor: ["typeAnnotation"], fields: { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("Flow") - } + typeAnnotation: (0, _utils.validateType)("FlowType") } }); (0, _utils.default)("TypeCastExpression", { visitor: ["expression", "typeAnnotation"], aliases: ["Flow", "ExpressionWrapper", "Expression"], - fields: {} + fields: { + expression: (0, _utils.validateType)("Expression"), + typeAnnotation: (0, _utils.validateType)("TypeAnnotation") + } }); (0, _utils.default)("TypeParameter", { aliases: ["Flow"], - visitor: ["bound", "default"], + visitor: ["bound", "default", "variance"], fields: { - name: { - validate: (0, _utils.assertValueType)("string") - }, - bound: { - validate: (0, _utils.assertNodeType)("TypeAnnotation"), - optional: true - }, - default: { - validate: (0, _utils.assertNodeType)("Flow"), - optional: true - } + name: (0, _utils.validate)((0, _utils.assertValueType)("string")), + bound: (0, _utils.validateOptionalType)("TypeAnnotation"), + default: (0, _utils.validateOptionalType)("FlowType"), + variance: (0, _utils.validateOptionalType)("Variance") } }); (0, _utils.default)("TypeParameterDeclaration", { aliases: ["Flow"], visitor: ["params"], fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TypeParameter"))) - } + params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter")) } }); (0, _utils.default)("TypeParameterInstantiation", { aliases: ["Flow"], visitor: ["params"], fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Flow"))) - } + params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) } }); (0, _utils.default)("UnionTypeAnnotation", { visitor: ["types"], + aliases: ["Flow", "FlowType"], + fields: { + types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) + } +}); +(0, _utils.default)("Variance", { aliases: ["Flow"], - fields: {} + builder: ["kind"], + fields: { + kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) + } }); (0, _utils.default)("VoidTypeAnnotation", { - aliases: ["Flow", "FlowBaseAnnotation"], - fields: {} + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js index a0bbfb84678026..ddb9e5101f3e50 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js @@ -1,9 +1,55 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "VISITOR_KEYS", { + enumerable: true, + get: function () { + return _utils.VISITOR_KEYS; + } +}); +Object.defineProperty(exports, "ALIAS_KEYS", { + enumerable: true, + get: function () { + return _utils.ALIAS_KEYS; + } +}); +Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", { + enumerable: true, + get: function () { + return _utils.FLIPPED_ALIAS_KEYS; + } +}); +Object.defineProperty(exports, "NODE_FIELDS", { + enumerable: true, + get: function () { + return _utils.NODE_FIELDS; + } +}); +Object.defineProperty(exports, "BUILDER_KEYS", { + enumerable: true, + get: function () { + return _utils.BUILDER_KEYS; + } +}); +Object.defineProperty(exports, "DEPRECATED_KEYS", { + enumerable: true, + get: function () { + return _utils.DEPRECATED_KEYS; + } +}); exports.TYPES = void 0; -var _toFastProperties = _interopRequireDefault(require("to-fast-properties")); +function _toFastProperties() { + const data = _interopRequireDefault(require("to-fast-properties")); + + _toFastProperties = function () { + return data; + }; + + return data; +} require("./core"); @@ -21,20 +67,13 @@ require("./typescript"); var _utils = require("./utils"); -exports.VISITOR_KEYS = _utils.VISITOR_KEYS; -exports.ALIAS_KEYS = _utils.ALIAS_KEYS; -exports.FLIPPED_ALIAS_KEYS = _utils.FLIPPED_ALIAS_KEYS; -exports.NODE_FIELDS = _utils.NODE_FIELDS; -exports.BUILDER_KEYS = _utils.BUILDER_KEYS; -exports.DEPRECATED_KEYS = _utils.DEPRECATED_KEYS; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -(0, _toFastProperties.default)(_utils.VISITOR_KEYS); -(0, _toFastProperties.default)(_utils.ALIAS_KEYS); -(0, _toFastProperties.default)(_utils.FLIPPED_ALIAS_KEYS); -(0, _toFastProperties.default)(_utils.NODE_FIELDS); -(0, _toFastProperties.default)(_utils.BUILDER_KEYS); -(0, _toFastProperties.default)(_utils.DEPRECATED_KEYS); -var TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); +(0, _toFastProperties().default)(_utils.VISITOR_KEYS); +(0, _toFastProperties().default)(_utils.ALIAS_KEYS); +(0, _toFastProperties().default)(_utils.FLIPPED_ALIAS_KEYS); +(0, _toFastProperties().default)(_utils.NODE_FIELDS); +(0, _toFastProperties().default)(_utils.BUILDER_KEYS); +(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS); +const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); exports.TYPES = TYPES; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js index 0ed8978b12e168..60d37e98ca16ee 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js @@ -51,7 +51,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; aliases: ["JSX", "Immutable"], fields: { expression: { - validate: (0, _utils.assertNodeType)("Expression") + validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression") } } }); @@ -111,6 +111,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; }, attributes: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + optional: true } } }); 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 90dca181f26981..0e5f905512064c 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 @@ -8,49 +8,8 @@ var _es = require("./es2015"); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } -var bool = (0, _utils.assertValueType)("boolean"); - -function validate(validate) { - return { - validate: validate - }; -} - -function typeIs(typeName) { - return typeof typeName === "string" ? (0, _utils.assertNodeType)(typeName) : _utils.assertNodeType.apply(void 0, typeName); -} - -function validateType(name) { - return validate(typeIs(name)); -} - -function validateOptional(validate) { - return { - validate: validate, - optional: true - }; -} - -function validateOptionalType(typeName) { - return { - validate: typeIs(typeName), - optional: true - }; -} - -function arrayOf(elementType) { - return (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(elementType)); -} - -function arrayOfType(nodeTypeName) { - return arrayOf(typeIs(nodeTypeName)); -} - -function validateArrayOfType(nodeTypeName) { - return validate(arrayOfType(nodeTypeName)); -} - -var tSFunctionTypeAnnotationCommon = { +const bool = (0, _utils.assertValueType)("boolean"); +const tSFunctionTypeAnnotationCommon = { returnType: { validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"), optional: true @@ -90,34 +49,34 @@ var tSFunctionTypeAnnotationCommon = { aliases: ["TSEntityName"], visitor: ["left", "right"], fields: { - left: validateType("TSEntityName"), - right: validateType("Identifier") + left: (0, _utils.validateType)("TSEntityName"), + right: (0, _utils.validateType)("Identifier") } }); -var signatureDeclarationCommon = { - typeParameters: validateOptionalType("TSTypeParameterDeclaration"), - parameters: validateArrayOfType(["Identifier", "RestElement"]), - typeAnnotation: validateOptionalType("TSTypeAnnotation") +const signatureDeclarationCommon = { + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), + parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]), + typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") }; -var callConstructSignatureDeclaration = { +const callConstructSignatureDeclaration = { aliases: ["TSTypeElement"], visitor: ["typeParameters", "parameters", "typeAnnotation"], fields: signatureDeclarationCommon }; (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration); (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration); -var namedTypeElementCommon = { - key: validateType("Expression"), - computed: validate(bool), - optional: validateOptional(bool) +const namedTypeElementCommon = { + key: (0, _utils.validateType)("Expression"), + computed: (0, _utils.validate)(bool), + optional: (0, _utils.validateOptional)(bool) }; (0, _utils.default)("TSPropertySignature", { aliases: ["TSTypeElement"], visitor: ["key", "typeAnnotation", "initializer"], fields: Object.assign({}, namedTypeElementCommon, { - readonly: validateOptional(bool), - typeAnnotation: validateOptionalType("TSTypeAnnotation"), - initializer: validateOptionalType("Expression") + readonly: (0, _utils.validateOptional)(bool), + typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), + initializer: (0, _utils.validateOptionalType)("Expression") }) }); (0, _utils.default)("TSMethodSignature", { @@ -129,15 +88,14 @@ var namedTypeElementCommon = { aliases: ["TSTypeElement"], visitor: ["parameters", "typeAnnotation"], fields: { - readonly: validateOptional(bool), - parameters: validateArrayOfType("Identifier"), - typeAnnotation: validateOptionalType("TSTypeAnnotation") + readonly: (0, _utils.validateOptional)(bool), + parameters: (0, _utils.validateArrayOfType)("Identifier"), + typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") } }); -var tsKeywordTypes = ["TSAnyKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; +const tsKeywordTypes = ["TSAnyKeyword", "TSUnknownKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; -for (var _i = 0; _i < tsKeywordTypes.length; _i++) { - var type = tsKeywordTypes[_i]; +for (const type of tsKeywordTypes) { (0, _utils.default)(type, { aliases: ["TSType"], visitor: [], @@ -150,7 +108,7 @@ for (var _i = 0; _i < tsKeywordTypes.length; _i++) { visitor: [], fields: {} }); -var fnOrCtr = { +const fnOrCtr = { aliases: ["TSType"], visitor: ["typeParameters", "typeAnnotation"], fields: signatureDeclarationCommon @@ -161,214 +119,254 @@ var fnOrCtr = { aliases: ["TSType"], visitor: ["typeName", "typeParameters"], fields: { - typeName: validateType("TSEntityName"), - typeParameters: validateOptionalType("TSTypeParameterInstantiation") + typeName: (0, _utils.validateType)("TSEntityName"), + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); (0, _utils.default)("TSTypePredicate", { aliases: ["TSType"], visitor: ["parameterName", "typeAnnotation"], fields: { - parameterName: validateType(["Identifier", "TSThisType"]), - typeAnnotation: validateType("TSTypeAnnotation") + parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]), + typeAnnotation: (0, _utils.validateType)("TSTypeAnnotation") } }); (0, _utils.default)("TSTypeQuery", { aliases: ["TSType"], visitor: ["exprName"], fields: { - exprName: validateType("TSEntityName") + exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"]) } }); (0, _utils.default)("TSTypeLiteral", { aliases: ["TSType"], visitor: ["members"], fields: { - members: validateArrayOfType("TSTypeElement") + members: (0, _utils.validateArrayOfType)("TSTypeElement") } }); (0, _utils.default)("TSArrayType", { aliases: ["TSType"], visitor: ["elementType"], fields: { - elementType: validateType("TSType") + elementType: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSTupleType", { aliases: ["TSType"], visitor: ["elementTypes"], fields: { - elementTypes: validateArrayOfType("TSType") + elementTypes: (0, _utils.validateArrayOfType)("TSType") } }); -var unionOrIntersection = { +(0, _utils.default)("TSOptionalType", { + aliases: ["TSType"], + visitor: ["typeAnnotation"], + fields: { + typeAnnotation: (0, _utils.validateType)("TSType") + } +}); +(0, _utils.default)("TSRestType", { + aliases: ["TSType"], + visitor: ["typeAnnotation"], + fields: { + typeAnnotation: (0, _utils.validateType)("TSType") + } +}); +const unionOrIntersection = { aliases: ["TSType"], visitor: ["types"], fields: { - types: validateArrayOfType("TSType") + types: (0, _utils.validateArrayOfType)("TSType") } }; (0, _utils.default)("TSUnionType", unionOrIntersection); (0, _utils.default)("TSIntersectionType", unionOrIntersection); +(0, _utils.default)("TSConditionalType", { + aliases: ["TSType"], + visitor: ["checkType", "extendsType", "trueType", "falseType"], + fields: { + checkType: (0, _utils.validateType)("TSType"), + extendsType: (0, _utils.validateType)("TSType"), + trueType: (0, _utils.validateType)("TSType"), + falseType: (0, _utils.validateType)("TSType") + } +}); +(0, _utils.default)("TSInferType", { + aliases: ["TSType"], + visitor: ["typeParameter"], + fields: { + typeParameter: (0, _utils.validateType)("TSTypeParameter") + } +}); (0, _utils.default)("TSParenthesizedType", { aliases: ["TSType"], visitor: ["typeAnnotation"], fields: { - typeAnnotation: validateType("TSType") + typeAnnotation: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSTypeOperator", { aliases: ["TSType"], visitor: ["typeAnnotation"], fields: { - operator: validate((0, _utils.assertValueType)("string")), - typeAnnotation: validateType("TSType") + operator: (0, _utils.validate)((0, _utils.assertValueType)("string")), + typeAnnotation: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSIndexedAccessType", { aliases: ["TSType"], visitor: ["objectType", "indexType"], fields: { - objectType: validateType("TSType"), - indexType: validateType("TSType") + objectType: (0, _utils.validateType)("TSType"), + indexType: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSMappedType", { aliases: ["TSType"], visitor: ["typeParameter", "typeAnnotation"], fields: { - readonly: validateOptional(bool), - typeParameter: validateType("TSTypeParameter"), - optional: validateOptional(bool), - typeAnnotation: validateOptionalType("TSType") + readonly: (0, _utils.validateOptional)(bool), + typeParameter: (0, _utils.validateType)("TSTypeParameter"), + optional: (0, _utils.validateOptional)(bool), + typeAnnotation: (0, _utils.validateOptionalType)("TSType") } }); (0, _utils.default)("TSLiteralType", { aliases: ["TSType"], visitor: ["literal"], fields: { - literal: validateType(["NumericLiteral", "StringLiteral", "BooleanLiteral"]) + literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral"]) } }); (0, _utils.default)("TSExpressionWithTypeArguments", { aliases: ["TSType"], visitor: ["expression", "typeParameters"], fields: { - expression: validateType("TSEntityName"), - typeParameters: validateOptionalType("TSTypeParameterInstantiation") + expression: (0, _utils.validateType)("TSEntityName"), + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); (0, _utils.default)("TSInterfaceDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "typeParameters", "extends", "body"], fields: { - declare: validateOptional(bool), - id: validateType("Identifier"), - typeParameters: validateOptionalType("TSTypeParameterDeclaration"), - extends: validateOptional(arrayOfType("TSExpressionWithTypeArguments")), - body: validateType("TSInterfaceBody") + declare: (0, _utils.validateOptional)(bool), + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), + extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")), + body: (0, _utils.validateType)("TSInterfaceBody") } }); (0, _utils.default)("TSInterfaceBody", { visitor: ["body"], fields: { - body: validateArrayOfType("TSTypeElement") + body: (0, _utils.validateArrayOfType)("TSTypeElement") } }); (0, _utils.default)("TSTypeAliasDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "typeParameters", "typeAnnotation"], fields: { - declare: validateOptional(bool), - id: validateType("Identifier"), - typeParameters: validateOptionalType("TSTypeParameterDeclaration"), - typeAnnotation: validateType("TSType") + declare: (0, _utils.validateOptional)(bool), + id: (0, _utils.validateType)("Identifier"), + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), + typeAnnotation: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSAsExpression", { aliases: ["Expression"], visitor: ["expression", "typeAnnotation"], fields: { - expression: validateType("Expression"), - typeAnnotation: validateType("TSType") + expression: (0, _utils.validateType)("Expression"), + typeAnnotation: (0, _utils.validateType)("TSType") } }); (0, _utils.default)("TSTypeAssertion", { aliases: ["Expression"], visitor: ["typeAnnotation", "expression"], fields: { - typeAnnotation: validateType("TSType"), - expression: validateType("Expression") + typeAnnotation: (0, _utils.validateType)("TSType"), + expression: (0, _utils.validateType)("Expression") } }); (0, _utils.default)("TSEnumDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "members"], fields: { - declare: validateOptional(bool), - const: validateOptional(bool), - id: validateType("Identifier"), - members: validateArrayOfType("TSEnumMember"), - initializer: validateOptionalType("Expression") + declare: (0, _utils.validateOptional)(bool), + const: (0, _utils.validateOptional)(bool), + id: (0, _utils.validateType)("Identifier"), + members: (0, _utils.validateArrayOfType)("TSEnumMember"), + initializer: (0, _utils.validateOptionalType)("Expression") } }); (0, _utils.default)("TSEnumMember", { visitor: ["id", "initializer"], fields: { - id: validateType(["Identifier", "StringLiteral"]), - initializer: validateOptionalType("Expression") + id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), + initializer: (0, _utils.validateOptionalType)("Expression") } }); (0, _utils.default)("TSModuleDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "body"], fields: { - declare: validateOptional(bool), - global: validateOptional(bool), - id: validateType(["Identifier", "StringLiteral"]), - body: validateType(["TSModuleBlock", "TSModuleDeclaration"]) + declare: (0, _utils.validateOptional)(bool), + global: (0, _utils.validateOptional)(bool), + id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), + body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"]) } }); (0, _utils.default)("TSModuleBlock", { visitor: ["body"], fields: { - body: validateArrayOfType("Statement") + body: (0, _utils.validateArrayOfType)("Statement") + } +}); +(0, _utils.default)("TSImportType", { + aliases: ["TSType"], + visitor: ["argument", "qualifier", "typeParameters"], + fields: { + argument: (0, _utils.validateType)("StringLiteral"), + qualifier: (0, _utils.validateOptionalType)("TSEntityName"), + typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); (0, _utils.default)("TSImportEqualsDeclaration", { aliases: ["Statement"], visitor: ["id", "moduleReference"], fields: { - isExport: validate(bool), - id: validateType("Identifier"), - moduleReference: validateType(["TSEntityName", "TSExternalModuleReference"]) + isExport: (0, _utils.validate)(bool), + id: (0, _utils.validateType)("Identifier"), + moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]) } }); (0, _utils.default)("TSExternalModuleReference", { visitor: ["expression"], fields: { - expression: validateType("StringLiteral") + expression: (0, _utils.validateType)("StringLiteral") } }); (0, _utils.default)("TSNonNullExpression", { aliases: ["Expression"], visitor: ["expression"], fields: { - expression: validateType("Expression") + expression: (0, _utils.validateType)("Expression") } }); (0, _utils.default)("TSExportAssignment", { aliases: ["Statement"], visitor: ["expression"], fields: { - expression: validateType("Expression") + expression: (0, _utils.validateType)("Expression") } }); (0, _utils.default)("TSNamespaceExportDeclaration", { aliases: ["Statement"], visitor: ["id"], fields: { - id: validateType("Identifier") + id: (0, _utils.validateType)("Identifier") } }); (0, _utils.default)("TSTypeAnnotation", { 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 6d323768cea5c0..c8fee08c52c033 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 @@ -1,6 +1,16 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.typeIs = typeIs; +exports.validateType = validateType; +exports.validateOptional = validateOptional; +exports.validateOptionalType = validateOptionalType; +exports.arrayOf = arrayOf; +exports.arrayOfType = arrayOfType; +exports.validateArrayOfType = validateArrayOfType; exports.assertEach = assertEach; exports.assertOneOf = assertOneOf; exports.assertNodeType = assertNodeType; @@ -14,17 +24,17 @@ var _is = _interopRequireDefault(require("../validators/is")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var VISITOR_KEYS = {}; +const VISITOR_KEYS = {}; exports.VISITOR_KEYS = VISITOR_KEYS; -var ALIAS_KEYS = {}; +const ALIAS_KEYS = {}; exports.ALIAS_KEYS = ALIAS_KEYS; -var FLIPPED_ALIAS_KEYS = {}; +const FLIPPED_ALIAS_KEYS = {}; exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS; -var NODE_FIELDS = {}; +const NODE_FIELDS = {}; exports.NODE_FIELDS = NODE_FIELDS; -var BUILDER_KEYS = {}; +const BUILDER_KEYS = {}; exports.BUILDER_KEYS = BUILDER_KEYS; -var DEPRECATED_KEYS = {}; +const DEPRECATED_KEYS = {}; exports.DEPRECATED_KEYS = DEPRECATED_KEYS; function getType(val) { @@ -39,12 +49,52 @@ function getType(val) { } } +function validate(validate) { + return { + validate + }; +} + +function typeIs(typeName) { + return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName); +} + +function validateType(typeName) { + return validate(typeIs(typeName)); +} + +function validateOptional(validate) { + return { + validate, + optional: true + }; +} + +function validateOptionalType(typeName) { + return { + validate: typeIs(typeName), + optional: true + }; +} + +function arrayOf(elementType) { + return chain(assertValueType("array"), assertEach(elementType)); +} + +function arrayOfType(typeName) { + return arrayOf(typeIs(typeName)); +} + +function validateArrayOfType(typeName) { + return validate(arrayOfType(typeName)); +} + function assertEach(callback) { function validator(node, key, val) { if (!Array.isArray(val)) return; - for (var i = 0; i < val.length; i++) { - callback(node, key + "[" + i + "]", val[i]); + for (let i = 0; i < val.length; i++) { + callback(node, `${key}[${i}]`, val[i]); } } @@ -52,14 +102,10 @@ function assertEach(callback) { return validator; } -function assertOneOf() { - for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { - values[_key] = arguments[_key]; - } - +function assertOneOf(...values) { function validate(node, key, val) { if (values.indexOf(val) < 0) { - throw new TypeError("Property " + key + " expected value to be one of " + JSON.stringify(values) + " but got " + JSON.stringify(val)); + throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`); } } @@ -67,17 +113,11 @@ function assertOneOf() { return validate; } -function assertNodeType() { - for (var _len2 = arguments.length, types = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - types[_key2] = arguments[_key2]; - } - +function assertNodeType(...types) { function validate(node, key, val) { - var valid = false; - - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; + let valid = false; + for (const type of types) { if ((0, _is.default)(type, val)) { valid = true; break; @@ -85,7 +125,7 @@ function assertNodeType() { } if (!valid) { - throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type))); + throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); } } @@ -93,17 +133,11 @@ function assertNodeType() { return validate; } -function assertNodeOrValueType() { - for (var _len3 = arguments.length, types = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - types[_key3] = arguments[_key3]; - } - +function assertNodeOrValueType(...types) { function validate(node, key, val) { - var valid = false; - - for (var _i2 = 0; _i2 < types.length; _i2++) { - var type = types[_i2]; + let valid = false; + for (const type of types) { if (getType(val) === type || (0, _is.default)(type, val)) { valid = true; break; @@ -111,7 +145,7 @@ function assertNodeOrValueType() { } if (!valid) { - throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type))); + throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); } } @@ -121,10 +155,10 @@ function assertNodeOrValueType() { function assertValueType(type) { function validate(node, key, val) { - var valid = getType(val) === type; + const valid = getType(val) === type; if (!valid) { - throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val)); + throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`); } } @@ -132,15 +166,10 @@ function assertValueType(type) { return validate; } -function chain() { - for (var _len4 = arguments.length, fns = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - fns[_key4] = arguments[_key4]; - } - - function validate() { - for (var _i3 = 0; _i3 < fns.length; _i3++) { - var fn = fns[_i3]; - fn.apply(void 0, arguments); +function chain(...fns) { + function validate(...args) { + for (const fn of fns) { + fn(...args); } } @@ -148,32 +177,25 @@ function chain() { return validate; } -function defineType(type, opts) { - if (opts === void 0) { - opts = {}; - } - - var inherits = opts.inherits && store[opts.inherits] || {}; - var fields = opts.fields || inherits.fields || {}; - var visitor = opts.visitor || inherits.visitor || []; - var aliases = opts.aliases || inherits.aliases || []; - var builder = opts.builder || inherits.builder || opts.visitor || []; +function defineType(type, opts = {}) { + const inherits = opts.inherits && store[opts.inherits] || {}; + const fields = opts.fields || inherits.fields || {}; + const visitor = opts.visitor || inherits.visitor || []; + const aliases = opts.aliases || inherits.aliases || []; + const builder = opts.builder || inherits.builder || opts.visitor || []; if (opts.deprecatedAlias) { DEPRECATED_KEYS[opts.deprecatedAlias] = type; } - var _arr = visitor.concat(builder); - - for (var _i4 = 0; _i4 < _arr.length; _i4++) { - var key = _arr[_i4]; + for (const key of visitor.concat(builder)) { fields[key] = fields[key] || {}; } - for (var _key5 in fields) { - var field = fields[_key5]; + for (const key in fields) { + const field = fields[key]; - if (builder.indexOf(_key5) === -1) { + if (builder.indexOf(key) === -1) { field.optional = true; } @@ -188,11 +210,11 @@ function defineType(type, opts) { BUILDER_KEYS[type] = opts.builder = builder; NODE_FIELDS[type] = opts.fields = fields; ALIAS_KEYS[type] = opts.aliases = aliases; - aliases.forEach(function (alias) { + aliases.forEach(alias => { FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; FLIPPED_ALIAS_KEYS[alias].push(type); }); store[type] = opts; } -var store = {}; \ No newline at end of file +const store = {}; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.d.ts b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.d.ts new file mode 100644 index 00000000000000..753269b8360331 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.d.ts @@ -0,0 +1,2058 @@ +// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/typescript.js for script used. + +interface BaseComment { + value: string; + start: number; + end: number; + loc: SourceLocation; + type: "CommentBlock" | "CommentLine"; +} + +export interface CommentBlock extends BaseComment { + type: "CommentBlock"; +} + +export interface CommentLine extends BaseComment { + type: "CommentLine"; +} + +export type Comment = CommentBlock | CommentLine; + +export interface SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +interface BaseNode { + leadingComments: ReadonlyArray | null; + innerComments: ReadonlyArray | null; + trailingComments: ReadonlyArray | null; + start: number | null; + end: number | null; + loc: SourceLocation | null; + type: Node["type"]; +} + +export type Node = AnyTypeAnnotation | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | MemberExpression | MetaProperty | Method | MixedTypeAnnotation | ModuleDeclaration | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | SequenceExpression | SpreadElement | SpreadProperty | Statement | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | TSAnyKeyword | TSArrayType | TSAsExpression | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TryStatement | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression; + +export interface ArrayExpression extends BaseNode { + type: "ArrayExpression"; + elements: Array; +} + +export interface AssignmentExpression extends BaseNode { + type: "AssignmentExpression"; + operator: string; + left: LVal; + right: Expression; +} + +export interface BinaryExpression extends BaseNode { + type: "BinaryExpression"; + operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; + left: Expression; + right: Expression; +} + +export interface InterpreterDirective extends BaseNode { + type: "InterpreterDirective"; + value: string; +} + +export interface Directive extends BaseNode { + type: "Directive"; + value: DirectiveLiteral; +} + +export interface DirectiveLiteral extends BaseNode { + type: "DirectiveLiteral"; + value: string; +} + +export interface BlockStatement extends BaseNode { + type: "BlockStatement"; + body: Array; + directives: Array; +} + +export interface BreakStatement extends BaseNode { + type: "BreakStatement"; + label: Identifier | null; +} + +export interface CallExpression extends BaseNode { + type: "CallExpression"; + callee: Expression; + arguments: Array; + optional: true | false | null; + typeArguments: TypeParameterInstantiation | null; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface CatchClause extends BaseNode { + type: "CatchClause"; + param: Identifier | null; + body: BlockStatement; +} + +export interface ConditionalExpression extends BaseNode { + type: "ConditionalExpression"; + test: Expression; + consequent: Expression; + alternate: Expression; +} + +export interface ContinueStatement extends BaseNode { + type: "ContinueStatement"; + label: Identifier | null; +} + +export interface DebuggerStatement extends BaseNode { + type: "DebuggerStatement"; +} + +export interface DoWhileStatement extends BaseNode { + type: "DoWhileStatement"; + test: Expression; + body: Statement; +} + +export interface EmptyStatement extends BaseNode { + type: "EmptyStatement"; +} + +export interface ExpressionStatement extends BaseNode { + type: "ExpressionStatement"; + expression: Expression; +} + +export interface File extends BaseNode { + type: "File"; + program: Program; + comments: any; + tokens: any; +} + +export interface ForInStatement extends BaseNode { + type: "ForInStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; +} + +export interface ForStatement extends BaseNode { + type: "ForStatement"; + init: VariableDeclaration | Expression | null; + test: Expression | null; + update: Expression | null; + body: Statement; +} + +export interface FunctionDeclaration extends BaseNode { + type: "FunctionDeclaration"; + id: Identifier | null; + params: Array; + body: BlockStatement; + generator: boolean; + async: boolean; + declare: boolean | null; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface FunctionExpression extends BaseNode { + type: "FunctionExpression"; + id: Identifier | null; + params: Array; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface Identifier extends BaseNode { + type: "Identifier"; + name: string; + decorators: Array | null; + optional: boolean | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; +} + +export interface IfStatement extends BaseNode { + type: "IfStatement"; + test: Expression; + consequent: Statement; + alternate: Statement | null; +} + +export interface LabeledStatement extends BaseNode { + type: "LabeledStatement"; + label: Identifier; + body: Statement; +} + +export interface StringLiteral extends BaseNode { + type: "StringLiteral"; + value: string; +} + +export interface NumericLiteral extends BaseNode { + type: "NumericLiteral"; + value: number; +} + +export interface NullLiteral extends BaseNode { + type: "NullLiteral"; +} + +export interface BooleanLiteral extends BaseNode { + type: "BooleanLiteral"; + value: boolean; +} + +export interface RegExpLiteral extends BaseNode { + type: "RegExpLiteral"; + pattern: string; + flags: string; +} + +export interface LogicalExpression extends BaseNode { + type: "LogicalExpression"; + operator: "||" | "&&" | "??"; + left: Expression; + right: Expression; +} + +export interface MemberExpression extends BaseNode { + type: "MemberExpression"; + object: Expression; + property: any; + computed: boolean; + optional: true | false | null; +} + +export interface NewExpression extends BaseNode { + type: "NewExpression"; + callee: Expression; + arguments: Array; + optional: true | false | null; + typeArguments: TypeParameterInstantiation | null; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface Program extends BaseNode { + type: "Program"; + body: Array; + directives: Array; + sourceType: "script" | "module"; + interpreter: InterpreterDirective | null; + sourceFile: string | null; +} + +export interface ObjectExpression extends BaseNode { + type: "ObjectExpression"; + properties: Array; +} + +export interface ObjectMethod extends BaseNode { + type: "ObjectMethod"; + kind: "method" | "get" | "set"; + key: any; + params: Array; + body: BlockStatement; + computed: boolean; + async: boolean; + decorators: Array | null; + generator: boolean; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface ObjectProperty extends BaseNode { + type: "ObjectProperty"; + key: any; + value: Expression | PatternLike; + computed: boolean; + shorthand: boolean; + decorators: Array | null; +} + +export interface RestElement extends BaseNode { + type: "RestElement"; + argument: LVal; + decorators: Array | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; +} + +export interface ReturnStatement extends BaseNode { + type: "ReturnStatement"; + argument: Expression | null; +} + +export interface SequenceExpression extends BaseNode { + type: "SequenceExpression"; + expressions: Array; +} + +export interface SwitchCase extends BaseNode { + type: "SwitchCase"; + test: Expression | null; + consequent: Array; +} + +export interface SwitchStatement extends BaseNode { + type: "SwitchStatement"; + discriminant: Expression; + cases: Array; +} + +export interface ThisExpression extends BaseNode { + type: "ThisExpression"; +} + +export interface ThrowStatement extends BaseNode { + type: "ThrowStatement"; + argument: Expression; +} + +export interface TryStatement extends BaseNode { + type: "TryStatement"; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement | null; +} + +export interface UnaryExpression extends BaseNode { + type: "UnaryExpression"; + operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"; + argument: Expression; + prefix: boolean; +} + +export interface UpdateExpression extends BaseNode { + type: "UpdateExpression"; + operator: "++" | "--"; + argument: Expression; + prefix: boolean; +} + +export interface VariableDeclaration extends BaseNode { + type: "VariableDeclaration"; + kind: "var" | "let" | "const"; + declarations: Array; + declare: boolean | null; +} + +export interface VariableDeclarator extends BaseNode { + type: "VariableDeclarator"; + id: LVal; + init: Expression | null; + definite: boolean | null; +} + +export interface WhileStatement extends BaseNode { + type: "WhileStatement"; + test: Expression; + body: BlockStatement | Statement; +} + +export interface WithStatement extends BaseNode { + type: "WithStatement"; + object: Expression; + body: BlockStatement | Statement; +} + +export interface AssignmentPattern extends BaseNode { + type: "AssignmentPattern"; + left: Identifier | ObjectPattern | ArrayPattern; + right: Expression; + decorators: Array | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; +} + +export interface ArrayPattern extends BaseNode { + type: "ArrayPattern"; + elements: Array; + decorators: Array | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; +} + +export interface ArrowFunctionExpression extends BaseNode { + type: "ArrowFunctionExpression"; + params: Array; + body: BlockStatement | Expression; + async: boolean; + expression: boolean | null; + generator: boolean; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface ClassBody extends BaseNode { + type: "ClassBody"; + body: Array; +} + +export interface ClassDeclaration extends BaseNode { + type: "ClassDeclaration"; + id: Identifier | null; + superClass: Expression | null; + body: ClassBody; + decorators: Array | null; + abstract: boolean | null; + declare: boolean | null; + implements: Array | null; + mixins: any | null; + superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface ClassExpression extends BaseNode { + type: "ClassExpression"; + id: Identifier | null; + superClass: Expression | null; + body: ClassBody; + decorators: Array | null; + implements: Array | null; + mixins: any | null; + superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface ExportAllDeclaration extends BaseNode { + type: "ExportAllDeclaration"; + source: StringLiteral; +} + +export interface ExportDefaultDeclaration extends BaseNode { + type: "ExportDefaultDeclaration"; + declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression; +} + +export interface ExportNamedDeclaration extends BaseNode { + type: "ExportNamedDeclaration"; + declaration: Declaration | null; + specifiers: Array; + source: StringLiteral | null; +} + +export interface ExportSpecifier extends BaseNode { + type: "ExportSpecifier"; + local: Identifier; + exported: Identifier; +} + +export interface ForOfStatement extends BaseNode { + type: "ForOfStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; + await: boolean; +} + +export interface ImportDeclaration extends BaseNode { + type: "ImportDeclaration"; + specifiers: Array; + source: StringLiteral; + importKind: "type" | "typeof" | "value" | null; +} + +export interface ImportDefaultSpecifier extends BaseNode { + type: "ImportDefaultSpecifier"; + local: Identifier; +} + +export interface ImportNamespaceSpecifier extends BaseNode { + type: "ImportNamespaceSpecifier"; + local: Identifier; +} + +export interface ImportSpecifier extends BaseNode { + type: "ImportSpecifier"; + local: Identifier; + imported: Identifier; + importKind: "type" | "typeof" | null; +} + +export interface MetaProperty extends BaseNode { + type: "MetaProperty"; + meta: Identifier; + property: Identifier; +} + +export interface ClassMethod extends BaseNode { + type: "ClassMethod"; + kind: "get" | "set" | "method" | "constructor"; + key: Identifier | StringLiteral | NumericLiteral | Expression; + params: Array; + body: BlockStatement; + computed: boolean; + static: boolean | null; + abstract: boolean | null; + access: "public" | "private" | "protected" | null; + accessibility: "public" | "private" | "protected" | null; + async: boolean; + decorators: Array | null; + generator: boolean; + optional: boolean | null; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; +} + +export interface ObjectPattern extends BaseNode { + type: "ObjectPattern"; + properties: Array; + decorators: Array | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; +} + +export interface SpreadElement extends BaseNode { + type: "SpreadElement"; + argument: Expression; +} + +export interface Super extends BaseNode { + type: "Super"; +} + +export interface TaggedTemplateExpression extends BaseNode { + type: "TaggedTemplateExpression"; + tag: Expression; + quasi: TemplateLiteral; + typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; +} + +export interface TemplateElement extends BaseNode { + type: "TemplateElement"; + value: any; + tail: boolean; +} + +export interface TemplateLiteral extends BaseNode { + type: "TemplateLiteral"; + quasis: Array; + expressions: Array; +} + +export interface YieldExpression extends BaseNode { + type: "YieldExpression"; + argument: Expression | null; + delegate: boolean; +} + +export interface AnyTypeAnnotation extends BaseNode { + type: "AnyTypeAnnotation"; +} + +export interface ArrayTypeAnnotation extends BaseNode { + type: "ArrayTypeAnnotation"; + elementType: FlowType; +} + +export interface BooleanTypeAnnotation extends BaseNode { + type: "BooleanTypeAnnotation"; +} + +export interface BooleanLiteralTypeAnnotation extends BaseNode { + type: "BooleanLiteralTypeAnnotation"; + value: boolean; +} + +export interface NullLiteralTypeAnnotation extends BaseNode { + type: "NullLiteralTypeAnnotation"; +} + +export interface ClassImplements extends BaseNode { + type: "ClassImplements"; + id: Identifier; + typeParameters: TypeParameterInstantiation | null; +} + +export interface DeclareClass extends BaseNode { + type: "DeclareClass"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + extends: Array | null; + body: ObjectTypeAnnotation; + implements: Array | null; + mixins: Array | null; +} + +export interface DeclareFunction extends BaseNode { + type: "DeclareFunction"; + id: Identifier; + predicate: DeclaredPredicate | null; +} + +export interface DeclareInterface extends BaseNode { + type: "DeclareInterface"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + extends: Array | null; + body: ObjectTypeAnnotation; + implements: Array | null; + mixins: Array | null; +} + +export interface DeclareModule extends BaseNode { + type: "DeclareModule"; + id: Identifier | StringLiteral; + body: BlockStatement; + kind: "CommonJS" | "ES" | null; +} + +export interface DeclareModuleExports extends BaseNode { + type: "DeclareModuleExports"; + typeAnnotation: TypeAnnotation; +} + +export interface DeclareTypeAlias extends BaseNode { + type: "DeclareTypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + right: FlowType; +} + +export interface DeclareOpaqueType extends BaseNode { + type: "DeclareOpaqueType"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + supertype: FlowType | null; +} + +export interface DeclareVariable extends BaseNode { + type: "DeclareVariable"; + id: Identifier; +} + +export interface DeclareExportDeclaration extends BaseNode { + type: "DeclareExportDeclaration"; + declaration: Flow | null; + specifiers: Array | null; + source: StringLiteral | null; + default: boolean | null; +} + +export interface DeclareExportAllDeclaration extends BaseNode { + type: "DeclareExportAllDeclaration"; + source: StringLiteral; + exportKind: ["type","value"] | null; +} + +export interface DeclaredPredicate extends BaseNode { + type: "DeclaredPredicate"; + value: Flow; +} + +export interface ExistsTypeAnnotation extends BaseNode { + type: "ExistsTypeAnnotation"; +} + +export interface FunctionTypeAnnotation extends BaseNode { + type: "FunctionTypeAnnotation"; + typeParameters: TypeParameterDeclaration | null; + params: Array; + rest: FunctionTypeParam | null; + returnType: FlowType; +} + +export interface FunctionTypeParam extends BaseNode { + type: "FunctionTypeParam"; + name: Identifier | null; + typeAnnotation: FlowType; + optional: boolean | null; +} + +export interface GenericTypeAnnotation extends BaseNode { + type: "GenericTypeAnnotation"; + id: Identifier | QualifiedTypeIdentifier; + typeParameters: TypeParameterInstantiation | null; +} + +export interface InferredPredicate extends BaseNode { + type: "InferredPredicate"; +} + +export interface InterfaceExtends extends BaseNode { + type: "InterfaceExtends"; + id: Identifier | QualifiedTypeIdentifier; + typeParameters: TypeParameterInstantiation | null; +} + +export interface InterfaceDeclaration extends BaseNode { + type: "InterfaceDeclaration"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + extends: Array | null; + body: ObjectTypeAnnotation; + implements: Array | null; + mixins: Array | null; +} + +export interface InterfaceTypeAnnotation extends BaseNode { + type: "InterfaceTypeAnnotation"; + extends: Array | null; + body: ObjectTypeAnnotation; +} + +export interface IntersectionTypeAnnotation extends BaseNode { + type: "IntersectionTypeAnnotation"; + types: Array; +} + +export interface MixedTypeAnnotation extends BaseNode { + type: "MixedTypeAnnotation"; +} + +export interface EmptyTypeAnnotation extends BaseNode { + type: "EmptyTypeAnnotation"; +} + +export interface NullableTypeAnnotation extends BaseNode { + type: "NullableTypeAnnotation"; + typeAnnotation: FlowType; +} + +export interface NumberLiteralTypeAnnotation extends BaseNode { + type: "NumberLiteralTypeAnnotation"; + value: number; +} + +export interface NumberTypeAnnotation extends BaseNode { + type: "NumberTypeAnnotation"; +} + +export interface ObjectTypeAnnotation extends BaseNode { + type: "ObjectTypeAnnotation"; + properties: Array; + indexers: Array | null; + callProperties: Array | null; + internalSlots: Array | null; + exact: boolean; + inexact: boolean | null; +} + +export interface ObjectTypeInternalSlot extends BaseNode { + type: "ObjectTypeInternalSlot"; + id: Identifier; + value: FlowType; + optional: boolean; + static: boolean; + method: boolean; +} + +export interface ObjectTypeCallProperty extends BaseNode { + type: "ObjectTypeCallProperty"; + value: FlowType; + static: boolean | null; +} + +export interface ObjectTypeIndexer extends BaseNode { + type: "ObjectTypeIndexer"; + id: Identifier | null; + key: FlowType; + value: FlowType; + variance: Variance | null; + static: boolean | null; +} + +export interface ObjectTypeProperty extends BaseNode { + type: "ObjectTypeProperty"; + key: Identifier | StringLiteral; + value: FlowType; + variance: Variance | null; + kind: "init" | "get" | "set" | null; + optional: boolean | null; + proto: boolean | null; + static: boolean | null; +} + +export interface ObjectTypeSpreadProperty extends BaseNode { + type: "ObjectTypeSpreadProperty"; + argument: FlowType; +} + +export interface OpaqueType extends BaseNode { + type: "OpaqueType"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + supertype: FlowType | null; + impltype: FlowType; +} + +export interface QualifiedTypeIdentifier extends BaseNode { + type: "QualifiedTypeIdentifier"; + id: Identifier; + qualification: Identifier | QualifiedTypeIdentifier; +} + +export interface StringLiteralTypeAnnotation extends BaseNode { + type: "StringLiteralTypeAnnotation"; + value: string; +} + +export interface StringTypeAnnotation extends BaseNode { + type: "StringTypeAnnotation"; +} + +export interface ThisTypeAnnotation extends BaseNode { + type: "ThisTypeAnnotation"; +} + +export interface TupleTypeAnnotation extends BaseNode { + type: "TupleTypeAnnotation"; + types: Array; +} + +export interface TypeofTypeAnnotation extends BaseNode { + type: "TypeofTypeAnnotation"; + argument: FlowType; +} + +export interface TypeAlias extends BaseNode { + type: "TypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + right: FlowType; +} + +export interface TypeAnnotation extends BaseNode { + type: "TypeAnnotation"; + typeAnnotation: FlowType; +} + +export interface TypeCastExpression extends BaseNode { + type: "TypeCastExpression"; + expression: Expression; + typeAnnotation: TypeAnnotation; +} + +export interface TypeParameter extends BaseNode { + type: "TypeParameter"; + bound: TypeAnnotation | null; + default: FlowType | null; + variance: Variance | null; + name: string | null; +} + +export interface TypeParameterDeclaration extends BaseNode { + type: "TypeParameterDeclaration"; + params: Array; +} + +export interface TypeParameterInstantiation extends BaseNode { + type: "TypeParameterInstantiation"; + params: Array; +} + +export interface UnionTypeAnnotation extends BaseNode { + type: "UnionTypeAnnotation"; + types: Array; +} + +export interface Variance extends BaseNode { + type: "Variance"; + kind: "minus" | "plus"; +} + +export interface VoidTypeAnnotation extends BaseNode { + type: "VoidTypeAnnotation"; +} + +export interface JSXAttribute extends BaseNode { + type: "JSXAttribute"; + name: JSXIdentifier | JSXNamespacedName; + value: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null; +} + +export interface JSXClosingElement extends BaseNode { + type: "JSXClosingElement"; + name: JSXIdentifier | JSXMemberExpression; +} + +export interface JSXElement extends BaseNode { + type: "JSXElement"; + openingElement: JSXOpeningElement; + closingElement: JSXClosingElement | null; + children: Array; + selfClosing: any; +} + +export interface JSXEmptyExpression extends BaseNode { + type: "JSXEmptyExpression"; +} + +export interface JSXExpressionContainer extends BaseNode { + type: "JSXExpressionContainer"; + expression: Expression | JSXEmptyExpression; +} + +export interface JSXSpreadChild extends BaseNode { + type: "JSXSpreadChild"; + expression: Expression; +} + +export interface JSXIdentifier extends BaseNode { + type: "JSXIdentifier"; + name: string; +} + +export interface JSXMemberExpression extends BaseNode { + type: "JSXMemberExpression"; + object: JSXMemberExpression | JSXIdentifier; + property: JSXIdentifier; +} + +export interface JSXNamespacedName extends BaseNode { + type: "JSXNamespacedName"; + namespace: JSXIdentifier; + name: JSXIdentifier; +} + +export interface JSXOpeningElement extends BaseNode { + type: "JSXOpeningElement"; + name: JSXIdentifier | JSXMemberExpression; + attributes: Array; + selfClosing: boolean; + typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; +} + +export interface JSXSpreadAttribute extends BaseNode { + type: "JSXSpreadAttribute"; + argument: Expression; +} + +export interface JSXText extends BaseNode { + type: "JSXText"; + value: string; +} + +export interface JSXFragment extends BaseNode { + type: "JSXFragment"; + openingFragment: JSXOpeningFragment; + closingFragment: JSXClosingFragment; + children: Array; +} + +export interface JSXOpeningFragment extends BaseNode { + type: "JSXOpeningFragment"; +} + +export interface JSXClosingFragment extends BaseNode { + type: "JSXClosingFragment"; +} + +export interface Noop extends BaseNode { + type: "Noop"; +} + +export interface ParenthesizedExpression extends BaseNode { + type: "ParenthesizedExpression"; + expression: Expression; +} + +export interface AwaitExpression extends BaseNode { + type: "AwaitExpression"; + argument: Expression; +} + +export interface BindExpression extends BaseNode { + type: "BindExpression"; + object: any; + callee: any; +} + +export interface ClassProperty extends BaseNode { + type: "ClassProperty"; + key: Identifier | StringLiteral | NumericLiteral | Expression; + value: Expression | null; + typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; + decorators: Array | null; + computed: boolean; + abstract: boolean | null; + accessibility: "public" | "private" | "protected" | null; + definite: boolean | null; + optional: boolean | null; + readonly: boolean | null; + static: boolean | null; +} + +export interface OptionalMemberExpression extends BaseNode { + type: "OptionalMemberExpression"; + object: Expression; + property: any; + computed: boolean; + optional: boolean; +} + +export interface PipelineTopicExpression extends BaseNode { + type: "PipelineTopicExpression"; + expression: Expression; +} + +export interface PipelineBareFunction extends BaseNode { + type: "PipelineBareFunction"; + callee: Expression; +} + +export interface PipelinePrimaryTopicReference extends BaseNode { + type: "PipelinePrimaryTopicReference"; +} + +export interface OptionalCallExpression extends BaseNode { + type: "OptionalCallExpression"; + callee: Expression; + arguments: Array; + optional: boolean; + typeArguments: TypeParameterInstantiation | null; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface ClassPrivateProperty extends BaseNode { + type: "ClassPrivateProperty"; + key: PrivateName; + value: Expression | null; +} + +export interface ClassPrivateMethod extends BaseNode { + type: "ClassPrivateMethod"; + kind: "get" | "set" | "method" | "constructor"; + key: PrivateName; + params: Array; + body: BlockStatement; + static: boolean | null; + abstract: boolean | null; + access: "public" | "private" | "protected" | null; + accessibility: "public" | "private" | "protected" | null; + async: boolean; + computed: boolean; + decorators: Array | null; + generator: boolean; + optional: boolean | null; + returnType: any | null; + typeParameters: any | null; +} + +export interface Import extends BaseNode { + type: "Import"; +} + +export interface Decorator extends BaseNode { + type: "Decorator"; + expression: Expression; +} + +export interface DoExpression extends BaseNode { + type: "DoExpression"; + body: BlockStatement; +} + +export interface ExportDefaultSpecifier extends BaseNode { + type: "ExportDefaultSpecifier"; + exported: Identifier; +} + +export interface ExportNamespaceSpecifier extends BaseNode { + type: "ExportNamespaceSpecifier"; + exported: Identifier; +} + +export interface PrivateName extends BaseNode { + type: "PrivateName"; + id: Identifier; +} + +export interface BigIntLiteral extends BaseNode { + type: "BigIntLiteral"; + value: string; +} + +export interface TSParameterProperty extends BaseNode { + type: "TSParameterProperty"; + parameter: Identifier | AssignmentPattern; + accessibility: "public" | "private" | "protected" | null; + readonly: boolean | null; +} + +export interface TSDeclareFunction extends BaseNode { + type: "TSDeclareFunction"; + id: Identifier | null; + typeParameters: TSTypeParameterDeclaration | Noop | null; + params: Array; + returnType: TSTypeAnnotation | Noop | null; + async: boolean; + declare: boolean | null; + generator: boolean; +} + +export interface TSDeclareMethod extends BaseNode { + type: "TSDeclareMethod"; + decorators: Array | null; + key: Identifier | StringLiteral | NumericLiteral | Expression; + typeParameters: TSTypeParameterDeclaration | Noop | null; + params: Array; + returnType: TSTypeAnnotation | Noop | null; + abstract: boolean | null; + access: "public" | "private" | "protected" | null; + accessibility: "public" | "private" | "protected" | null; + async: boolean; + computed: boolean; + generator: boolean; + kind: "get" | "set" | "method" | "constructor"; + optional: boolean | null; + static: boolean | null; +} + +export interface TSQualifiedName extends BaseNode { + type: "TSQualifiedName"; + left: TSEntityName; + right: Identifier; +} + +export interface TSCallSignatureDeclaration extends BaseNode { + type: "TSCallSignatureDeclaration"; + typeParameters: TSTypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; +} + +export interface TSConstructSignatureDeclaration extends BaseNode { + type: "TSConstructSignatureDeclaration"; + typeParameters: TSTypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; +} + +export interface TSPropertySignature extends BaseNode { + type: "TSPropertySignature"; + key: Expression; + typeAnnotation: TSTypeAnnotation | null; + initializer: Expression | null; + computed: boolean | null; + optional: boolean | null; + readonly: boolean | null; +} + +export interface TSMethodSignature extends BaseNode { + type: "TSMethodSignature"; + key: Expression; + typeParameters: TSTypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; + computed: boolean | null; + optional: boolean | null; +} + +export interface TSIndexSignature extends BaseNode { + type: "TSIndexSignature"; + parameters: Array; + typeAnnotation: TSTypeAnnotation | null; + readonly: boolean | null; +} + +export interface TSAnyKeyword extends BaseNode { + type: "TSAnyKeyword"; +} + +export interface TSUnknownKeyword extends BaseNode { + type: "TSUnknownKeyword"; +} + +export interface TSNumberKeyword extends BaseNode { + type: "TSNumberKeyword"; +} + +export interface TSObjectKeyword extends BaseNode { + type: "TSObjectKeyword"; +} + +export interface TSBooleanKeyword extends BaseNode { + type: "TSBooleanKeyword"; +} + +export interface TSStringKeyword extends BaseNode { + type: "TSStringKeyword"; +} + +export interface TSSymbolKeyword extends BaseNode { + type: "TSSymbolKeyword"; +} + +export interface TSVoidKeyword extends BaseNode { + type: "TSVoidKeyword"; +} + +export interface TSUndefinedKeyword extends BaseNode { + type: "TSUndefinedKeyword"; +} + +export interface TSNullKeyword extends BaseNode { + type: "TSNullKeyword"; +} + +export interface TSNeverKeyword extends BaseNode { + type: "TSNeverKeyword"; +} + +export interface TSThisType extends BaseNode { + type: "TSThisType"; +} + +export interface TSFunctionType extends BaseNode { + type: "TSFunctionType"; + typeParameters: TSTypeParameterDeclaration | null; + typeAnnotation: TSTypeAnnotation | null; + parameters: Array | null; +} + +export interface TSConstructorType extends BaseNode { + type: "TSConstructorType"; + typeParameters: TSTypeParameterDeclaration | null; + typeAnnotation: TSTypeAnnotation | null; + parameters: Array | null; +} + +export interface TSTypeReference extends BaseNode { + type: "TSTypeReference"; + typeName: TSEntityName; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface TSTypePredicate extends BaseNode { + type: "TSTypePredicate"; + parameterName: Identifier | TSThisType; + typeAnnotation: TSTypeAnnotation; +} + +export interface TSTypeQuery extends BaseNode { + type: "TSTypeQuery"; + exprName: TSEntityName | TSImportType; +} + +export interface TSTypeLiteral extends BaseNode { + type: "TSTypeLiteral"; + members: Array; +} + +export interface TSArrayType extends BaseNode { + type: "TSArrayType"; + elementType: TSType; +} + +export interface TSTupleType extends BaseNode { + type: "TSTupleType"; + elementTypes: Array; +} + +export interface TSOptionalType extends BaseNode { + type: "TSOptionalType"; + typeAnnotation: TSType; +} + +export interface TSRestType extends BaseNode { + type: "TSRestType"; + typeAnnotation: TSType; +} + +export interface TSUnionType extends BaseNode { + type: "TSUnionType"; + types: Array; +} + +export interface TSIntersectionType extends BaseNode { + type: "TSIntersectionType"; + types: Array; +} + +export interface TSConditionalType extends BaseNode { + type: "TSConditionalType"; + checkType: TSType; + extendsType: TSType; + trueType: TSType; + falseType: TSType; +} + +export interface TSInferType extends BaseNode { + type: "TSInferType"; + typeParameter: TSTypeParameter; +} + +export interface TSParenthesizedType extends BaseNode { + type: "TSParenthesizedType"; + typeAnnotation: TSType; +} + +export interface TSTypeOperator extends BaseNode { + type: "TSTypeOperator"; + typeAnnotation: TSType; + operator: string | null; +} + +export interface TSIndexedAccessType extends BaseNode { + type: "TSIndexedAccessType"; + objectType: TSType; + indexType: TSType; +} + +export interface TSMappedType extends BaseNode { + type: "TSMappedType"; + typeParameter: TSTypeParameter; + typeAnnotation: TSType | null; + optional: boolean | null; + readonly: boolean | null; +} + +export interface TSLiteralType extends BaseNode { + type: "TSLiteralType"; + literal: NumericLiteral | StringLiteral | BooleanLiteral; +} + +export interface TSExpressionWithTypeArguments extends BaseNode { + type: "TSExpressionWithTypeArguments"; + expression: TSEntityName; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface TSInterfaceDeclaration extends BaseNode { + type: "TSInterfaceDeclaration"; + id: Identifier; + typeParameters: TSTypeParameterDeclaration | null; + extends: Array | null; + body: TSInterfaceBody; + declare: boolean | null; +} + +export interface TSInterfaceBody extends BaseNode { + type: "TSInterfaceBody"; + body: Array; +} + +export interface TSTypeAliasDeclaration extends BaseNode { + type: "TSTypeAliasDeclaration"; + id: Identifier; + typeParameters: TSTypeParameterDeclaration | null; + typeAnnotation: TSType; + declare: boolean | null; +} + +export interface TSAsExpression extends BaseNode { + type: "TSAsExpression"; + expression: Expression; + typeAnnotation: TSType; +} + +export interface TSTypeAssertion extends BaseNode { + type: "TSTypeAssertion"; + typeAnnotation: TSType; + expression: Expression; +} + +export interface TSEnumDeclaration extends BaseNode { + type: "TSEnumDeclaration"; + id: Identifier; + members: Array; + const: boolean | null; + declare: boolean | null; + initializer: Expression | null; +} + +export interface TSEnumMember extends BaseNode { + type: "TSEnumMember"; + id: Identifier | StringLiteral; + initializer: Expression | null; +} + +export interface TSModuleDeclaration extends BaseNode { + type: "TSModuleDeclaration"; + id: Identifier | StringLiteral; + body: TSModuleBlock | TSModuleDeclaration; + declare: boolean | null; + global: boolean | null; +} + +export interface TSModuleBlock extends BaseNode { + type: "TSModuleBlock"; + body: Array; +} + +export interface TSImportType extends BaseNode { + type: "TSImportType"; + argument: StringLiteral; + qualifier: TSEntityName | null; + typeParameters: TSTypeParameterInstantiation | null; +} + +export interface TSImportEqualsDeclaration extends BaseNode { + type: "TSImportEqualsDeclaration"; + id: Identifier; + moduleReference: TSEntityName | TSExternalModuleReference; + isExport: boolean | null; +} + +export interface TSExternalModuleReference extends BaseNode { + type: "TSExternalModuleReference"; + expression: StringLiteral; +} + +export interface TSNonNullExpression extends BaseNode { + type: "TSNonNullExpression"; + expression: Expression; +} + +export interface TSExportAssignment extends BaseNode { + type: "TSExportAssignment"; + expression: Expression; +} + +export interface TSNamespaceExportDeclaration extends BaseNode { + type: "TSNamespaceExportDeclaration"; + id: Identifier; +} + +export interface TSTypeAnnotation extends BaseNode { + type: "TSTypeAnnotation"; + typeAnnotation: TSType; +} + +export interface TSTypeParameterInstantiation extends BaseNode { + type: "TSTypeParameterInstantiation"; + params: Array; +} + +export interface TSTypeParameterDeclaration extends BaseNode { + type: "TSTypeParameterDeclaration"; + params: Array; +} + +export interface TSTypeParameter extends BaseNode { + type: "TSTypeParameter"; + constraint: TSType | null; + default: TSType | null; + name: string | null; +} + +/** + * @deprecated Use `NumericLiteral` + */ +export type NumberLiteral = NumericLiteral; + +/** + * @deprecated Use `RegExpLiteral` + */ +export type RegexLiteral = RegExpLiteral; + +/** + * @deprecated Use `RestElement` + */ +export type RestProperty = RestElement; + +/** + * @deprecated Use `SpreadElement` + */ +export type SpreadProperty = SpreadElement; + +export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | TypeCastExpression | JSXElement | JSXFragment | ParenthesizedExpression | AwaitExpression | BindExpression | OptionalMemberExpression | PipelinePrimaryTopicReference | OptionalCallExpression | Import | DoExpression | BigIntLiteral | TSAsExpression | TSTypeAssertion | TSNonNullExpression; +export type Binary = BinaryExpression | LogicalExpression; +export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassDeclaration | ClassExpression | ForOfStatement | ClassMethod | ClassPrivateMethod; +export type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod; +export type Block = BlockStatement | Program; +export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | TSExportAssignment | TSNamespaceExportDeclaration; +export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; +export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; +export type Conditional = ConditionalExpression | IfStatement; +export type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement; +export type While = DoWhileStatement | WhileStatement; +export type ExpressionWrapper = ExpressionStatement | TypeCastExpression | ParenthesizedExpression; +export type For = ForInStatement | ForStatement | ForOfStatement; +export type ForXStatement = ForInStatement | ForOfStatement; +export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; +export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; +export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | ArrowFunctionExpression | ClassDeclaration | ClassExpression | BigIntLiteral; +export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration; +export type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; +export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty; +export type TSEntityName = Identifier | TSQualifiedName; +export type Literal = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral | BigIntLiteral; +export type Immutable = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXSpreadChild | JSXOpeningElement | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment | BigIntLiteral; +export type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty; +export type Method = ObjectMethod | ClassMethod | ClassPrivateMethod; +export type ObjectMember = ObjectMethod | ObjectProperty; +export type Property = ObjectProperty | ClassProperty | ClassPrivateProperty; +export type UnaryLike = UnaryExpression | SpreadElement; +export type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern; +export type Class = ClassDeclaration | ClassExpression; +export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration; +export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration; +export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier; +export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation; +export type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation; +export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation; +export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias; +export type FlowPredicate = DeclaredPredicate | InferredPredicate; +export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment; +export type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName; +export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature; +export type TSType = TSAnyKeyword | TSUnknownKeyword | TSNumberKeyword | TSObjectKeyword | TSBooleanKeyword | TSStringKeyword | TSSymbolKeyword | TSVoidKeyword | TSUndefinedKeyword | TSNullKeyword | TSNeverKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType; + +export interface Aliases { + Expression: Expression; + Binary: Binary; + Scopable: Scopable; + BlockParent: BlockParent; + Block: Block; + Statement: Statement; + Terminatorless: Terminatorless; + CompletionStatement: CompletionStatement; + Conditional: Conditional; + Loop: Loop; + While: While; + ExpressionWrapper: ExpressionWrapper; + For: For; + ForXStatement: ForXStatement; + Function: Function; + FunctionParent: FunctionParent; + Pureish: Pureish; + Declaration: Declaration; + PatternLike: PatternLike; + LVal: LVal; + TSEntityName: TSEntityName; + Literal: Literal; + Immutable: Immutable; + UserWhitespacable: UserWhitespacable; + Method: Method; + ObjectMember: ObjectMember; + Property: Property; + UnaryLike: UnaryLike; + Pattern: Pattern; + Class: Class; + ModuleDeclaration: ModuleDeclaration; + ExportDeclaration: ExportDeclaration; + ModuleSpecifier: ModuleSpecifier; + Flow: Flow; + FlowType: FlowType; + FlowBaseAnnotation: FlowBaseAnnotation; + FlowDeclaration: FlowDeclaration; + FlowPredicate: FlowPredicate; + JSX: JSX; + Private: Private; + TSTypeElement: TSTypeElement; + TSType: TSType; +} + +export function arrayExpression(elements?: Array): ArrayExpression; +export function assignmentExpression(operator: string, left: LVal, right: Expression): AssignmentExpression; +export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: Expression, right: Expression): BinaryExpression; +export function interpreterDirective(value: string): InterpreterDirective; +export function directive(value: DirectiveLiteral): Directive; +export function directiveLiteral(value: string): DirectiveLiteral; +export function blockStatement(body: Array, directives?: Array): BlockStatement; +export function breakStatement(label?: Identifier | null): BreakStatement; +export function callExpression(callee: Expression, _arguments: Array, optional?: true | false | null, typeArguments?: TypeParameterInstantiation | null, typeParameters?: TSTypeParameterInstantiation | null): CallExpression; +export function catchClause(param: Identifier | null | undefined, body: BlockStatement): CatchClause; +export function conditionalExpression(test: Expression, consequent: Expression, alternate: Expression): ConditionalExpression; +export function continueStatement(label?: Identifier | null): ContinueStatement; +export function debuggerStatement(): DebuggerStatement; +export function doWhileStatement(test: Expression, body: Statement): DoWhileStatement; +export function emptyStatement(): EmptyStatement; +export function expressionStatement(expression: Expression): ExpressionStatement; +export function file(program: Program, comments: any, tokens: any): File; +export function forInStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement): ForInStatement; +export function forStatement(init: VariableDeclaration | Expression | null | undefined, test: Expression | null | undefined, update: Expression | null | undefined, body: Statement): ForStatement; +export function functionDeclaration(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean, declare?: boolean | null, returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): FunctionDeclaration; +export function functionExpression(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean, returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): FunctionExpression; +export function identifier(name: string, decorators?: Array | null, optional?: boolean | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null): Identifier; +export function ifStatement(test: Expression, consequent: Statement, alternate?: Statement | null): IfStatement; +export function labeledStatement(label: Identifier, body: Statement): LabeledStatement; +export function stringLiteral(value: string): StringLiteral; +export function numericLiteral(value: number): NumericLiteral; +export function nullLiteral(): NullLiteral; +export function booleanLiteral(value: boolean): BooleanLiteral; +export function regExpLiteral(pattern: string, flags?: string): RegExpLiteral; +export function logicalExpression(operator: "||" | "&&" | "??", left: Expression, right: Expression): LogicalExpression; +export function memberExpression(object: Expression, property: any, computed?: boolean, optional?: true | false | null): MemberExpression; +export function newExpression(callee: Expression, _arguments: Array, optional?: true | false | null, typeArguments?: TypeParameterInstantiation | null, typeParameters?: TSTypeParameterInstantiation | null): NewExpression; +export function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null, sourceFile?: string | null): Program; +export function objectExpression(properties: Array): ObjectExpression; +export function objectMethod(kind: "method" | "get" | "set" | undefined, key: any, params: Array, body: BlockStatement, computed?: boolean, async?: boolean, decorators?: Array | null, generator?: boolean, returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): ObjectMethod; +export function objectProperty(key: any, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array | null): ObjectProperty; +export function restElement(argument: LVal, decorators?: Array | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null): RestElement; +export function returnStatement(argument?: Expression | null): ReturnStatement; +export function sequenceExpression(expressions: Array): SequenceExpression; +export function switchCase(test: Expression | null | undefined, consequent: Array): SwitchCase; +export function switchStatement(discriminant: Expression, cases: Array): SwitchStatement; +export function thisExpression(): ThisExpression; +export function throwStatement(argument: Expression): ThrowStatement; +export function tryStatement(block: BlockStatement, handler?: CatchClause | null, finalizer?: BlockStatement | null): TryStatement; +export function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: Expression, prefix?: boolean): UnaryExpression; +export function updateExpression(operator: "++" | "--", argument: Expression, prefix?: boolean): UpdateExpression; +export function variableDeclaration(kind: "var" | "let" | "const", declarations: Array, declare?: boolean | null): VariableDeclaration; +export function variableDeclarator(id: LVal, init?: Expression | null, definite?: boolean | null): VariableDeclarator; +export function whileStatement(test: Expression, body: BlockStatement | Statement): WhileStatement; +export function withStatement(object: Expression, body: BlockStatement | Statement): WithStatement; +export function assignmentPattern(left: Identifier | ObjectPattern | ArrayPattern, right: Expression, decorators?: Array | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null): AssignmentPattern; +export function arrayPattern(elements: Array, decorators?: Array | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null): ArrayPattern; +export function arrowFunctionExpression(params: Array, body: BlockStatement | Expression, async?: boolean, expression?: boolean | null, generator?: boolean, returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): ArrowFunctionExpression; +export function classBody(body: Array): ClassBody; +export function classDeclaration(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null, abstract?: boolean | null, declare?: boolean | null, _implements?: Array | null, mixins?: any | null, superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): ClassDeclaration; +export function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null, _implements?: Array | null, mixins?: any | null, superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): ClassExpression; +export function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration; +export function exportDefaultDeclaration(declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression): ExportDefaultDeclaration; +export function exportNamedDeclaration(declaration: Declaration | null | undefined, specifiers: Array, source?: StringLiteral | null): ExportNamedDeclaration; +export function exportSpecifier(local: Identifier, exported: Identifier): ExportSpecifier; +export function forOfStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement, _await?: boolean): ForOfStatement; +export function importDeclaration(specifiers: Array, source: StringLiteral, importKind?: "type" | "typeof" | "value" | null): ImportDeclaration; +export function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier; +export function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier; +export function importSpecifier(local: Identifier, imported: Identifier, importKind?: "type" | "typeof" | null): ImportSpecifier; +export function metaProperty(meta: Identifier, property: Identifier): MetaProperty; +export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, params: Array, body: BlockStatement, computed?: boolean, _static?: boolean | null, abstract?: boolean | null, access?: "public" | "private" | "protected" | null, accessibility?: "public" | "private" | "protected" | null, async?: boolean, decorators?: Array | null, generator?: boolean, optional?: boolean | null, returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null, typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null): ClassMethod; +export function objectPattern(properties: Array, decorators?: Array | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null): ObjectPattern; +export function spreadElement(argument: Expression): SpreadElement; +export function taggedTemplateExpression(tag: Expression, quasi: TemplateLiteral, typeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null): TaggedTemplateExpression; +export function templateElement(value: any, tail?: boolean): TemplateElement; +export function templateLiteral(quasis: Array, expressions: Array): TemplateLiteral; +export function yieldExpression(argument?: Expression | null, delegate?: boolean): YieldExpression; +export function anyTypeAnnotation(): AnyTypeAnnotation; +export function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation; +export function booleanTypeAnnotation(): BooleanTypeAnnotation; +export function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation; +export function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; +export function classImplements(id: Identifier, typeParameters?: TypeParameterInstantiation | null): ClassImplements; +export function declareClass(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation, _implements?: Array | null, mixins?: Array | null): DeclareClass; +export function declareFunction(id: Identifier, predicate?: DeclaredPredicate | null): DeclareFunction; +export function declareInterface(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation, _implements?: Array | null, mixins?: Array | null): DeclareInterface; +export function declareModule(id: Identifier | StringLiteral, body: BlockStatement, kind?: "CommonJS" | "ES" | null): DeclareModule; +export function declareModuleExports(typeAnnotation: TypeAnnotation): DeclareModuleExports; +export function declareTypeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): DeclareTypeAlias; +export function declareOpaqueType(id: Identifier, typeParameters?: TypeParameterDeclaration | null, supertype?: FlowType | null): DeclareOpaqueType; +export function declareVariable(id: Identifier): DeclareVariable; +export function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array | null, source?: StringLiteral | null, _default?: boolean | null): DeclareExportDeclaration; +export function declareExportAllDeclaration(source: StringLiteral, exportKind?: ["type","value"] | null): DeclareExportAllDeclaration; +export function declaredPredicate(value: Flow): DeclaredPredicate; +export function existsTypeAnnotation(): ExistsTypeAnnotation; +export function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: Array, rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation; +export function functionTypeParam(name: Identifier | null | undefined, typeAnnotation: FlowType, optional?: boolean | null): FunctionTypeParam; +export function genericTypeAnnotation(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): GenericTypeAnnotation; +export function inferredPredicate(): InferredPredicate; +export function interfaceExtends(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): InterfaceExtends; +export function interfaceDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation, _implements?: Array | null, mixins?: Array | null): InterfaceDeclaration; +export function interfaceTypeAnnotation(_extends: Array | null | undefined, body: ObjectTypeAnnotation): InterfaceTypeAnnotation; +export function intersectionTypeAnnotation(types: Array): IntersectionTypeAnnotation; +export function mixedTypeAnnotation(): MixedTypeAnnotation; +export function emptyTypeAnnotation(): EmptyTypeAnnotation; +export function nullableTypeAnnotation(typeAnnotation: FlowType): NullableTypeAnnotation; +export function numberLiteralTypeAnnotation(value: number): NumberLiteralTypeAnnotation; +export function numberTypeAnnotation(): NumberTypeAnnotation; +export function objectTypeAnnotation(properties: Array, indexers?: Array | null, callProperties?: Array | null, internalSlots?: Array | null, exact?: boolean, inexact?: boolean | null): ObjectTypeAnnotation; +export function objectTypeInternalSlot(id: Identifier, value: FlowType, optional: boolean, _static: boolean, method: boolean): ObjectTypeInternalSlot; +export function objectTypeCallProperty(value: FlowType, _static?: boolean | null): ObjectTypeCallProperty; +export function objectTypeIndexer(id: Identifier | null | undefined, key: FlowType, value: FlowType, variance?: Variance | null, _static?: boolean | null): ObjectTypeIndexer; +export function objectTypeProperty(key: Identifier | StringLiteral, value: FlowType, variance?: Variance | null, kind?: "init" | "get" | "set" | null, optional?: boolean | null, proto?: boolean | null, _static?: boolean | null): ObjectTypeProperty; +export function objectTypeSpreadProperty(argument: FlowType): ObjectTypeSpreadProperty; +export function opaqueType(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, supertype: FlowType | null | undefined, impltype: FlowType): OpaqueType; +export function qualifiedTypeIdentifier(id: Identifier, qualification: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; +export function stringLiteralTypeAnnotation(value: string): StringLiteralTypeAnnotation; +export function stringTypeAnnotation(): StringTypeAnnotation; +export function thisTypeAnnotation(): ThisTypeAnnotation; +export function tupleTypeAnnotation(types: Array): TupleTypeAnnotation; +export function typeofTypeAnnotation(argument: FlowType): TypeofTypeAnnotation; +export function typeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): TypeAlias; +export function typeAnnotation(typeAnnotation: FlowType): TypeAnnotation; +export function typeCastExpression(expression: Expression, typeAnnotation: TypeAnnotation): TypeCastExpression; +export function typeParameter(bound?: TypeAnnotation | null, _default?: FlowType | null, variance?: Variance | null, name?: string | null): TypeParameter; +export function typeParameterDeclaration(params: Array): TypeParameterDeclaration; +export function typeParameterInstantiation(params: Array): TypeParameterInstantiation; +export function unionTypeAnnotation(types: Array): UnionTypeAnnotation; +export function variance(kind: "minus" | "plus"): Variance; +export function voidTypeAnnotation(): VoidTypeAnnotation; +export function jsxAttribute(name: JSXIdentifier | JSXNamespacedName, value?: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null): JSXAttribute; +export function jsxClosingElement(name: JSXIdentifier | JSXMemberExpression): JSXClosingElement; +export function jsxElement(openingElement: JSXOpeningElement, closingElement: JSXClosingElement | null | undefined, children: Array, selfClosing: any): JSXElement; +export function jsxEmptyExpression(): JSXEmptyExpression; +export function jsxExpressionContainer(expression: Expression | JSXEmptyExpression): JSXExpressionContainer; +export function jsxSpreadChild(expression: Expression): JSXSpreadChild; +export function jsxIdentifier(name: string): JSXIdentifier; +export function jsxMemberExpression(object: JSXMemberExpression | JSXIdentifier, property: JSXIdentifier): JSXMemberExpression; +export function jsxNamespacedName(namespace: JSXIdentifier, name: JSXIdentifier): JSXNamespacedName; +export function jsxOpeningElement(name: JSXIdentifier | JSXMemberExpression, attributes: Array, selfClosing?: boolean, typeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null): JSXOpeningElement; +export function jsxSpreadAttribute(argument: Expression): JSXSpreadAttribute; +export function jsxText(value: string): JSXText; +export function jsxFragment(openingFragment: JSXOpeningFragment, closingFragment: JSXClosingFragment, children: Array): JSXFragment; +export function jsxOpeningFragment(): JSXOpeningFragment; +export function jsxClosingFragment(): JSXClosingFragment; +export function noop(): Noop; +export function parenthesizedExpression(expression: Expression): ParenthesizedExpression; +export function awaitExpression(argument: Expression): AwaitExpression; +export function bindExpression(object: any, callee: any): BindExpression; +export function classProperty(key: Identifier | StringLiteral | NumericLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array | null, computed?: boolean, abstract?: boolean | null, accessibility?: "public" | "private" | "protected" | null, definite?: boolean | null, optional?: boolean | null, readonly?: boolean | null, _static?: boolean | null): ClassProperty; +export function optionalMemberExpression(object: Expression, property: any, computed: boolean | undefined, optional: boolean): OptionalMemberExpression; +export function pipelineTopicExpression(expression: Expression): PipelineTopicExpression; +export function pipelineBareFunction(callee: Expression): PipelineBareFunction; +export function pipelinePrimaryTopicReference(): PipelinePrimaryTopicReference; +export function optionalCallExpression(callee: Expression, _arguments: Array, optional: boolean, typeArguments?: TypeParameterInstantiation | null, typeParameters?: TSTypeParameterInstantiation | null): OptionalCallExpression; +export function classPrivateProperty(key: PrivateName, value?: Expression | null): ClassPrivateProperty; +export function classPrivateMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: PrivateName, params: Array, body: BlockStatement, _static?: boolean | null, abstract?: boolean | null, access?: "public" | "private" | "protected" | null, accessibility?: "public" | "private" | "protected" | null, async?: boolean, computed?: boolean, decorators?: Array | null, generator?: boolean, optional?: boolean | null, returnType?: any | null, typeParameters?: any | null): ClassPrivateMethod; +export function decorator(expression: Expression): Decorator; +export function doExpression(body: BlockStatement): DoExpression; +export function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpecifier; +export function exportNamespaceSpecifier(exported: Identifier): ExportNamespaceSpecifier; +export function privateName(id: Identifier): PrivateName; +export function bigIntLiteral(value: string): BigIntLiteral; +export function tsParameterProperty(parameter: Identifier | AssignmentPattern, accessibility?: "public" | "private" | "protected" | null, readonly?: boolean | null): TSParameterProperty; +export function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null, async?: boolean, declare?: boolean | null, generator?: boolean): TSDeclareFunction; +export function tsDeclareMethod(decorators: Array | null | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null, abstract?: boolean | null, access?: "public" | "private" | "protected" | null, accessibility?: "public" | "private" | "protected" | null, async?: boolean, computed?: boolean, generator?: boolean, kind?: "get" | "set" | "method" | "constructor", optional?: boolean | null, _static?: boolean | null): TSDeclareMethod; +export function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName; +export function tsCallSignatureDeclaration(typeParameters?: TSTypeParameterDeclaration | null, parameters?: Array | null, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration; +export function tsConstructSignatureDeclaration(typeParameters?: TSTypeParameterDeclaration | null, parameters?: Array | null, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration; +export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null, initializer?: Expression | null, computed?: boolean | null, optional?: boolean | null, readonly?: boolean | null): TSPropertySignature; +export function tsMethodSignature(key: Expression, typeParameters?: TSTypeParameterDeclaration | null, parameters?: Array | null, typeAnnotation?: TSTypeAnnotation | null, computed?: boolean | null, optional?: boolean | null): TSMethodSignature; +export function tsIndexSignature(parameters: Array, typeAnnotation?: TSTypeAnnotation | null, readonly?: boolean | null): TSIndexSignature; +export function tsAnyKeyword(): TSAnyKeyword; +export function tsUnknownKeyword(): TSUnknownKeyword; +export function tsNumberKeyword(): TSNumberKeyword; +export function tsObjectKeyword(): TSObjectKeyword; +export function tsBooleanKeyword(): TSBooleanKeyword; +export function tsStringKeyword(): TSStringKeyword; +export function tsSymbolKeyword(): TSSymbolKeyword; +export function tsVoidKeyword(): TSVoidKeyword; +export function tsUndefinedKeyword(): TSUndefinedKeyword; +export function tsNullKeyword(): TSNullKeyword; +export function tsNeverKeyword(): TSNeverKeyword; +export function tsThisType(): TSThisType; +export function tsFunctionType(typeParameters?: TSTypeParameterDeclaration | null, typeAnnotation?: TSTypeAnnotation | null, parameters?: Array | null): TSFunctionType; +export function tsConstructorType(typeParameters?: TSTypeParameterDeclaration | null, typeAnnotation?: TSTypeAnnotation | null, parameters?: Array | null): TSConstructorType; +export function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference; +export function tsTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation: TSTypeAnnotation): TSTypePredicate; +export function tsTypeQuery(exprName: TSEntityName | TSImportType): TSTypeQuery; +export function tsTypeLiteral(members: Array): TSTypeLiteral; +export function tsArrayType(elementType: TSType): TSArrayType; +export function tsTupleType(elementTypes: Array): TSTupleType; +export function tsOptionalType(typeAnnotation: TSType): TSOptionalType; +export function tsRestType(typeAnnotation: TSType): TSRestType; +export function tsUnionType(types: Array): TSUnionType; +export function tsIntersectionType(types: Array): TSIntersectionType; +export function tsConditionalType(checkType: TSType, extendsType: TSType, trueType: TSType, falseType: TSType): TSConditionalType; +export function tsInferType(typeParameter: TSTypeParameter): TSInferType; +export function tsParenthesizedType(typeAnnotation: TSType): TSParenthesizedType; +export function tsTypeOperator(typeAnnotation: TSType, operator?: string | null): TSTypeOperator; +export function tsIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType; +export function tsMappedType(typeParameter: TSTypeParameter, typeAnnotation?: TSType | null, optional?: boolean | null, readonly?: boolean | null): TSMappedType; +export function tsLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral): TSLiteralType; +export function tsExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSExpressionWithTypeArguments; +export function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: TSInterfaceBody, declare?: boolean | null): TSInterfaceDeclaration; +export function tsInterfaceBody(body: Array): TSInterfaceBody; +export function tsTypeAliasDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, typeAnnotation: TSType, declare?: boolean | null): TSTypeAliasDeclaration; +export function tsAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression; +export function tsTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion; +export function tsEnumDeclaration(id: Identifier, members: Array, _const?: boolean | null, declare?: boolean | null, initializer?: Expression | null): TSEnumDeclaration; +export function tsEnumMember(id: Identifier | StringLiteral, initializer?: Expression | null): TSEnumMember; +export function tsModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration, declare?: boolean | null, global?: boolean | null): TSModuleDeclaration; +export function tsModuleBlock(body: Array): TSModuleBlock; +export function tsImportType(argument: StringLiteral, qualifier?: TSEntityName | null, typeParameters?: TSTypeParameterInstantiation | null): TSImportType; +export function tsImportEqualsDeclaration(id: Identifier, moduleReference: TSEntityName | TSExternalModuleReference, isExport?: boolean | null): TSImportEqualsDeclaration; +export function tsExternalModuleReference(expression: StringLiteral): TSExternalModuleReference; +export function tsNonNullExpression(expression: Expression): TSNonNullExpression; +export function tsExportAssignment(expression: Expression): TSExportAssignment; +export function tsNamespaceExportDeclaration(id: Identifier): TSNamespaceExportDeclaration; +export function tsTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation; +export function tsTypeParameterInstantiation(params: Array): TSTypeParameterInstantiation; +export function tsTypeParameterDeclaration(params: Array): TSTypeParameterDeclaration; +export function tsTypeParameter(constraint?: TSType | null, _default?: TSType | null, name?: string | null): TSTypeParameter; +export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is AnyTypeAnnotation; +export function isArrayExpression(node: object | null | undefined, opts?: object | null): node is ArrayExpression; +export function isArrayPattern(node: object | null | undefined, opts?: object | null): node is ArrayPattern; +export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ArrayTypeAnnotation; +export function isArrowFunctionExpression(node: object | null | undefined, opts?: object | null): node is ArrowFunctionExpression; +export function isAssignmentExpression(node: object | null | undefined, opts?: object | null): node is AssignmentExpression; +export function isAssignmentPattern(node: object | null | undefined, opts?: object | null): node is AssignmentPattern; +export function isAwaitExpression(node: object | null | undefined, opts?: object | null): node is AwaitExpression; +export function isBigIntLiteral(node: object | null | undefined, opts?: object | null): node is BigIntLiteral; +export function isBinary(node: object | null | undefined, opts?: object | null): node is Binary; +export function isBinaryExpression(node: object | null | undefined, opts?: object | null): node is BinaryExpression; +export function isBindExpression(node: object | null | undefined, opts?: object | null): node is BindExpression; +export function isBlock(node: object | null | undefined, opts?: object | null): node is Block; +export function isBlockParent(node: object | null | undefined, opts?: object | null): node is BlockParent; +export function isBlockStatement(node: object | null | undefined, opts?: object | null): node is BlockStatement; +export function isBooleanLiteral(node: object | null | undefined, opts?: object | null): node is BooleanLiteral; +export function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanLiteralTypeAnnotation; +export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanTypeAnnotation; +export function isBreakStatement(node: object | null | undefined, opts?: object | null): node is BreakStatement; +export function isCallExpression(node: object | null | undefined, opts?: object | null): node is CallExpression; +export function isCatchClause(node: object | null | undefined, opts?: object | null): node is CatchClause; +export function isClass(node: object | null | undefined, opts?: object | null): node is Class; +export function isClassBody(node: object | null | undefined, opts?: object | null): node is ClassBody; +export function isClassDeclaration(node: object | null | undefined, opts?: object | null): node is ClassDeclaration; +export function isClassExpression(node: object | null | undefined, opts?: object | null): node is ClassExpression; +export function isClassImplements(node: object | null | undefined, opts?: object | null): node is ClassImplements; +export function isClassMethod(node: object | null | undefined, opts?: object | null): node is ClassMethod; +export function isClassPrivateMethod(node: object | null | undefined, opts?: object | null): node is ClassPrivateMethod; +export function isClassPrivateProperty(node: object | null | undefined, opts?: object | null): node is ClassPrivateProperty; +export function isClassProperty(node: object | null | undefined, opts?: object | null): node is ClassProperty; +export function isCompletionStatement(node: object | null | undefined, opts?: object | null): node is CompletionStatement; +export function isConditional(node: object | null | undefined, opts?: object | null): node is Conditional; +export function isConditionalExpression(node: object | null | undefined, opts?: object | null): node is ConditionalExpression; +export function isContinueStatement(node: object | null | undefined, opts?: object | null): node is ContinueStatement; +export function isDebuggerStatement(node: object | null | undefined, opts?: object | null): node is DebuggerStatement; +export function isDeclaration(node: object | null | undefined, opts?: object | null): node is Declaration; +export function isDeclareClass(node: object | null | undefined, opts?: object | null): node is DeclareClass; +export function isDeclareExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportAllDeclaration; +export function isDeclareExportDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportDeclaration; +export function isDeclareFunction(node: object | null | undefined, opts?: object | null): node is DeclareFunction; +export function isDeclareInterface(node: object | null | undefined, opts?: object | null): node is DeclareInterface; +export function isDeclareModule(node: object | null | undefined, opts?: object | null): node is DeclareModule; +export function isDeclareModuleExports(node: object | null | undefined, opts?: object | null): node is DeclareModuleExports; +export function isDeclareOpaqueType(node: object | null | undefined, opts?: object | null): node is DeclareOpaqueType; +export function isDeclareTypeAlias(node: object | null | undefined, opts?: object | null): node is DeclareTypeAlias; +export function isDeclareVariable(node: object | null | undefined, opts?: object | null): node is DeclareVariable; +export function isDeclaredPredicate(node: object | null | undefined, opts?: object | null): node is DeclaredPredicate; +export function isDecorator(node: object | null | undefined, opts?: object | null): node is Decorator; +export function isDirective(node: object | null | undefined, opts?: object | null): node is Directive; +export function isDirectiveLiteral(node: object | null | undefined, opts?: object | null): node is DirectiveLiteral; +export function isDoExpression(node: object | null | undefined, opts?: object | null): node is DoExpression; +export function isDoWhileStatement(node: object | null | undefined, opts?: object | null): node is DoWhileStatement; +export function isEmptyStatement(node: object | null | undefined, opts?: object | null): node is EmptyStatement; +export function isEmptyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is EmptyTypeAnnotation; +export function isExistsTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ExistsTypeAnnotation; +export function isExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is ExportAllDeclaration; +export function isExportDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDeclaration; +export function isExportDefaultDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDefaultDeclaration; +export function isExportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ExportDefaultSpecifier; +export function isExportNamedDeclaration(node: object | null | undefined, opts?: object | null): node is ExportNamedDeclaration; +export function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ExportNamespaceSpecifier; +export function isExportSpecifier(node: object | null | undefined, opts?: object | null): node is ExportSpecifier; +export function isExpression(node: object | null | undefined, opts?: object | null): node is Expression; +export function isExpressionStatement(node: object | null | undefined, opts?: object | null): node is ExpressionStatement; +export function isExpressionWrapper(node: object | null | undefined, opts?: object | null): node is ExpressionWrapper; +export function isFile(node: object | null | undefined, opts?: object | null): node is File; +export function isFlow(node: object | null | undefined, opts?: object | null): node is Flow; +export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object | null): node is FlowBaseAnnotation; +export function isFlowDeclaration(node: object | null | undefined, opts?: object | null): node is FlowDeclaration; +export function isFlowPredicate(node: object | null | undefined, opts?: object | null): node is FlowPredicate; +export function isFlowType(node: object | null | undefined, opts?: object | null): node is FlowType; +export function isFor(node: object | null | undefined, opts?: object | null): node is For; +export function isForInStatement(node: object | null | undefined, opts?: object | null): node is ForInStatement; +export function isForOfStatement(node: object | null | undefined, opts?: object | null): node is ForOfStatement; +export function isForStatement(node: object | null | undefined, opts?: object | null): node is ForStatement; +export function isForXStatement(node: object | null | undefined, opts?: object | null): node is ForXStatement; +export function isFunction(node: object | null | undefined, opts?: object | null): node is Function; +export function isFunctionDeclaration(node: object | null | undefined, opts?: object | null): node is FunctionDeclaration; +export function isFunctionExpression(node: object | null | undefined, opts?: object | null): node is FunctionExpression; +export function isFunctionParent(node: object | null | undefined, opts?: object | null): node is FunctionParent; +export function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is FunctionTypeAnnotation; +export function isFunctionTypeParam(node: object | null | undefined, opts?: object | null): node is FunctionTypeParam; +export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object | null): node is GenericTypeAnnotation; +export function isIdentifier(node: object | null | undefined, opts?: object | null): node is Identifier; +export function isIfStatement(node: object | null | undefined, opts?: object | null): node is IfStatement; +export function isImmutable(node: object | null | undefined, opts?: object | null): node is Immutable; +export function isImport(node: object | null | undefined, opts?: object | null): node is Import; +export function isImportDeclaration(node: object | null | undefined, opts?: object | null): node is ImportDeclaration; +export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ImportDefaultSpecifier; +export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ImportNamespaceSpecifier; +export function isImportSpecifier(node: object | null | undefined, opts?: object | null): node is ImportSpecifier; +export function isInferredPredicate(node: object | null | undefined, opts?: object | null): node is InferredPredicate; +export function isInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is InterfaceDeclaration; +export function isInterfaceExtends(node: object | null | undefined, opts?: object | null): node is InterfaceExtends; +export function isInterfaceTypeAnnotation(node: object | null | undefined, opts?: object | null): node is InterfaceTypeAnnotation; +export function isInterpreterDirective(node: object | null | undefined, opts?: object | null): node is InterpreterDirective; +export function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is IntersectionTypeAnnotation; +export function isJSX(node: object | null | undefined, opts?: object | null): node is JSX; +export function isJSXAttribute(node: object | null | undefined, opts?: object | null): node is JSXAttribute; +export function isJSXClosingElement(node: object | null | undefined, opts?: object | null): node is JSXClosingElement; +export function isJSXClosingFragment(node: object | null | undefined, opts?: object | null): node is JSXClosingFragment; +export function isJSXElement(node: object | null | undefined, opts?: object | null): node is JSXElement; +export function isJSXEmptyExpression(node: object | null | undefined, opts?: object | null): node is JSXEmptyExpression; +export function isJSXExpressionContainer(node: object | null | undefined, opts?: object | null): node is JSXExpressionContainer; +export function isJSXFragment(node: object | null | undefined, opts?: object | null): node is JSXFragment; +export function isJSXIdentifier(node: object | null | undefined, opts?: object | null): node is JSXIdentifier; +export function isJSXMemberExpression(node: object | null | undefined, opts?: object | null): node is JSXMemberExpression; +export function isJSXNamespacedName(node: object | null | undefined, opts?: object | null): node is JSXNamespacedName; +export function isJSXOpeningElement(node: object | null | undefined, opts?: object | null): node is JSXOpeningElement; +export function isJSXOpeningFragment(node: object | null | undefined, opts?: object | null): node is JSXOpeningFragment; +export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object | null): node is JSXSpreadAttribute; +export function isJSXSpreadChild(node: object | null | undefined, opts?: object | null): node is JSXSpreadChild; +export function isJSXText(node: object | null | undefined, opts?: object | null): node is JSXText; +export function isLVal(node: object | null | undefined, opts?: object | null): node is LVal; +export function isLabeledStatement(node: object | null | undefined, opts?: object | null): node is LabeledStatement; +export function isLiteral(node: object | null | undefined, opts?: object | null): node is Literal; +export function isLogicalExpression(node: object | null | undefined, opts?: object | null): node is LogicalExpression; +export function isLoop(node: object | null | undefined, opts?: object | null): node is Loop; +export function isMemberExpression(node: object | null | undefined, opts?: object | null): node is MemberExpression; +export function isMetaProperty(node: object | null | undefined, opts?: object | null): node is MetaProperty; +export function isMethod(node: object | null | undefined, opts?: object | null): node is Method; +export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): node is MixedTypeAnnotation; +export function isModuleDeclaration(node: object | null | undefined, opts?: object | null): node is ModuleDeclaration; +export function isModuleSpecifier(node: object | null | undefined, opts?: object | null): node is ModuleSpecifier; +export function isNewExpression(node: object | null | undefined, opts?: object | null): node is NewExpression; +export function isNoop(node: object | null | undefined, opts?: object | null): node is Noop; +export function isNullLiteral(node: object | null | undefined, opts?: object | null): node is NullLiteral; +export function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullLiteralTypeAnnotation; +export function isNullableTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullableTypeAnnotation; +export function isNumberLiteral(node: object | null | undefined, opts?: object | null): boolean; +export function isNumberLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberLiteralTypeAnnotation; +export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberTypeAnnotation; +export function isNumericLiteral(node: object | null | undefined, opts?: object | null): node is NumericLiteral; +export function isObjectExpression(node: object | null | undefined, opts?: object | null): node is ObjectExpression; +export function isObjectMember(node: object | null | undefined, opts?: object | null): node is ObjectMember; +export function isObjectMethod(node: object | null | undefined, opts?: object | null): node is ObjectMethod; +export function isObjectPattern(node: object | null | undefined, opts?: object | null): node is ObjectPattern; +export function isObjectProperty(node: object | null | undefined, opts?: object | null): node is ObjectProperty; +export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ObjectTypeAnnotation; +export function isObjectTypeCallProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeCallProperty; +export function isObjectTypeIndexer(node: object | null | undefined, opts?: object | null): node is ObjectTypeIndexer; +export function isObjectTypeInternalSlot(node: object | null | undefined, opts?: object | null): node is ObjectTypeInternalSlot; +export function isObjectTypeProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeProperty; +export function isObjectTypeSpreadProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeSpreadProperty; +export function isOpaqueType(node: object | null | undefined, opts?: object | null): node is OpaqueType; +export function isOptionalCallExpression(node: object | null | undefined, opts?: object | null): node is OptionalCallExpression; +export function isOptionalMemberExpression(node: object | null | undefined, opts?: object | null): node is OptionalMemberExpression; +export function isParenthesizedExpression(node: object | null | undefined, opts?: object | null): node is ParenthesizedExpression; +export function isPattern(node: object | null | undefined, opts?: object | null): node is Pattern; +export function isPatternLike(node: object | null | undefined, opts?: object | null): node is PatternLike; +export function isPipelineBareFunction(node: object | null | undefined, opts?: object | null): node is PipelineBareFunction; +export function isPipelinePrimaryTopicReference(node: object | null | undefined, opts?: object | null): node is PipelinePrimaryTopicReference; +export function isPipelineTopicExpression(node: object | null | undefined, opts?: object | null): node is PipelineTopicExpression; +export function isPrivate(node: object | null | undefined, opts?: object | null): node is Private; +export function isPrivateName(node: object | null | undefined, opts?: object | null): node is PrivateName; +export function isProgram(node: object | null | undefined, opts?: object | null): node is Program; +export function isProperty(node: object | null | undefined, opts?: object | null): node is Property; +export function isPureish(node: object | null | undefined, opts?: object | null): node is Pureish; +export function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object | null): node is QualifiedTypeIdentifier; +export function isRegExpLiteral(node: object | null | undefined, opts?: object | null): node is RegExpLiteral; +export function isRegexLiteral(node: object | null | undefined, opts?: object | null): boolean; +export function isRestElement(node: object | null | undefined, opts?: object | null): node is RestElement; +export function isRestProperty(node: object | null | undefined, opts?: object | null): boolean; +export function isReturnStatement(node: object | null | undefined, opts?: object | null): node is ReturnStatement; +export function isScopable(node: object | null | undefined, opts?: object | null): node is Scopable; +export function isSequenceExpression(node: object | null | undefined, opts?: object | null): node is SequenceExpression; +export function isSpreadElement(node: object | null | undefined, opts?: object | null): node is SpreadElement; +export function isSpreadProperty(node: object | null | undefined, opts?: object | null): boolean; +export function isStatement(node: object | null | undefined, opts?: object | null): node is Statement; +export function isStringLiteral(node: object | null | undefined, opts?: object | null): node is StringLiteral; +export function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringLiteralTypeAnnotation; +export function isStringTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringTypeAnnotation; +export function isSuper(node: object | null | undefined, opts?: object | null): node is Super; +export function isSwitchCase(node: object | null | undefined, opts?: object | null): node is SwitchCase; +export function isSwitchStatement(node: object | null | undefined, opts?: object | null): node is SwitchStatement; +export function isTSAnyKeyword(node: object | null | undefined, opts?: object | null): node is TSAnyKeyword; +export function isTSArrayType(node: object | null | undefined, opts?: object | null): node is TSArrayType; +export function isTSAsExpression(node: object | null | undefined, opts?: object | null): node is TSAsExpression; +export function isTSBooleanKeyword(node: object | null | undefined, opts?: object | null): node is TSBooleanKeyword; +export function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSCallSignatureDeclaration; +export function isTSConditionalType(node: object | null | undefined, opts?: object | null): node is TSConditionalType; +export function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSConstructSignatureDeclaration; +export function isTSConstructorType(node: object | null | undefined, opts?: object | null): node is TSConstructorType; +export function isTSDeclareFunction(node: object | null | undefined, opts?: object | null): node is TSDeclareFunction; +export function isTSDeclareMethod(node: object | null | undefined, opts?: object | null): node is TSDeclareMethod; +export function isTSEntityName(node: object | null | undefined, opts?: object | null): node is TSEntityName; +export function isTSEnumDeclaration(node: object | null | undefined, opts?: object | null): node is TSEnumDeclaration; +export function isTSEnumMember(node: object | null | undefined, opts?: object | null): node is TSEnumMember; +export function isTSExportAssignment(node: object | null | undefined, opts?: object | null): node is TSExportAssignment; +export function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object | null): node is TSExpressionWithTypeArguments; +export function isTSExternalModuleReference(node: object | null | undefined, opts?: object | null): node is TSExternalModuleReference; +export function isTSFunctionType(node: object | null | undefined, opts?: object | null): node is TSFunctionType; +export function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object | null): node is TSImportEqualsDeclaration; +export function isTSImportType(node: object | null | undefined, opts?: object | null): node is TSImportType; +export function isTSIndexSignature(node: object | null | undefined, opts?: object | null): node is TSIndexSignature; +export function isTSIndexedAccessType(node: object | null | undefined, opts?: object | null): node is TSIndexedAccessType; +export function isTSInferType(node: object | null | undefined, opts?: object | null): node is TSInferType; +export function isTSInterfaceBody(node: object | null | undefined, opts?: object | null): node is TSInterfaceBody; +export function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is TSInterfaceDeclaration; +export function isTSIntersectionType(node: object | null | undefined, opts?: object | null): node is TSIntersectionType; +export function isTSLiteralType(node: object | null | undefined, opts?: object | null): node is TSLiteralType; +export function isTSMappedType(node: object | null | undefined, opts?: object | null): node is TSMappedType; +export function isTSMethodSignature(node: object | null | undefined, opts?: object | null): node is TSMethodSignature; +export function isTSModuleBlock(node: object | null | undefined, opts?: object | null): node is TSModuleBlock; +export function isTSModuleDeclaration(node: object | null | undefined, opts?: object | null): node is TSModuleDeclaration; +export function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object | null): node is TSNamespaceExportDeclaration; +export function isTSNeverKeyword(node: object | null | undefined, opts?: object | null): node is TSNeverKeyword; +export function isTSNonNullExpression(node: object | null | undefined, opts?: object | null): node is TSNonNullExpression; +export function isTSNullKeyword(node: object | null | undefined, opts?: object | null): node is TSNullKeyword; +export function isTSNumberKeyword(node: object | null | undefined, opts?: object | null): node is TSNumberKeyword; +export function isTSObjectKeyword(node: object | null | undefined, opts?: object | null): node is TSObjectKeyword; +export function isTSOptionalType(node: object | null | undefined, opts?: object | null): node is TSOptionalType; +export function isTSParameterProperty(node: object | null | undefined, opts?: object | null): node is TSParameterProperty; +export function isTSParenthesizedType(node: object | null | undefined, opts?: object | null): node is TSParenthesizedType; +export function isTSPropertySignature(node: object | null | undefined, opts?: object | null): node is TSPropertySignature; +export function isTSQualifiedName(node: object | null | undefined, opts?: object | null): node is TSQualifiedName; +export function isTSRestType(node: object | null | undefined, opts?: object | null): node is TSRestType; +export function isTSStringKeyword(node: object | null | undefined, opts?: object | null): node is TSStringKeyword; +export function isTSSymbolKeyword(node: object | null | undefined, opts?: object | null): node is TSSymbolKeyword; +export function isTSThisType(node: object | null | undefined, opts?: object | null): node is TSThisType; +export function isTSTupleType(node: object | null | undefined, opts?: object | null): node is TSTupleType; +export function isTSType(node: object | null | undefined, opts?: object | null): node is TSType; +export function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeAliasDeclaration; +export function isTSTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TSTypeAnnotation; +export function isTSTypeAssertion(node: object | null | undefined, opts?: object | null): node is TSTypeAssertion; +export function isTSTypeElement(node: object | null | undefined, opts?: object | null): node is TSTypeElement; +export function isTSTypeLiteral(node: object | null | undefined, opts?: object | null): node is TSTypeLiteral; +export function isTSTypeOperator(node: object | null | undefined, opts?: object | null): node is TSTypeOperator; +export function isTSTypeParameter(node: object | null | undefined, opts?: object | null): node is TSTypeParameter; +export function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeParameterDeclaration; +export function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TSTypeParameterInstantiation; +export function isTSTypePredicate(node: object | null | undefined, opts?: object | null): node is TSTypePredicate; +export function isTSTypeQuery(node: object | null | undefined, opts?: object | null): node is TSTypeQuery; +export function isTSTypeReference(node: object | null | undefined, opts?: object | null): node is TSTypeReference; +export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object | null): node is TSUndefinedKeyword; +export function isTSUnionType(node: object | null | undefined, opts?: object | null): node is TSUnionType; +export function isTSUnknownKeyword(node: object | null | undefined, opts?: object | null): node is TSUnknownKeyword; +export function isTSVoidKeyword(node: object | null | undefined, opts?: object | null): node is TSVoidKeyword; +export function isTaggedTemplateExpression(node: object | null | undefined, opts?: object | null): node is TaggedTemplateExpression; +export function isTemplateElement(node: object | null | undefined, opts?: object | null): node is TemplateElement; +export function isTemplateLiteral(node: object | null | undefined, opts?: object | null): node is TemplateLiteral; +export function isTerminatorless(node: object | null | undefined, opts?: object | null): node is Terminatorless; +export function isThisExpression(node: object | null | undefined, opts?: object | null): node is ThisExpression; +export function isThisTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ThisTypeAnnotation; +export function isThrowStatement(node: object | null | undefined, opts?: object | null): node is ThrowStatement; +export function isTryStatement(node: object | null | undefined, opts?: object | null): node is TryStatement; +export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TupleTypeAnnotation; +export function isTypeAlias(node: object | null | undefined, opts?: object | null): node is TypeAlias; +export function isTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeAnnotation; +export function isTypeCastExpression(node: object | null | undefined, opts?: object | null): node is TypeCastExpression; +export function isTypeParameter(node: object | null | undefined, opts?: object | null): node is TypeParameter; +export function isTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TypeParameterDeclaration; +export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TypeParameterInstantiation; +export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeofTypeAnnotation; +export function isUnaryExpression(node: object | null | undefined, opts?: object | null): node is UnaryExpression; +export function isUnaryLike(node: object | null | undefined, opts?: object | null): node is UnaryLike; +export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is UnionTypeAnnotation; +export function isUpdateExpression(node: object | null | undefined, opts?: object | null): node is UpdateExpression; +export function isUserWhitespacable(node: object | null | undefined, opts?: object | null): node is UserWhitespacable; +export function isVariableDeclaration(node: object | null | undefined, opts?: object | null): node is VariableDeclaration; +export function isVariableDeclarator(node: object | null | undefined, opts?: object | null): node is VariableDeclarator; +export function isVariance(node: object | null | undefined, opts?: object | null): node is Variance; +export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object | null): node is VoidTypeAnnotation; +export function isWhile(node: object | null | undefined, opts?: object | null): node is While; +export function isWhileStatement(node: object | null | undefined, opts?: object | null): node is WhileStatement; +export function isWithStatement(node: object | null | undefined, opts?: object | null): node is WithStatement; +export function isYieldExpression(node: object | null | undefined, opts?: object | null): node is YieldExpression; +export function validate(n: Node, key: string, value: any): void; +export function clone(n: T): T; +export function cloneDeep(n: T): T; +export function removeProperties( + n: Node, + opts?: { preserveComments: boolean } | null +): void; +export function removePropertiesDeep( + n: T, + opts?: { preserveComments: boolean } | null +): T; +export type TraversalAncestors = ReadonlyArray<{ + node: Node, + key: string, + index?: number, +}>; +export type TraversalHandler = (node: Node, parent: TraversalAncestors, type: T) => void; +export type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, +}; +export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js index dc6952d70657ab..8d9df04d7ba4a9 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js @@ -1,10 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); var _exportNames = { + react: true, assertNode: true, createTypeAnnotationBasedOnTypeof: true, createUnionTypeAnnotation: true, + cloneNode: true, clone: true, cloneDeep: true, cloneWithoutLoc: true, @@ -52,10 +56,321 @@ var _exportNames = { isVar: true, matchesPattern: true, validate: true, - buildMatchMemberExpression: true, - react: true + buildMatchMemberExpression: true }; -exports.react = exports.buildMatchMemberExpression = exports.validate = exports.matchesPattern = exports.isVar = exports.isValidIdentifier = exports.isValidES3Identifier = exports.isType = exports.isSpecifierDefault = exports.isScope = exports.isReferenced = exports.isNodesEquivalent = exports.isNode = exports.isLet = exports.isImmutable = exports.isBlockScoped = exports.isBinding = exports.is = exports.shallowEqual = exports.traverseFast = exports.traverse = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.removeTypeDuplicates = exports.removePropertiesDeep = exports.removeProperties = exports.prependToMemberExpression = exports.inherits = exports.appendToMemberExpression = exports.valueToNode = exports.toStatement = exports.toSequenceExpression = exports.toKeyAlias = exports.toIdentifier = exports.toExpression = exports.toComputedKey = exports.toBlock = exports.toBindingIdentifierName = exports.ensureBlock = exports.removeComments = exports.inheritTrailingComments = exports.inheritsComments = exports.inheritLeadingComments = exports.inheritInnerComments = exports.addComments = exports.addComment = exports.cloneWithoutLoc = exports.cloneDeep = exports.clone = exports.createUnionTypeAnnotation = exports.createTypeAnnotationBasedOnTypeof = exports.assertNode = void 0; +Object.defineProperty(exports, "assertNode", { + enumerable: true, + get: function () { + return _assertNode.default; + } +}); +Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { + enumerable: true, + get: function () { + return _createTypeAnnotationBasedOnTypeof.default; + } +}); +Object.defineProperty(exports, "createUnionTypeAnnotation", { + enumerable: true, + get: function () { + return _createUnionTypeAnnotation.default; + } +}); +Object.defineProperty(exports, "cloneNode", { + enumerable: true, + get: function () { + return _cloneNode.default; + } +}); +Object.defineProperty(exports, "clone", { + enumerable: true, + get: function () { + return _clone.default; + } +}); +Object.defineProperty(exports, "cloneDeep", { + enumerable: true, + get: function () { + return _cloneDeep.default; + } +}); +Object.defineProperty(exports, "cloneWithoutLoc", { + enumerable: true, + get: function () { + return _cloneWithoutLoc.default; + } +}); +Object.defineProperty(exports, "addComment", { + enumerable: true, + get: function () { + return _addComment.default; + } +}); +Object.defineProperty(exports, "addComments", { + enumerable: true, + get: function () { + return _addComments.default; + } +}); +Object.defineProperty(exports, "inheritInnerComments", { + enumerable: true, + get: function () { + return _inheritInnerComments.default; + } +}); +Object.defineProperty(exports, "inheritLeadingComments", { + enumerable: true, + get: function () { + return _inheritLeadingComments.default; + } +}); +Object.defineProperty(exports, "inheritsComments", { + enumerable: true, + get: function () { + return _inheritsComments.default; + } +}); +Object.defineProperty(exports, "inheritTrailingComments", { + enumerable: true, + get: function () { + return _inheritTrailingComments.default; + } +}); +Object.defineProperty(exports, "removeComments", { + enumerable: true, + get: function () { + return _removeComments.default; + } +}); +Object.defineProperty(exports, "ensureBlock", { + enumerable: true, + get: function () { + return _ensureBlock.default; + } +}); +Object.defineProperty(exports, "toBindingIdentifierName", { + enumerable: true, + get: function () { + return _toBindingIdentifierName.default; + } +}); +Object.defineProperty(exports, "toBlock", { + enumerable: true, + get: function () { + return _toBlock.default; + } +}); +Object.defineProperty(exports, "toComputedKey", { + enumerable: true, + get: function () { + return _toComputedKey.default; + } +}); +Object.defineProperty(exports, "toExpression", { + enumerable: true, + get: function () { + return _toExpression.default; + } +}); +Object.defineProperty(exports, "toIdentifier", { + enumerable: true, + get: function () { + return _toIdentifier.default; + } +}); +Object.defineProperty(exports, "toKeyAlias", { + enumerable: true, + get: function () { + return _toKeyAlias.default; + } +}); +Object.defineProperty(exports, "toSequenceExpression", { + enumerable: true, + get: function () { + return _toSequenceExpression.default; + } +}); +Object.defineProperty(exports, "toStatement", { + enumerable: true, + get: function () { + return _toStatement.default; + } +}); +Object.defineProperty(exports, "valueToNode", { + enumerable: true, + get: function () { + return _valueToNode.default; + } +}); +Object.defineProperty(exports, "appendToMemberExpression", { + enumerable: true, + get: function () { + return _appendToMemberExpression.default; + } +}); +Object.defineProperty(exports, "inherits", { + enumerable: true, + get: function () { + return _inherits.default; + } +}); +Object.defineProperty(exports, "prependToMemberExpression", { + enumerable: true, + get: function () { + return _prependToMemberExpression.default; + } +}); +Object.defineProperty(exports, "removeProperties", { + enumerable: true, + get: function () { + return _removeProperties.default; + } +}); +Object.defineProperty(exports, "removePropertiesDeep", { + enumerable: true, + get: function () { + return _removePropertiesDeep.default; + } +}); +Object.defineProperty(exports, "removeTypeDuplicates", { + enumerable: true, + get: function () { + return _removeTypeDuplicates.default; + } +}); +Object.defineProperty(exports, "getBindingIdentifiers", { + enumerable: true, + get: function () { + return _getBindingIdentifiers.default; + } +}); +Object.defineProperty(exports, "getOuterBindingIdentifiers", { + enumerable: true, + get: function () { + return _getOuterBindingIdentifiers.default; + } +}); +Object.defineProperty(exports, "traverse", { + enumerable: true, + get: function () { + return _traverse.default; + } +}); +Object.defineProperty(exports, "traverseFast", { + enumerable: true, + get: function () { + return _traverseFast.default; + } +}); +Object.defineProperty(exports, "shallowEqual", { + enumerable: true, + get: function () { + return _shallowEqual.default; + } +}); +Object.defineProperty(exports, "is", { + enumerable: true, + get: function () { + return _is.default; + } +}); +Object.defineProperty(exports, "isBinding", { + enumerable: true, + get: function () { + return _isBinding.default; + } +}); +Object.defineProperty(exports, "isBlockScoped", { + enumerable: true, + get: function () { + return _isBlockScoped.default; + } +}); +Object.defineProperty(exports, "isImmutable", { + enumerable: true, + get: function () { + return _isImmutable.default; + } +}); +Object.defineProperty(exports, "isLet", { + enumerable: true, + get: function () { + return _isLet.default; + } +}); +Object.defineProperty(exports, "isNode", { + enumerable: true, + get: function () { + return _isNode.default; + } +}); +Object.defineProperty(exports, "isNodesEquivalent", { + enumerable: true, + get: function () { + return _isNodesEquivalent.default; + } +}); +Object.defineProperty(exports, "isReferenced", { + enumerable: true, + get: function () { + return _isReferenced.default; + } +}); +Object.defineProperty(exports, "isScope", { + enumerable: true, + get: function () { + return _isScope.default; + } +}); +Object.defineProperty(exports, "isSpecifierDefault", { + enumerable: true, + get: function () { + return _isSpecifierDefault.default; + } +}); +Object.defineProperty(exports, "isType", { + enumerable: true, + get: function () { + return _isType.default; + } +}); +Object.defineProperty(exports, "isValidES3Identifier", { + enumerable: true, + get: function () { + return _isValidES3Identifier.default; + } +}); +Object.defineProperty(exports, "isValidIdentifier", { + enumerable: true, + get: function () { + return _isValidIdentifier.default; + } +}); +Object.defineProperty(exports, "isVar", { + enumerable: true, + get: function () { + return _isVar.default; + } +}); +Object.defineProperty(exports, "matchesPattern", { + enumerable: true, + get: function () { + return _matchesPattern.default; + } +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + } +}); +Object.defineProperty(exports, "buildMatchMemberExpression", { + enumerable: true, + get: function () { + return _buildMatchMemberExpression.default; + } +}); +exports.react = void 0; var _isReactComponent = _interopRequireDefault(require("./validators/react/isReactComponent")); @@ -65,78 +380,69 @@ var _buildChildren = _interopRequireDefault(require("./builders/react/buildChild var _assertNode = _interopRequireDefault(require("./asserts/assertNode")); -exports.assertNode = _assertNode.default; - var _generated = require("./asserts/generated"); Object.keys(_generated).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _generated[key]; + } + }); }); var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(require("./builders/flow/createTypeAnnotationBasedOnTypeof")); -exports.createTypeAnnotationBasedOnTypeof = _createTypeAnnotationBasedOnTypeof.default; - var _createUnionTypeAnnotation = _interopRequireDefault(require("./builders/flow/createUnionTypeAnnotation")); -exports.createUnionTypeAnnotation = _createUnionTypeAnnotation.default; - var _generated2 = require("./builders/generated"); Object.keys(_generated2).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated2[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _generated2[key]; + } + }); }); -var _clone = _interopRequireDefault(require("./clone/clone")); +var _cloneNode = _interopRequireDefault(require("./clone/cloneNode")); -exports.clone = _clone.default; +var _clone = _interopRequireDefault(require("./clone/clone")); var _cloneDeep = _interopRequireDefault(require("./clone/cloneDeep")); -exports.cloneDeep = _cloneDeep.default; - var _cloneWithoutLoc = _interopRequireDefault(require("./clone/cloneWithoutLoc")); -exports.cloneWithoutLoc = _cloneWithoutLoc.default; - var _addComment = _interopRequireDefault(require("./comments/addComment")); -exports.addComment = _addComment.default; - var _addComments = _interopRequireDefault(require("./comments/addComments")); -exports.addComments = _addComments.default; - var _inheritInnerComments = _interopRequireDefault(require("./comments/inheritInnerComments")); -exports.inheritInnerComments = _inheritInnerComments.default; - var _inheritLeadingComments = _interopRequireDefault(require("./comments/inheritLeadingComments")); -exports.inheritLeadingComments = _inheritLeadingComments.default; - var _inheritsComments = _interopRequireDefault(require("./comments/inheritsComments")); -exports.inheritsComments = _inheritsComments.default; - var _inheritTrailingComments = _interopRequireDefault(require("./comments/inheritTrailingComments")); -exports.inheritTrailingComments = _inheritTrailingComments.default; - var _removeComments = _interopRequireDefault(require("./comments/removeComments")); -exports.removeComments = _removeComments.default; - var _generated3 = require("./constants/generated"); Object.keys(_generated3).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated3[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _generated3[key]; + } + }); }); var _constants = require("./constants"); @@ -144,180 +450,119 @@ var _constants = require("./constants"); Object.keys(_constants).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _constants[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _constants[key]; + } + }); }); var _ensureBlock = _interopRequireDefault(require("./converters/ensureBlock")); -exports.ensureBlock = _ensureBlock.default; - var _toBindingIdentifierName = _interopRequireDefault(require("./converters/toBindingIdentifierName")); -exports.toBindingIdentifierName = _toBindingIdentifierName.default; - var _toBlock = _interopRequireDefault(require("./converters/toBlock")); -exports.toBlock = _toBlock.default; - var _toComputedKey = _interopRequireDefault(require("./converters/toComputedKey")); -exports.toComputedKey = _toComputedKey.default; - var _toExpression = _interopRequireDefault(require("./converters/toExpression")); -exports.toExpression = _toExpression.default; - var _toIdentifier = _interopRequireDefault(require("./converters/toIdentifier")); -exports.toIdentifier = _toIdentifier.default; - var _toKeyAlias = _interopRequireDefault(require("./converters/toKeyAlias")); -exports.toKeyAlias = _toKeyAlias.default; - var _toSequenceExpression = _interopRequireDefault(require("./converters/toSequenceExpression")); -exports.toSequenceExpression = _toSequenceExpression.default; - var _toStatement = _interopRequireDefault(require("./converters/toStatement")); -exports.toStatement = _toStatement.default; - var _valueToNode = _interopRequireDefault(require("./converters/valueToNode")); -exports.valueToNode = _valueToNode.default; - var _definitions = require("./definitions"); Object.keys(_definitions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _definitions[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _definitions[key]; + } + }); }); var _appendToMemberExpression = _interopRequireDefault(require("./modifications/appendToMemberExpression")); -exports.appendToMemberExpression = _appendToMemberExpression.default; - var _inherits = _interopRequireDefault(require("./modifications/inherits")); -exports.inherits = _inherits.default; - var _prependToMemberExpression = _interopRequireDefault(require("./modifications/prependToMemberExpression")); -exports.prependToMemberExpression = _prependToMemberExpression.default; - var _removeProperties = _interopRequireDefault(require("./modifications/removeProperties")); -exports.removeProperties = _removeProperties.default; - var _removePropertiesDeep = _interopRequireDefault(require("./modifications/removePropertiesDeep")); -exports.removePropertiesDeep = _removePropertiesDeep.default; - var _removeTypeDuplicates = _interopRequireDefault(require("./modifications/flow/removeTypeDuplicates")); -exports.removeTypeDuplicates = _removeTypeDuplicates.default; - var _getBindingIdentifiers = _interopRequireDefault(require("./retrievers/getBindingIdentifiers")); -exports.getBindingIdentifiers = _getBindingIdentifiers.default; - var _getOuterBindingIdentifiers = _interopRequireDefault(require("./retrievers/getOuterBindingIdentifiers")); -exports.getOuterBindingIdentifiers = _getOuterBindingIdentifiers.default; - var _traverse = _interopRequireDefault(require("./traverse/traverse")); -exports.traverse = _traverse.default; - var _traverseFast = _interopRequireDefault(require("./traverse/traverseFast")); -exports.traverseFast = _traverseFast.default; - var _shallowEqual = _interopRequireDefault(require("./utils/shallowEqual")); -exports.shallowEqual = _shallowEqual.default; - var _is = _interopRequireDefault(require("./validators/is")); -exports.is = _is.default; - var _isBinding = _interopRequireDefault(require("./validators/isBinding")); -exports.isBinding = _isBinding.default; - var _isBlockScoped = _interopRequireDefault(require("./validators/isBlockScoped")); -exports.isBlockScoped = _isBlockScoped.default; - var _isImmutable = _interopRequireDefault(require("./validators/isImmutable")); -exports.isImmutable = _isImmutable.default; - var _isLet = _interopRequireDefault(require("./validators/isLet")); -exports.isLet = _isLet.default; - var _isNode = _interopRequireDefault(require("./validators/isNode")); -exports.isNode = _isNode.default; - var _isNodesEquivalent = _interopRequireDefault(require("./validators/isNodesEquivalent")); -exports.isNodesEquivalent = _isNodesEquivalent.default; - var _isReferenced = _interopRequireDefault(require("./validators/isReferenced")); -exports.isReferenced = _isReferenced.default; - var _isScope = _interopRequireDefault(require("./validators/isScope")); -exports.isScope = _isScope.default; - var _isSpecifierDefault = _interopRequireDefault(require("./validators/isSpecifierDefault")); -exports.isSpecifierDefault = _isSpecifierDefault.default; - var _isType = _interopRequireDefault(require("./validators/isType")); -exports.isType = _isType.default; - var _isValidES3Identifier = _interopRequireDefault(require("./validators/isValidES3Identifier")); -exports.isValidES3Identifier = _isValidES3Identifier.default; - var _isValidIdentifier = _interopRequireDefault(require("./validators/isValidIdentifier")); -exports.isValidIdentifier = _isValidIdentifier.default; - var _isVar = _interopRequireDefault(require("./validators/isVar")); -exports.isVar = _isVar.default; - var _matchesPattern = _interopRequireDefault(require("./validators/matchesPattern")); -exports.matchesPattern = _matchesPattern.default; - var _validate = _interopRequireDefault(require("./validators/validate")); -exports.validate = _validate.default; - var _buildMatchMemberExpression = _interopRequireDefault(require("./validators/buildMatchMemberExpression")); -exports.buildMatchMemberExpression = _buildMatchMemberExpression.default; - var _generated4 = require("./validators/generated"); Object.keys(_generated4).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _generated4[key]; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _generated4[key]; + } + }); }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var react = { +const react = { isReactComponent: _isReactComponent.default, isCompatTag: _isCompatTag.default, buildChildren: _buildChildren.default 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 new file mode 100644 index 00000000000000..f3e3e39df963ed --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow @@ -0,0 +1,1960 @@ +// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/flow.js for script used. + +declare class BabelNodeComment { + value: string; + start: number; + end: number; + loc: BabelNodeSourceLocation; +} + +declare class BabelNodeCommentBlock extends BabelNodeComment { + type: "CommentBlock"; +} + +declare class BabelNodeCommentLine extends BabelNodeComment { + type: "CommentLine"; +} + +declare class BabelNodeSourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +declare class BabelNode { + leadingComments?: Array; + innerComments?: Array; + trailingComments?: Array; + start: ?number; + end: ?number; + loc: ?BabelNodeSourceLocation; +} + +declare class BabelNodeArrayExpression extends BabelNode { + type: "ArrayExpression"; + elements?: Array; +} + +declare class BabelNodeAssignmentExpression extends BabelNode { + type: "AssignmentExpression"; + operator: string; + left: BabelNodeLVal; + right: BabelNodeExpression; +} + +declare class BabelNodeBinaryExpression extends BabelNode { + type: "BinaryExpression"; + operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; + left: BabelNodeExpression; + right: BabelNodeExpression; +} + +declare class BabelNodeInterpreterDirective extends BabelNode { + type: "InterpreterDirective"; + value: string; +} + +declare class BabelNodeDirective extends BabelNode { + type: "Directive"; + value: BabelNodeDirectiveLiteral; +} + +declare class BabelNodeDirectiveLiteral extends BabelNode { + type: "DirectiveLiteral"; + value: string; +} + +declare class BabelNodeBlockStatement extends BabelNode { + type: "BlockStatement"; + body: Array; + directives?: Array; +} + +declare class BabelNodeBreakStatement extends BabelNode { + type: "BreakStatement"; + label?: BabelNodeIdentifier; +} + +declare class BabelNodeCallExpression extends BabelNode { + type: "CallExpression"; + callee: BabelNodeExpression; + arguments: Array; + optional?: true | false; + typeArguments?: BabelNodeTypeParameterInstantiation; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeCatchClause extends BabelNode { + type: "CatchClause"; + param?: BabelNodeIdentifier; + body: BabelNodeBlockStatement; +} + +declare class BabelNodeConditionalExpression extends BabelNode { + type: "ConditionalExpression"; + test: BabelNodeExpression; + consequent: BabelNodeExpression; + alternate: BabelNodeExpression; +} + +declare class BabelNodeContinueStatement extends BabelNode { + type: "ContinueStatement"; + label?: BabelNodeIdentifier; +} + +declare class BabelNodeDebuggerStatement extends BabelNode { + type: "DebuggerStatement"; +} + +declare class BabelNodeDoWhileStatement extends BabelNode { + type: "DoWhileStatement"; + test: BabelNodeExpression; + body: BabelNodeStatement; +} + +declare class BabelNodeEmptyStatement extends BabelNode { + type: "EmptyStatement"; +} + +declare class BabelNodeExpressionStatement extends BabelNode { + type: "ExpressionStatement"; + expression: BabelNodeExpression; +} + +declare class BabelNodeFile extends BabelNode { + type: "File"; + program: BabelNodeProgram; + comments: any; + tokens: any; +} + +declare class BabelNodeForInStatement extends BabelNode { + type: "ForInStatement"; + left: BabelNodeVariableDeclaration | BabelNodeLVal; + right: BabelNodeExpression; + body: BabelNodeStatement; +} + +declare class BabelNodeForStatement extends BabelNode { + type: "ForStatement"; + init?: BabelNodeVariableDeclaration | BabelNodeExpression; + test?: BabelNodeExpression; + update?: BabelNodeExpression; + body: BabelNodeStatement; +} + +declare class BabelNodeFunctionDeclaration extends BabelNode { + type: "FunctionDeclaration"; + id?: BabelNodeIdentifier; + params: Array; + body: BabelNodeBlockStatement; + generator?: boolean; + async?: boolean; + declare?: boolean; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeFunctionExpression extends BabelNode { + type: "FunctionExpression"; + id?: BabelNodeIdentifier; + params: Array; + body: BabelNodeBlockStatement; + generator?: boolean; + async?: boolean; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeIdentifier extends BabelNode { + type: "Identifier"; + name: string; + decorators?: Array; + optional?: boolean; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; +} + +declare class BabelNodeIfStatement extends BabelNode { + type: "IfStatement"; + test: BabelNodeExpression; + consequent: BabelNodeStatement; + alternate?: BabelNodeStatement; +} + +declare class BabelNodeLabeledStatement extends BabelNode { + type: "LabeledStatement"; + label: BabelNodeIdentifier; + body: BabelNodeStatement; +} + +declare class BabelNodeStringLiteral extends BabelNode { + type: "StringLiteral"; + value: string; +} + +declare class BabelNodeNumericLiteral extends BabelNode { + type: "NumericLiteral"; + value: number; +} + +declare class BabelNodeNullLiteral extends BabelNode { + type: "NullLiteral"; +} + +declare class BabelNodeBooleanLiteral extends BabelNode { + type: "BooleanLiteral"; + value: boolean; +} + +declare class BabelNodeRegExpLiteral extends BabelNode { + type: "RegExpLiteral"; + pattern: string; + flags?: string; +} + +declare class BabelNodeLogicalExpression extends BabelNode { + type: "LogicalExpression"; + operator: "||" | "&&" | "??"; + left: BabelNodeExpression; + right: BabelNodeExpression; +} + +declare class BabelNodeMemberExpression extends BabelNode { + type: "MemberExpression"; + object: BabelNodeExpression; + property: any; + computed?: boolean; + optional?: true | false; +} + +declare class BabelNodeNewExpression extends BabelNode { + type: "NewExpression"; + callee: BabelNodeExpression; + arguments: Array; + optional?: true | false; + typeArguments?: BabelNodeTypeParameterInstantiation; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeProgram extends BabelNode { + type: "Program"; + body: Array; + directives?: Array; + sourceType?: "script" | "module"; + interpreter?: BabelNodeInterpreterDirective; + sourceFile?: string; +} + +declare class BabelNodeObjectExpression extends BabelNode { + type: "ObjectExpression"; + properties: Array; +} + +declare class BabelNodeObjectMethod extends BabelNode { + type: "ObjectMethod"; + kind?: "method" | "get" | "set"; + key: any; + params: Array; + body: BabelNodeBlockStatement; + computed?: boolean; + async?: boolean; + decorators?: Array; + generator?: boolean; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeObjectProperty extends BabelNode { + type: "ObjectProperty"; + key: any; + value: BabelNodeExpression | BabelNodePatternLike; + computed?: boolean; + shorthand?: boolean; + decorators?: Array; +} + +declare class BabelNodeRestElement extends BabelNode { + type: "RestElement"; + argument: BabelNodeLVal; + decorators?: Array; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; +} + +declare class BabelNodeReturnStatement extends BabelNode { + type: "ReturnStatement"; + argument?: BabelNodeExpression; +} + +declare class BabelNodeSequenceExpression extends BabelNode { + type: "SequenceExpression"; + expressions: Array; +} + +declare class BabelNodeSwitchCase extends BabelNode { + type: "SwitchCase"; + test?: BabelNodeExpression; + consequent: Array; +} + +declare class BabelNodeSwitchStatement extends BabelNode { + type: "SwitchStatement"; + discriminant: BabelNodeExpression; + cases: Array; +} + +declare class BabelNodeThisExpression extends BabelNode { + type: "ThisExpression"; +} + +declare class BabelNodeThrowStatement extends BabelNode { + type: "ThrowStatement"; + argument: BabelNodeExpression; +} + +declare class BabelNodeTryStatement extends BabelNode { + type: "TryStatement"; + block: BabelNodeBlockStatement; + handler?: BabelNodeCatchClause; + finalizer?: BabelNodeBlockStatement; +} + +declare class BabelNodeUnaryExpression extends BabelNode { + type: "UnaryExpression"; + operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"; + argument: BabelNodeExpression; + prefix?: boolean; +} + +declare class BabelNodeUpdateExpression extends BabelNode { + type: "UpdateExpression"; + operator: "++" | "--"; + argument: BabelNodeExpression; + prefix?: boolean; +} + +declare class BabelNodeVariableDeclaration extends BabelNode { + type: "VariableDeclaration"; + kind: "var" | "let" | "const"; + declarations: Array; + declare?: boolean; +} + +declare class BabelNodeVariableDeclarator extends BabelNode { + type: "VariableDeclarator"; + id: BabelNodeLVal; + init?: BabelNodeExpression; + definite?: boolean; +} + +declare class BabelNodeWhileStatement extends BabelNode { + type: "WhileStatement"; + test: BabelNodeExpression; + body: BabelNodeBlockStatement | BabelNodeStatement; +} + +declare class BabelNodeWithStatement extends BabelNode { + type: "WithStatement"; + object: BabelNodeExpression; + body: BabelNodeBlockStatement | BabelNodeStatement; +} + +declare class BabelNodeAssignmentPattern extends BabelNode { + type: "AssignmentPattern"; + left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern; + right: BabelNodeExpression; + decorators?: Array; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; +} + +declare class BabelNodeArrayPattern extends BabelNode { + type: "ArrayPattern"; + elements: Array; + decorators?: Array; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; +} + +declare class BabelNodeArrowFunctionExpression extends BabelNode { + type: "ArrowFunctionExpression"; + params: Array; + body: BabelNodeBlockStatement | BabelNodeExpression; + async?: boolean; + expression?: boolean; + generator?: boolean; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeClassBody extends BabelNode { + type: "ClassBody"; + body: Array; +} + +declare class BabelNodeClassDeclaration extends BabelNode { + type: "ClassDeclaration"; + id?: BabelNodeIdentifier; + superClass?: BabelNodeExpression; + body: BabelNodeClassBody; + decorators?: Array; + abstract?: boolean; + declare?: boolean; + mixins?: any; + superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeClassExpression extends BabelNode { + type: "ClassExpression"; + id?: BabelNodeIdentifier; + superClass?: BabelNodeExpression; + body: BabelNodeClassBody; + decorators?: Array; + mixins?: any; + superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeExportAllDeclaration extends BabelNode { + type: "ExportAllDeclaration"; + source: BabelNodeStringLiteral; +} + +declare class BabelNodeExportDefaultDeclaration extends BabelNode { + type: "ExportDefaultDeclaration"; + declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression; +} + +declare class BabelNodeExportNamedDeclaration extends BabelNode { + type: "ExportNamedDeclaration"; + declaration?: BabelNodeDeclaration; + specifiers: Array; + source?: BabelNodeStringLiteral; +} + +declare class BabelNodeExportSpecifier extends BabelNode { + type: "ExportSpecifier"; + local: BabelNodeIdentifier; + exported: BabelNodeIdentifier; +} + +declare class BabelNodeForOfStatement extends BabelNode { + type: "ForOfStatement"; + left: BabelNodeVariableDeclaration | BabelNodeLVal; + right: BabelNodeExpression; + body: BabelNodeStatement; +} + +declare class BabelNodeImportDeclaration extends BabelNode { + type: "ImportDeclaration"; + specifiers: Array; + source: BabelNodeStringLiteral; + importKind?: "type" | "typeof" | "value"; +} + +declare class BabelNodeImportDefaultSpecifier extends BabelNode { + type: "ImportDefaultSpecifier"; + local: BabelNodeIdentifier; +} + +declare class BabelNodeImportNamespaceSpecifier extends BabelNode { + type: "ImportNamespaceSpecifier"; + local: BabelNodeIdentifier; +} + +declare class BabelNodeImportSpecifier extends BabelNode { + type: "ImportSpecifier"; + local: BabelNodeIdentifier; + imported: BabelNodeIdentifier; + importKind?: "type" | "typeof"; +} + +declare class BabelNodeMetaProperty extends BabelNode { + type: "MetaProperty"; + meta: BabelNodeIdentifier; + property: BabelNodeIdentifier; +} + +declare class BabelNodeClassMethod extends BabelNode { + type: "ClassMethod"; + kind?: "get" | "set" | "method" | "constructor"; + key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; + params: Array; + body: BabelNodeBlockStatement; + computed?: boolean; + abstract?: boolean; + access?: "public" | "private" | "protected"; + accessibility?: "public" | "private" | "protected"; + async?: boolean; + decorators?: Array; + generator?: boolean; + optional?: boolean; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; +} + +declare class BabelNodeObjectPattern extends BabelNode { + type: "ObjectPattern"; + properties: Array; + decorators?: Array; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; +} + +declare class BabelNodeSpreadElement extends BabelNode { + type: "SpreadElement"; + argument: BabelNodeExpression; +} + +declare class BabelNodeSuper extends BabelNode { + type: "Super"; +} + +declare class BabelNodeTaggedTemplateExpression extends BabelNode { + type: "TaggedTemplateExpression"; + tag: BabelNodeExpression; + quasi: BabelNodeTemplateLiteral; + typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeTemplateElement extends BabelNode { + type: "TemplateElement"; + value: any; + tail?: boolean; +} + +declare class BabelNodeTemplateLiteral extends BabelNode { + type: "TemplateLiteral"; + quasis: Array; + expressions: Array; +} + +declare class BabelNodeYieldExpression extends BabelNode { + type: "YieldExpression"; + argument?: BabelNodeExpression; + delegate?: boolean; +} + +declare class BabelNodeAnyTypeAnnotation extends BabelNode { + type: "AnyTypeAnnotation"; +} + +declare class BabelNodeArrayTypeAnnotation extends BabelNode { + type: "ArrayTypeAnnotation"; + elementType: BabelNodeFlowType; +} + +declare class BabelNodeBooleanTypeAnnotation extends BabelNode { + type: "BooleanTypeAnnotation"; +} + +declare class BabelNodeBooleanLiteralTypeAnnotation extends BabelNode { + type: "BooleanLiteralTypeAnnotation"; + value: boolean; +} + +declare class BabelNodeNullLiteralTypeAnnotation extends BabelNode { + type: "NullLiteralTypeAnnotation"; +} + +declare class BabelNodeClassImplements extends BabelNode { + type: "ClassImplements"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterInstantiation; +} + +declare class BabelNodeDeclareClass extends BabelNode { + type: "DeclareClass"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + body: BabelNodeObjectTypeAnnotation; + mixins?: Array; +} + +declare class BabelNodeDeclareFunction extends BabelNode { + type: "DeclareFunction"; + id: BabelNodeIdentifier; + predicate?: BabelNodeDeclaredPredicate; +} + +declare class BabelNodeDeclareInterface extends BabelNode { + type: "DeclareInterface"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + body: BabelNodeObjectTypeAnnotation; + mixins?: Array; +} + +declare class BabelNodeDeclareModule extends BabelNode { + type: "DeclareModule"; + id: BabelNodeIdentifier | BabelNodeStringLiteral; + body: BabelNodeBlockStatement; + kind?: "CommonJS" | "ES"; +} + +declare class BabelNodeDeclareModuleExports extends BabelNode { + type: "DeclareModuleExports"; + typeAnnotation: BabelNodeTypeAnnotation; +} + +declare class BabelNodeDeclareTypeAlias extends BabelNode { + type: "DeclareTypeAlias"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + right: BabelNodeFlowType; +} + +declare class BabelNodeDeclareOpaqueType extends BabelNode { + type: "DeclareOpaqueType"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + supertype?: BabelNodeFlowType; +} + +declare class BabelNodeDeclareVariable extends BabelNode { + type: "DeclareVariable"; + id: BabelNodeIdentifier; +} + +declare class BabelNodeDeclareExportDeclaration extends BabelNode { + type: "DeclareExportDeclaration"; + declaration?: BabelNodeFlow; + specifiers?: Array; + source?: BabelNodeStringLiteral; +} + +declare class BabelNodeDeclareExportAllDeclaration extends BabelNode { + type: "DeclareExportAllDeclaration"; + source: BabelNodeStringLiteral; + exportKind?: ["type","value"]; +} + +declare class BabelNodeDeclaredPredicate extends BabelNode { + type: "DeclaredPredicate"; + value: BabelNodeFlow; +} + +declare class BabelNodeExistsTypeAnnotation extends BabelNode { + type: "ExistsTypeAnnotation"; +} + +declare class BabelNodeFunctionTypeAnnotation extends BabelNode { + type: "FunctionTypeAnnotation"; + typeParameters?: BabelNodeTypeParameterDeclaration; + params: Array; + rest?: BabelNodeFunctionTypeParam; + returnType: BabelNodeFlowType; +} + +declare class BabelNodeFunctionTypeParam extends BabelNode { + type: "FunctionTypeParam"; + name?: BabelNodeIdentifier; + typeAnnotation: BabelNodeFlowType; + optional?: boolean; +} + +declare class BabelNodeGenericTypeAnnotation extends BabelNode { + type: "GenericTypeAnnotation"; + id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; + typeParameters?: BabelNodeTypeParameterInstantiation; +} + +declare class BabelNodeInferredPredicate extends BabelNode { + type: "InferredPredicate"; +} + +declare class BabelNodeInterfaceExtends extends BabelNode { + type: "InterfaceExtends"; + id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; + typeParameters?: BabelNodeTypeParameterInstantiation; +} + +declare class BabelNodeInterfaceDeclaration extends BabelNode { + type: "InterfaceDeclaration"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + body: BabelNodeObjectTypeAnnotation; + mixins?: Array; +} + +declare class BabelNodeInterfaceTypeAnnotation extends BabelNode { + type: "InterfaceTypeAnnotation"; + body: BabelNodeObjectTypeAnnotation; +} + +declare class BabelNodeIntersectionTypeAnnotation extends BabelNode { + type: "IntersectionTypeAnnotation"; + types: Array; +} + +declare class BabelNodeMixedTypeAnnotation extends BabelNode { + type: "MixedTypeAnnotation"; +} + +declare class BabelNodeEmptyTypeAnnotation extends BabelNode { + type: "EmptyTypeAnnotation"; +} + +declare class BabelNodeNullableTypeAnnotation extends BabelNode { + type: "NullableTypeAnnotation"; + typeAnnotation: BabelNodeFlowType; +} + +declare class BabelNodeNumberLiteralTypeAnnotation extends BabelNode { + type: "NumberLiteralTypeAnnotation"; + value: number; +} + +declare class BabelNodeNumberTypeAnnotation extends BabelNode { + type: "NumberTypeAnnotation"; +} + +declare class BabelNodeObjectTypeAnnotation extends BabelNode { + type: "ObjectTypeAnnotation"; + properties: Array; + indexers?: Array; + callProperties?: Array; + internalSlots?: Array; + exact?: boolean; + inexact?: boolean; +} + +declare class BabelNodeObjectTypeInternalSlot extends BabelNode { + type: "ObjectTypeInternalSlot"; + id: BabelNodeIdentifier; + value: BabelNodeFlowType; + optional: boolean; + method: boolean; +} + +declare class BabelNodeObjectTypeCallProperty extends BabelNode { + type: "ObjectTypeCallProperty"; + value: BabelNodeFlowType; +} + +declare class BabelNodeObjectTypeIndexer extends BabelNode { + type: "ObjectTypeIndexer"; + id?: BabelNodeIdentifier; + key: BabelNodeFlowType; + value: BabelNodeFlowType; + variance?: BabelNodeVariance; +} + +declare class BabelNodeObjectTypeProperty extends BabelNode { + type: "ObjectTypeProperty"; + key: BabelNodeIdentifier | BabelNodeStringLiteral; + value: BabelNodeFlowType; + variance?: BabelNodeVariance; + kind?: "init" | "get" | "set"; + optional?: boolean; + proto?: boolean; +} + +declare class BabelNodeObjectTypeSpreadProperty extends BabelNode { + type: "ObjectTypeSpreadProperty"; + argument: BabelNodeFlowType; +} + +declare class BabelNodeOpaqueType extends BabelNode { + type: "OpaqueType"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + supertype?: BabelNodeFlowType; + impltype: BabelNodeFlowType; +} + +declare class BabelNodeQualifiedTypeIdentifier extends BabelNode { + type: "QualifiedTypeIdentifier"; + id: BabelNodeIdentifier; + qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; +} + +declare class BabelNodeStringLiteralTypeAnnotation extends BabelNode { + type: "StringLiteralTypeAnnotation"; + value: string; +} + +declare class BabelNodeStringTypeAnnotation extends BabelNode { + type: "StringTypeAnnotation"; +} + +declare class BabelNodeThisTypeAnnotation extends BabelNode { + type: "ThisTypeAnnotation"; +} + +declare class BabelNodeTupleTypeAnnotation extends BabelNode { + type: "TupleTypeAnnotation"; + types: Array; +} + +declare class BabelNodeTypeofTypeAnnotation extends BabelNode { + type: "TypeofTypeAnnotation"; + argument: BabelNodeFlowType; +} + +declare class BabelNodeTypeAlias extends BabelNode { + type: "TypeAlias"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTypeParameterDeclaration; + right: BabelNodeFlowType; +} + +declare class BabelNodeTypeAnnotation extends BabelNode { + type: "TypeAnnotation"; + typeAnnotation: BabelNodeFlowType; +} + +declare class BabelNodeTypeCastExpression extends BabelNode { + type: "TypeCastExpression"; + expression: BabelNodeExpression; + typeAnnotation: BabelNodeTypeAnnotation; +} + +declare class BabelNodeTypeParameter extends BabelNode { + type: "TypeParameter"; + bound?: BabelNodeTypeAnnotation; + variance?: BabelNodeVariance; + name?: string; +} + +declare class BabelNodeTypeParameterDeclaration extends BabelNode { + type: "TypeParameterDeclaration"; + params: Array; +} + +declare class BabelNodeTypeParameterInstantiation extends BabelNode { + type: "TypeParameterInstantiation"; + params: Array; +} + +declare class BabelNodeUnionTypeAnnotation extends BabelNode { + type: "UnionTypeAnnotation"; + types: Array; +} + +declare class BabelNodeVariance extends BabelNode { + type: "Variance"; + kind: "minus" | "plus"; +} + +declare class BabelNodeVoidTypeAnnotation extends BabelNode { + type: "VoidTypeAnnotation"; +} + +declare class BabelNodeJSXAttribute extends BabelNode { + type: "JSXAttribute"; + name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName; + value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer; +} + +declare class BabelNodeJSXClosingElement extends BabelNode { + type: "JSXClosingElement"; + name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression; +} + +declare class BabelNodeJSXElement extends BabelNode { + type: "JSXElement"; + openingElement: BabelNodeJSXOpeningElement; + closingElement?: BabelNodeJSXClosingElement; + children: Array; + selfClosing: any; +} + +declare class BabelNodeJSXEmptyExpression extends BabelNode { + type: "JSXEmptyExpression"; +} + +declare class BabelNodeJSXExpressionContainer extends BabelNode { + type: "JSXExpressionContainer"; + expression: BabelNodeExpression | BabelNodeJSXEmptyExpression; +} + +declare class BabelNodeJSXSpreadChild extends BabelNode { + type: "JSXSpreadChild"; + expression: BabelNodeExpression; +} + +declare class BabelNodeJSXIdentifier extends BabelNode { + type: "JSXIdentifier"; + name: string; +} + +declare class BabelNodeJSXMemberExpression extends BabelNode { + type: "JSXMemberExpression"; + object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier; + property: BabelNodeJSXIdentifier; +} + +declare class BabelNodeJSXNamespacedName extends BabelNode { + type: "JSXNamespacedName"; + namespace: BabelNodeJSXIdentifier; + name: BabelNodeJSXIdentifier; +} + +declare class BabelNodeJSXOpeningElement extends BabelNode { + type: "JSXOpeningElement"; + name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression; + attributes: Array; + selfClosing?: boolean; + typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeJSXSpreadAttribute extends BabelNode { + type: "JSXSpreadAttribute"; + argument: BabelNodeExpression; +} + +declare class BabelNodeJSXText extends BabelNode { + type: "JSXText"; + value: string; +} + +declare class BabelNodeJSXFragment extends BabelNode { + type: "JSXFragment"; + openingFragment: BabelNodeJSXOpeningFragment; + closingFragment: BabelNodeJSXClosingFragment; + children: Array; +} + +declare class BabelNodeJSXOpeningFragment extends BabelNode { + type: "JSXOpeningFragment"; +} + +declare class BabelNodeJSXClosingFragment extends BabelNode { + type: "JSXClosingFragment"; +} + +declare class BabelNodeNoop extends BabelNode { + type: "Noop"; +} + +declare class BabelNodeParenthesizedExpression extends BabelNode { + type: "ParenthesizedExpression"; + expression: BabelNodeExpression; +} + +declare class BabelNodeAwaitExpression extends BabelNode { + type: "AwaitExpression"; + argument: BabelNodeExpression; +} + +declare class BabelNodeBindExpression extends BabelNode { + type: "BindExpression"; + object: any; + callee: any; +} + +declare class BabelNodeClassProperty extends BabelNode { + type: "ClassProperty"; + key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; + value?: BabelNodeExpression; + typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + decorators?: Array; + computed?: boolean; + abstract?: boolean; + accessibility?: "public" | "private" | "protected"; + definite?: boolean; + optional?: boolean; + readonly?: boolean; +} + +declare class BabelNodeOptionalMemberExpression extends BabelNode { + type: "OptionalMemberExpression"; + object: BabelNodeExpression; + property: any; + computed?: boolean; + optional: boolean; +} + +declare class BabelNodePipelineTopicExpression extends BabelNode { + type: "PipelineTopicExpression"; + expression: BabelNodeExpression; +} + +declare class BabelNodePipelineBareFunction extends BabelNode { + type: "PipelineBareFunction"; + callee: BabelNodeExpression; +} + +declare class BabelNodePipelinePrimaryTopicReference extends BabelNode { + type: "PipelinePrimaryTopicReference"; +} + +declare class BabelNodeOptionalCallExpression extends BabelNode { + type: "OptionalCallExpression"; + callee: BabelNodeExpression; + arguments: Array; + optional: boolean; + typeArguments?: BabelNodeTypeParameterInstantiation; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeClassPrivateProperty extends BabelNode { + type: "ClassPrivateProperty"; + key: BabelNodePrivateName; + value?: BabelNodeExpression; +} + +declare class BabelNodeClassPrivateMethod extends BabelNode { + type: "ClassPrivateMethod"; + kind?: "get" | "set" | "method" | "constructor"; + key: BabelNodePrivateName; + params: Array; + body: BabelNodeBlockStatement; + abstract?: boolean; + access?: "public" | "private" | "protected"; + accessibility?: "public" | "private" | "protected"; + async?: boolean; + computed?: boolean; + decorators?: Array; + generator?: boolean; + optional?: boolean; + returnType?: any; + typeParameters?: any; +} + +declare class BabelNodeImport extends BabelNode { + type: "Import"; +} + +declare class BabelNodeDecorator extends BabelNode { + type: "Decorator"; + expression: BabelNodeExpression; +} + +declare class BabelNodeDoExpression extends BabelNode { + type: "DoExpression"; + body: BabelNodeBlockStatement; +} + +declare class BabelNodeExportDefaultSpecifier extends BabelNode { + type: "ExportDefaultSpecifier"; + exported: BabelNodeIdentifier; +} + +declare class BabelNodeExportNamespaceSpecifier extends BabelNode { + type: "ExportNamespaceSpecifier"; + exported: BabelNodeIdentifier; +} + +declare class BabelNodePrivateName extends BabelNode { + type: "PrivateName"; + id: BabelNodeIdentifier; +} + +declare class BabelNodeBigIntLiteral extends BabelNode { + type: "BigIntLiteral"; + value: string; +} + +declare class BabelNodeTSParameterProperty extends BabelNode { + type: "TSParameterProperty"; + parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern; + accessibility?: "public" | "private" | "protected"; + readonly?: boolean; +} + +declare class BabelNodeTSDeclareFunction extends BabelNode { + type: "TSDeclareFunction"; + id?: BabelNodeIdentifier; + typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; + params: Array; + returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop; + async?: boolean; + declare?: boolean; + generator?: boolean; +} + +declare class BabelNodeTSDeclareMethod extends BabelNode { + type: "TSDeclareMethod"; + decorators?: Array; + key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; + typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; + params: Array; + returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop; + abstract?: boolean; + access?: "public" | "private" | "protected"; + accessibility?: "public" | "private" | "protected"; + async?: boolean; + computed?: boolean; + generator?: boolean; + kind?: "get" | "set" | "method" | "constructor"; + optional?: boolean; +} + +declare class BabelNodeTSQualifiedName extends BabelNode { + type: "TSQualifiedName"; + left: BabelNodeTSEntityName; + right: BabelNodeIdentifier; +} + +declare class BabelNodeTSCallSignatureDeclaration extends BabelNode { + type: "TSCallSignatureDeclaration"; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + parameters?: Array; + typeAnnotation?: BabelNodeTSTypeAnnotation; +} + +declare class BabelNodeTSConstructSignatureDeclaration extends BabelNode { + type: "TSConstructSignatureDeclaration"; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + parameters?: Array; + typeAnnotation?: BabelNodeTSTypeAnnotation; +} + +declare class BabelNodeTSPropertySignature extends BabelNode { + type: "TSPropertySignature"; + key: BabelNodeExpression; + typeAnnotation?: BabelNodeTSTypeAnnotation; + initializer?: BabelNodeExpression; + computed?: boolean; + optional?: boolean; + readonly?: boolean; +} + +declare class BabelNodeTSMethodSignature extends BabelNode { + type: "TSMethodSignature"; + key: BabelNodeExpression; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + parameters?: Array; + typeAnnotation?: BabelNodeTSTypeAnnotation; + computed?: boolean; + optional?: boolean; +} + +declare class BabelNodeTSIndexSignature extends BabelNode { + type: "TSIndexSignature"; + parameters: Array; + typeAnnotation?: BabelNodeTSTypeAnnotation; + readonly?: boolean; +} + +declare class BabelNodeTSAnyKeyword extends BabelNode { + type: "TSAnyKeyword"; +} + +declare class BabelNodeTSUnknownKeyword extends BabelNode { + type: "TSUnknownKeyword"; +} + +declare class BabelNodeTSNumberKeyword extends BabelNode { + type: "TSNumberKeyword"; +} + +declare class BabelNodeTSObjectKeyword extends BabelNode { + type: "TSObjectKeyword"; +} + +declare class BabelNodeTSBooleanKeyword extends BabelNode { + type: "TSBooleanKeyword"; +} + +declare class BabelNodeTSStringKeyword extends BabelNode { + type: "TSStringKeyword"; +} + +declare class BabelNodeTSSymbolKeyword extends BabelNode { + type: "TSSymbolKeyword"; +} + +declare class BabelNodeTSVoidKeyword extends BabelNode { + type: "TSVoidKeyword"; +} + +declare class BabelNodeTSUndefinedKeyword extends BabelNode { + type: "TSUndefinedKeyword"; +} + +declare class BabelNodeTSNullKeyword extends BabelNode { + type: "TSNullKeyword"; +} + +declare class BabelNodeTSNeverKeyword extends BabelNode { + type: "TSNeverKeyword"; +} + +declare class BabelNodeTSThisType extends BabelNode { + type: "TSThisType"; +} + +declare class BabelNodeTSFunctionType extends BabelNode { + type: "TSFunctionType"; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + typeAnnotation?: BabelNodeTSTypeAnnotation; + parameters?: Array; +} + +declare class BabelNodeTSConstructorType extends BabelNode { + type: "TSConstructorType"; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + typeAnnotation?: BabelNodeTSTypeAnnotation; + parameters?: Array; +} + +declare class BabelNodeTSTypeReference extends BabelNode { + type: "TSTypeReference"; + typeName: BabelNodeTSEntityName; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeTSTypePredicate extends BabelNode { + type: "TSTypePredicate"; + parameterName: BabelNodeIdentifier | BabelNodeTSThisType; + typeAnnotation: BabelNodeTSTypeAnnotation; +} + +declare class BabelNodeTSTypeQuery extends BabelNode { + type: "TSTypeQuery"; + exprName: BabelNodeTSEntityName | BabelNodeTSImportType; +} + +declare class BabelNodeTSTypeLiteral extends BabelNode { + type: "TSTypeLiteral"; + members: Array; +} + +declare class BabelNodeTSArrayType extends BabelNode { + type: "TSArrayType"; + elementType: BabelNodeTSType; +} + +declare class BabelNodeTSTupleType extends BabelNode { + type: "TSTupleType"; + elementTypes: Array; +} + +declare class BabelNodeTSOptionalType extends BabelNode { + type: "TSOptionalType"; + typeAnnotation: BabelNodeTSType; +} + +declare class BabelNodeTSRestType extends BabelNode { + type: "TSRestType"; + typeAnnotation: BabelNodeTSType; +} + +declare class BabelNodeTSUnionType extends BabelNode { + type: "TSUnionType"; + types: Array; +} + +declare class BabelNodeTSIntersectionType extends BabelNode { + type: "TSIntersectionType"; + types: Array; +} + +declare class BabelNodeTSConditionalType extends BabelNode { + type: "TSConditionalType"; + checkType: BabelNodeTSType; + extendsType: BabelNodeTSType; + trueType: BabelNodeTSType; + falseType: BabelNodeTSType; +} + +declare class BabelNodeTSInferType extends BabelNode { + type: "TSInferType"; + typeParameter: BabelNodeTSTypeParameter; +} + +declare class BabelNodeTSParenthesizedType extends BabelNode { + type: "TSParenthesizedType"; + typeAnnotation: BabelNodeTSType; +} + +declare class BabelNodeTSTypeOperator extends BabelNode { + type: "TSTypeOperator"; + typeAnnotation: BabelNodeTSType; + operator?: string; +} + +declare class BabelNodeTSIndexedAccessType extends BabelNode { + type: "TSIndexedAccessType"; + objectType: BabelNodeTSType; + indexType: BabelNodeTSType; +} + +declare class BabelNodeTSMappedType extends BabelNode { + type: "TSMappedType"; + typeParameter: BabelNodeTSTypeParameter; + typeAnnotation?: BabelNodeTSType; + optional?: boolean; + readonly?: boolean; +} + +declare class BabelNodeTSLiteralType extends BabelNode { + type: "TSLiteralType"; + literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral; +} + +declare class BabelNodeTSExpressionWithTypeArguments extends BabelNode { + type: "TSExpressionWithTypeArguments"; + expression: BabelNodeTSEntityName; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeTSInterfaceDeclaration extends BabelNode { + type: "TSInterfaceDeclaration"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + body: BabelNodeTSInterfaceBody; + declare?: boolean; +} + +declare class BabelNodeTSInterfaceBody extends BabelNode { + type: "TSInterfaceBody"; + body: Array; +} + +declare class BabelNodeTSTypeAliasDeclaration extends BabelNode { + type: "TSTypeAliasDeclaration"; + id: BabelNodeIdentifier; + typeParameters?: BabelNodeTSTypeParameterDeclaration; + typeAnnotation: BabelNodeTSType; + declare?: boolean; +} + +declare class BabelNodeTSAsExpression extends BabelNode { + type: "TSAsExpression"; + expression: BabelNodeExpression; + typeAnnotation: BabelNodeTSType; +} + +declare class BabelNodeTSTypeAssertion extends BabelNode { + type: "TSTypeAssertion"; + typeAnnotation: BabelNodeTSType; + expression: BabelNodeExpression; +} + +declare class BabelNodeTSEnumDeclaration extends BabelNode { + type: "TSEnumDeclaration"; + id: BabelNodeIdentifier; + members: Array; + declare?: boolean; + initializer?: BabelNodeExpression; +} + +declare class BabelNodeTSEnumMember extends BabelNode { + type: "TSEnumMember"; + id: BabelNodeIdentifier | BabelNodeStringLiteral; + initializer?: BabelNodeExpression; +} + +declare class BabelNodeTSModuleDeclaration extends BabelNode { + type: "TSModuleDeclaration"; + id: BabelNodeIdentifier | BabelNodeStringLiteral; + body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration; + declare?: boolean; + global?: boolean; +} + +declare class BabelNodeTSModuleBlock extends BabelNode { + type: "TSModuleBlock"; + body: Array; +} + +declare class BabelNodeTSImportType extends BabelNode { + type: "TSImportType"; + argument: BabelNodeStringLiteral; + qualifier?: BabelNodeTSEntityName; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + +declare class BabelNodeTSImportEqualsDeclaration extends BabelNode { + type: "TSImportEqualsDeclaration"; + id: BabelNodeIdentifier; + moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference; + isExport?: boolean; +} + +declare class BabelNodeTSExternalModuleReference extends BabelNode { + type: "TSExternalModuleReference"; + expression: BabelNodeStringLiteral; +} + +declare class BabelNodeTSNonNullExpression extends BabelNode { + type: "TSNonNullExpression"; + expression: BabelNodeExpression; +} + +declare class BabelNodeTSExportAssignment extends BabelNode { + type: "TSExportAssignment"; + expression: BabelNodeExpression; +} + +declare class BabelNodeTSNamespaceExportDeclaration extends BabelNode { + type: "TSNamespaceExportDeclaration"; + id: BabelNodeIdentifier; +} + +declare class BabelNodeTSTypeAnnotation extends BabelNode { + type: "TSTypeAnnotation"; + typeAnnotation: BabelNodeTSType; +} + +declare class BabelNodeTSTypeParameterInstantiation extends BabelNode { + type: "TSTypeParameterInstantiation"; + params: Array; +} + +declare class BabelNodeTSTypeParameterDeclaration extends BabelNode { + type: "TSTypeParameterDeclaration"; + params: Array; +} + +declare class BabelNodeTSTypeParameter extends BabelNode { + type: "TSTypeParameter"; + constraint?: BabelNodeTSType; + name?: string; +} + +type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeParenthesizedExpression | 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 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; +type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement; +type BabelNodeLoop = BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeWhileStatement | BabelNodeForOfStatement; +type BabelNodeWhile = BabelNodeDoWhileStatement | BabelNodeWhileStatement; +type BabelNodeExpressionWrapper = BabelNodeExpressionStatement | BabelNodeTypeCastExpression | BabelNodeParenthesizedExpression; +type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeForOfStatement; +type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement; +type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; +type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; +type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeBigIntLiteral; +type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration; +type BabelNodePatternLike = BabelNodeIdentifier | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; +type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeTSParameterProperty; +type BabelNodeTSEntityName = BabelNodeIdentifier | BabelNodeTSQualifiedName; +type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral | BabelNodeBigIntLiteral; +type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXOpeningElement | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment | BabelNodeBigIntLiteral; +type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty; +type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod | BabelNodeClassPrivateMethod; +type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty; +type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty | BabelNodeClassPrivateProperty; +type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement; +type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; +type BabelNodeClass = BabelNodeClassDeclaration | BabelNodeClassExpression; +type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration; +type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration; +type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier; +type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeDeclaredPredicate | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInferredPredicate | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty | BabelNodeOpaqueType | BabelNodeQualifiedTypeIdentifier | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeUnionTypeAnnotation | BabelNodeVariance | BabelNodeVoidTypeAnnotation; +type BabelNodeFlowType = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation; +type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation; +type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias; +type BabelNodeFlowPredicate = BabelNodeDeclaredPredicate | BabelNodeInferredPredicate; +type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment; +type BabelNodePrivate = BabelNodeClassPrivateProperty | BabelNodeClassPrivateMethod | BabelNodePrivateName; +type BabelNodeTSTypeElement = BabelNodeTSCallSignatureDeclaration | BabelNodeTSConstructSignatureDeclaration | BabelNodeTSPropertySignature | BabelNodeTSMethodSignature | BabelNodeTSIndexSignature; +type BabelNodeTSType = BabelNodeTSAnyKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSVoidKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSNullKeyword | BabelNodeTSNeverKeyword | BabelNodeTSThisType | BabelNodeTSFunctionType | BabelNodeTSConstructorType | BabelNodeTSTypeReference | BabelNodeTSTypePredicate | BabelNodeTSTypeQuery | BabelNodeTSTypeLiteral | BabelNodeTSArrayType | BabelNodeTSTupleType | BabelNodeTSOptionalType | BabelNodeTSRestType | BabelNodeTSUnionType | BabelNodeTSIntersectionType | BabelNodeTSConditionalType | BabelNodeTSInferType | BabelNodeTSParenthesizedType | BabelNodeTSTypeOperator | BabelNodeTSIndexedAccessType | BabelNodeTSMappedType | BabelNodeTSLiteralType | BabelNodeTSExpressionWithTypeArguments | BabelNodeTSImportType; + +declare module "@babel/types" { + declare function arrayExpression(elements?: Array): BabelNodeArrayExpression; + declare function assignmentExpression(operator: string, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression; + declare function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeBinaryExpression; + declare function interpreterDirective(value: string): BabelNodeInterpreterDirective; + declare function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective; + declare function directiveLiteral(value: string): BabelNodeDirectiveLiteral; + declare function blockStatement(body: Array, directives?: Array): BabelNodeBlockStatement; + declare function breakStatement(label?: BabelNodeIdentifier): BabelNodeBreakStatement; + declare function callExpression(callee: BabelNodeExpression, _arguments: Array, optional?: true | false, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeCallExpression; + declare function catchClause(param?: BabelNodeIdentifier, body: BabelNodeBlockStatement): BabelNodeCatchClause; + declare function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression; + declare function continueStatement(label?: BabelNodeIdentifier): BabelNodeContinueStatement; + declare function debuggerStatement(): BabelNodeDebuggerStatement; + declare function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement; + declare function emptyStatement(): BabelNodeEmptyStatement; + declare function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement; + declare function file(program: BabelNodeProgram, comments: any, tokens: any): BabelNodeFile; + declare function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement; + declare function forStatement(init?: BabelNodeVariableDeclaration | BabelNodeExpression, test?: BabelNodeExpression, update?: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement; + declare function functionDeclaration(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, declare?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeFunctionDeclaration; + declare function functionExpression(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeFunctionExpression; + declare function identifier(name: string, decorators?: Array, optional?: boolean, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeIdentifier; + declare function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: BabelNodeStatement): BabelNodeIfStatement; + declare function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement; + declare function stringLiteral(value: string): BabelNodeStringLiteral; + declare function numericLiteral(value: number): BabelNodeNumericLiteral; + declare function nullLiteral(): BabelNodeNullLiteral; + declare function booleanLiteral(value: boolean): BabelNodeBooleanLiteral; + declare function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral; + declare function logicalExpression(operator: "||" | "&&" | "??", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression; + declare function memberExpression(object: BabelNodeExpression, property: any, computed?: boolean, optional?: true | false): BabelNodeMemberExpression; + declare function newExpression(callee: BabelNodeExpression, _arguments: Array, optional?: true | false, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeNewExpression; + declare function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: BabelNodeInterpreterDirective, sourceFile?: string): BabelNodeProgram; + declare function objectExpression(properties: Array): BabelNodeObjectExpression; + declare function objectMethod(kind?: "method" | "get" | "set", key: any, params: Array, body: BabelNodeBlockStatement, computed?: boolean, async?: boolean, decorators?: Array, generator?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeObjectMethod; + declare function objectProperty(key: any, value: BabelNodeExpression | BabelNodePatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array): BabelNodeObjectProperty; + declare function restElement(argument: BabelNodeLVal, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeRestElement; + declare function returnStatement(argument?: BabelNodeExpression): BabelNodeReturnStatement; + declare function sequenceExpression(expressions: Array): BabelNodeSequenceExpression; + declare function switchCase(test?: BabelNodeExpression, consequent: Array): BabelNodeSwitchCase; + declare function switchStatement(discriminant: BabelNodeExpression, cases: Array): BabelNodeSwitchStatement; + declare function thisExpression(): BabelNodeThisExpression; + declare function throwStatement(argument: BabelNodeExpression): BabelNodeThrowStatement; + declare function tryStatement(block: BabelNodeBlockStatement, handler?: BabelNodeCatchClause, finalizer?: BabelNodeBlockStatement): BabelNodeTryStatement; + declare function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression; + declare function updateExpression(operator: "++" | "--", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression; + declare function variableDeclaration(kind: "var" | "let" | "const", declarations: Array, declare?: boolean): BabelNodeVariableDeclaration; + 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 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; + declare function classDeclaration(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array, abstract?: boolean, declare?: boolean, _implements?: Array, mixins?: any, superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassDeclaration; + 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 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; + declare function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier; + declare function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier; + declare function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier, importKind?: "type" | "typeof"): BabelNodeImportSpecifier; + declare function metaProperty(meta: BabelNodeIdentifier, property: BabelNodeIdentifier): BabelNodeMetaProperty; + declare function classMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, params: Array, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, decorators?: Array, generator?: boolean, optional?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassMethod; + 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 templateLiteral(quasis: Array, expressions: Array): BabelNodeTemplateLiteral; + declare function yieldExpression(argument?: BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression; + declare function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation; + declare function arrayTypeAnnotation(elementType: BabelNodeFlowType): BabelNodeArrayTypeAnnotation; + declare function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation; + declare function booleanLiteralTypeAnnotation(value: boolean): BabelNodeBooleanLiteralTypeAnnotation; + declare function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation; + declare function classImplements(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeClassImplements; + declare function declareClass(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeDeclareClass; + declare function declareFunction(id: BabelNodeIdentifier, predicate?: BabelNodeDeclaredPredicate): BabelNodeDeclareFunction; + declare function declareInterface(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeDeclareInterface; + declare function declareModule(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeBlockStatement, kind?: "CommonJS" | "ES"): BabelNodeDeclareModule; + declare function declareModuleExports(typeAnnotation: BabelNodeTypeAnnotation): BabelNodeDeclareModuleExports; + declare function declareTypeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeDeclareTypeAlias; + 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 declaredPredicate(value: BabelNodeFlow): BabelNodeDeclaredPredicate; + declare function existsTypeAnnotation(): BabelNodeExistsTypeAnnotation; + declare function functionTypeAnnotation(typeParameters?: BabelNodeTypeParameterDeclaration, params: Array, rest?: BabelNodeFunctionTypeParam, returnType: BabelNodeFlowType): BabelNodeFunctionTypeAnnotation; + declare function functionTypeParam(name?: BabelNodeIdentifier, typeAnnotation: BabelNodeFlowType, optional?: boolean): BabelNodeFunctionTypeParam; + declare function genericTypeAnnotation(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeGenericTypeAnnotation; + declare function inferredPredicate(): BabelNodeInferredPredicate; + declare function interfaceExtends(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeInterfaceExtends; + declare function interfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeInterfaceDeclaration; + declare function interfaceTypeAnnotation(_extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceTypeAnnotation; + declare function intersectionTypeAnnotation(types: Array): BabelNodeIntersectionTypeAnnotation; + declare function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation; + declare function emptyTypeAnnotation(): BabelNodeEmptyTypeAnnotation; + declare function nullableTypeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeNullableTypeAnnotation; + declare function numberLiteralTypeAnnotation(value: number): BabelNodeNumberLiteralTypeAnnotation; + declare function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation; + declare function objectTypeAnnotation(properties: Array, indexers?: Array, callProperties?: Array, internalSlots?: Array, exact?: boolean, inexact?: boolean): BabelNodeObjectTypeAnnotation; + declare function objectTypeInternalSlot(id: BabelNodeIdentifier, value: BabelNodeFlowType, optional: boolean, _static: boolean, method: boolean): BabelNodeObjectTypeInternalSlot; + declare function objectTypeCallProperty(value: BabelNodeFlowType, _static?: boolean): BabelNodeObjectTypeCallProperty; + declare function objectTypeIndexer(id?: BabelNodeIdentifier, key: BabelNodeFlowType, value: BabelNodeFlowType, variance?: BabelNodeVariance, _static?: boolean): BabelNodeObjectTypeIndexer; + declare function objectTypeProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeFlowType, variance?: BabelNodeVariance, kind?: "init" | "get" | "set", optional?: boolean, proto?: boolean, _static?: boolean): BabelNodeObjectTypeProperty; + declare function objectTypeSpreadProperty(argument: BabelNodeFlowType): BabelNodeObjectTypeSpreadProperty; + declare function opaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType, impltype: BabelNodeFlowType): BabelNodeOpaqueType; + declare function qualifiedTypeIdentifier(id: BabelNodeIdentifier, qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier): BabelNodeQualifiedTypeIdentifier; + declare function stringLiteralTypeAnnotation(value: string): BabelNodeStringLiteralTypeAnnotation; + declare function stringTypeAnnotation(): BabelNodeStringTypeAnnotation; + declare function thisTypeAnnotation(): BabelNodeThisTypeAnnotation; + declare function tupleTypeAnnotation(types: Array): BabelNodeTupleTypeAnnotation; + declare function typeofTypeAnnotation(argument: BabelNodeFlowType): BabelNodeTypeofTypeAnnotation; + declare function typeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeTypeAlias; + declare function typeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeTypeAnnotation; + declare function typeCastExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTypeAnnotation): BabelNodeTypeCastExpression; + declare function typeParameter(bound?: BabelNodeTypeAnnotation, _default?: BabelNodeFlowType, variance?: BabelNodeVariance, name?: string): BabelNodeTypeParameter; + declare function typeParameterDeclaration(params: Array): BabelNodeTypeParameterDeclaration; + declare function typeParameterInstantiation(params: Array): BabelNodeTypeParameterInstantiation; + declare function unionTypeAnnotation(types: Array): BabelNodeUnionTypeAnnotation; + declare function variance(kind: "minus" | "plus"): BabelNodeVariance; + declare function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation; + declare function jsxAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute; + declare function jsxClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression): BabelNodeJSXClosingElement; + declare function jsxElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: BabelNodeJSXClosingElement, children: Array, selfClosing: any): BabelNodeJSXElement; + declare function jsxEmptyExpression(): BabelNodeJSXEmptyExpression; + declare function jsxExpressionContainer(expression: BabelNodeExpression | BabelNodeJSXEmptyExpression): BabelNodeJSXExpressionContainer; + declare function jsxSpreadChild(expression: BabelNodeExpression): BabelNodeJSXSpreadChild; + declare function jsxIdentifier(name: string): BabelNodeJSXIdentifier; + declare function jsxMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression; + declare function jsxNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName; + declare function jsxOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression, attributes: Array, selfClosing?: boolean, typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation): BabelNodeJSXOpeningElement; + declare function jsxSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute; + declare function jsxText(value: string): BabelNodeJSXText; + declare function jsxFragment(openingFragment: BabelNodeJSXOpeningFragment, closingFragment: BabelNodeJSXClosingFragment, children: Array): BabelNodeJSXFragment; + declare function jsxOpeningFragment(): BabelNodeJSXOpeningFragment; + declare function jsxClosingFragment(): BabelNodeJSXClosingFragment; + declare function noop(): BabelNodeNoop; + declare function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression; + declare function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression; + declare function bindExpression(object: any, callee: any): BabelNodeBindExpression; + declare function classProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, value?: BabelNodeExpression, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, decorators?: Array, computed?: boolean, abstract?: boolean, accessibility?: "public" | "private" | "protected", definite?: boolean, optional?: boolean, readonly?: boolean, _static?: boolean): BabelNodeClassProperty; + declare function optionalMemberExpression(object: BabelNodeExpression, property: any, computed?: boolean, optional: boolean): BabelNodeOptionalMemberExpression; + declare function pipelineTopicExpression(expression: BabelNodeExpression): BabelNodePipelineTopicExpression; + declare function pipelineBareFunction(callee: BabelNodeExpression): BabelNodePipelineBareFunction; + declare function pipelinePrimaryTopicReference(): BabelNodePipelinePrimaryTopicReference; + declare function optionalCallExpression(callee: BabelNodeExpression, _arguments: Array, optional: boolean, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeOptionalCallExpression; + declare function classPrivateProperty(key: BabelNodePrivateName, value?: BabelNodeExpression): BabelNodeClassPrivateProperty; + declare function classPrivateMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodePrivateName, params: Array, body: BabelNodeBlockStatement, _static?: boolean, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, computed?: boolean, decorators?: Array, generator?: boolean, optional?: boolean, returnType?: any, typeParameters?: any): BabelNodeClassPrivateMethod; + declare function decorator(expression: BabelNodeExpression): BabelNodeDecorator; + declare function doExpression(body: BabelNodeBlockStatement): BabelNodeDoExpression; + declare function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier; + declare function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier; + declare function privateName(id: BabelNodeIdentifier): BabelNodePrivateName; + declare function bigIntLiteral(value: string): BabelNodeBigIntLiteral; + declare function tsParameterProperty(parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern, accessibility?: "public" | "private" | "protected", readonly?: boolean): BabelNodeTSParameterProperty; + declare function tsDeclareFunction(id?: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop, async?: boolean, declare?: boolean, generator?: boolean): BabelNodeTSDeclareFunction; + declare function tsDeclareMethod(decorators?: Array, key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, computed?: boolean, generator?: boolean, kind?: "get" | "set" | "method" | "constructor", optional?: boolean, _static?: boolean): BabelNodeTSDeclareMethod; + declare function tsQualifiedName(left: BabelNodeTSEntityName, right: BabelNodeIdentifier): BabelNodeTSQualifiedName; + declare function tsCallSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters?: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSCallSignatureDeclaration; + declare function tsConstructSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters?: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructSignatureDeclaration; + declare function tsPropertySignature(key: BabelNodeExpression, typeAnnotation?: BabelNodeTSTypeAnnotation, initializer?: BabelNodeExpression, computed?: boolean, optional?: boolean, readonly?: boolean): BabelNodeTSPropertySignature; + declare function tsMethodSignature(key: BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters?: Array, typeAnnotation?: BabelNodeTSTypeAnnotation, computed?: boolean, optional?: boolean): BabelNodeTSMethodSignature; + declare function tsIndexSignature(parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation, readonly?: boolean): BabelNodeTSIndexSignature; + declare function tsAnyKeyword(): BabelNodeTSAnyKeyword; + declare function tsUnknownKeyword(): BabelNodeTSUnknownKeyword; + declare function tsNumberKeyword(): BabelNodeTSNumberKeyword; + declare function tsObjectKeyword(): BabelNodeTSObjectKeyword; + declare function tsBooleanKeyword(): BabelNodeTSBooleanKeyword; + declare function tsStringKeyword(): BabelNodeTSStringKeyword; + declare function tsSymbolKeyword(): BabelNodeTSSymbolKeyword; + declare function tsVoidKeyword(): BabelNodeTSVoidKeyword; + declare function tsUndefinedKeyword(): BabelNodeTSUndefinedKeyword; + declare function tsNullKeyword(): BabelNodeTSNullKeyword; + declare function tsNeverKeyword(): BabelNodeTSNeverKeyword; + declare function tsThisType(): BabelNodeTSThisType; + declare function tsFunctionType(typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation?: BabelNodeTSTypeAnnotation, parameters?: Array): BabelNodeTSFunctionType; + declare function tsConstructorType(typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation?: BabelNodeTSTypeAnnotation, parameters?: Array): BabelNodeTSConstructorType; + declare function tsTypeReference(typeName: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSTypeReference; + declare function tsTypePredicate(parameterName: BabelNodeIdentifier | BabelNodeTSThisType, typeAnnotation: BabelNodeTSTypeAnnotation): BabelNodeTSTypePredicate; + declare function tsTypeQuery(exprName: BabelNodeTSEntityName | BabelNodeTSImportType): BabelNodeTSTypeQuery; + declare function tsTypeLiteral(members: Array): BabelNodeTSTypeLiteral; + declare function tsArrayType(elementType: BabelNodeTSType): BabelNodeTSArrayType; + declare function tsTupleType(elementTypes: Array): BabelNodeTSTupleType; + declare function tsOptionalType(typeAnnotation: BabelNodeTSType): BabelNodeTSOptionalType; + declare function tsRestType(typeAnnotation: BabelNodeTSType): BabelNodeTSRestType; + declare function tsUnionType(types: Array): BabelNodeTSUnionType; + declare function tsIntersectionType(types: Array): BabelNodeTSIntersectionType; + declare function tsConditionalType(checkType: BabelNodeTSType, extendsType: BabelNodeTSType, trueType: BabelNodeTSType, falseType: BabelNodeTSType): BabelNodeTSConditionalType; + declare function tsInferType(typeParameter: BabelNodeTSTypeParameter): BabelNodeTSInferType; + declare function tsParenthesizedType(typeAnnotation: BabelNodeTSType): BabelNodeTSParenthesizedType; + declare function tsTypeOperator(typeAnnotation: BabelNodeTSType, operator?: string): BabelNodeTSTypeOperator; + declare function tsIndexedAccessType(objectType: BabelNodeTSType, indexType: BabelNodeTSType): BabelNodeTSIndexedAccessType; + declare function tsMappedType(typeParameter: BabelNodeTSTypeParameter, typeAnnotation?: BabelNodeTSType, optional?: boolean, readonly?: boolean): BabelNodeTSMappedType; + declare function tsLiteralType(literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral): BabelNodeTSLiteralType; + declare function tsExpressionWithTypeArguments(expression: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSExpressionWithTypeArguments; + declare function tsInterfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, _extends?: Array, body: BabelNodeTSInterfaceBody, declare?: boolean): BabelNodeTSInterfaceDeclaration; + declare function tsInterfaceBody(body: Array): BabelNodeTSInterfaceBody; + declare function tsTypeAliasDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation: BabelNodeTSType, declare?: boolean): BabelNodeTSTypeAliasDeclaration; + declare function tsAsExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTSType): BabelNodeTSAsExpression; + declare function tsTypeAssertion(typeAnnotation: BabelNodeTSType, expression: BabelNodeExpression): BabelNodeTSTypeAssertion; + declare function tsEnumDeclaration(id: BabelNodeIdentifier, members: Array, _const?: boolean, declare?: boolean, initializer?: BabelNodeExpression): BabelNodeTSEnumDeclaration; + declare function tsEnumMember(id: BabelNodeIdentifier | BabelNodeStringLiteral, initializer?: BabelNodeExpression): BabelNodeTSEnumMember; + declare function tsModuleDeclaration(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration, declare?: boolean, global?: boolean): BabelNodeTSModuleDeclaration; + declare function tsModuleBlock(body: Array): BabelNodeTSModuleBlock; + declare function tsImportType(argument: BabelNodeStringLiteral, qualifier?: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSImportType; + declare function tsImportEqualsDeclaration(id: BabelNodeIdentifier, moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference, isExport?: boolean): BabelNodeTSImportEqualsDeclaration; + declare function tsExternalModuleReference(expression: BabelNodeStringLiteral): BabelNodeTSExternalModuleReference; + declare function tsNonNullExpression(expression: BabelNodeExpression): BabelNodeTSNonNullExpression; + declare function tsExportAssignment(expression: BabelNodeExpression): BabelNodeTSExportAssignment; + declare function tsNamespaceExportDeclaration(id: BabelNodeIdentifier): BabelNodeTSNamespaceExportDeclaration; + declare function tsTypeAnnotation(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAnnotation; + declare function tsTypeParameterInstantiation(params: Array): BabelNodeTSTypeParameterInstantiation; + declare function tsTypeParameterDeclaration(params: Array): BabelNodeTSTypeParameterDeclaration; + declare function tsTypeParameter(constraint?: BabelNodeTSType, _default?: BabelNodeTSType, name?: string): BabelNodeTSTypeParameter; + declare function isArrayExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayExpression) + declare function isAssignmentExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentExpression) + declare function isBinaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBinaryExpression) + declare function isInterpreterDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterpreterDirective) + declare function isDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirective) + declare function isDirectiveLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirectiveLiteral) + declare function isBlockStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBlockStatement) + declare function isBreakStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBreakStatement) + declare function isCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCallExpression) + declare function isCatchClause(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCatchClause) + declare function isConditionalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeConditionalExpression) + declare function isContinueStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeContinueStatement) + declare function isDebuggerStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDebuggerStatement) + declare function isDoWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoWhileStatement) + declare function isEmptyStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyStatement) + declare function isExpressionStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExpressionStatement) + declare function isFile(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFile) + declare function isForInStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForInStatement) + declare function isForStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForStatement) + declare function isFunctionDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionDeclaration) + declare function isFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionExpression) + declare function isIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIdentifier) + declare function isIfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIfStatement) + declare function isLabeledStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLabeledStatement) + declare function isStringLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteral) + declare function isNumericLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral) + declare function isNullLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteral) + declare function isBooleanLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteral) + declare function isRegExpLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral) + declare function isLogicalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLogicalExpression) + declare function isMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMemberExpression) + declare function isNewExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNewExpression) + declare function isProgram(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeProgram) + declare function isObjectExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectExpression) + declare function isObjectMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectMethod) + declare function isObjectProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectProperty) + declare function isRestElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement) + declare function isReturnStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeReturnStatement) + declare function isSequenceExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSequenceExpression) + declare function isSwitchCase(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchCase) + declare function isSwitchStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchStatement) + declare function isThisExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisExpression) + declare function isThrowStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThrowStatement) + declare function isTryStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTryStatement) + declare function isUnaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnaryExpression) + declare function isUpdateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUpdateExpression) + declare function isVariableDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclaration) + declare function isVariableDeclarator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclarator) + declare function isWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWhileStatement) + declare function isWithStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWithStatement) + declare function isAssignmentPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentPattern) + declare function isArrayPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayPattern) + declare function isArrowFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrowFunctionExpression) + declare function isClassBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassBody) + declare function isClassDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassDeclaration) + declare function isClassExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassExpression) + declare function isExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportAllDeclaration) + declare function isExportDefaultDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultDeclaration) + declare function isExportNamedDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamedDeclaration) + declare function isExportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportSpecifier) + declare function isForOfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForOfStatement) + declare function isImportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDeclaration) + declare function isImportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDefaultSpecifier) + declare function isImportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportNamespaceSpecifier) + declare function isImportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportSpecifier) + declare function isMetaProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMetaProperty) + declare function isClassMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassMethod) + declare function isObjectPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectPattern) + declare function isSpreadElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement) + declare function isSuper(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSuper) + declare function isTaggedTemplateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTaggedTemplateExpression) + declare function isTemplateElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateElement) + declare function isTemplateLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateLiteral) + declare function isYieldExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeYieldExpression) + declare function isAnyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAnyTypeAnnotation) + declare function isArrayTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayTypeAnnotation) + declare function isBooleanTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanTypeAnnotation) + declare function isBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteralTypeAnnotation) + declare function isNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteralTypeAnnotation) + declare function isClassImplements(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassImplements) + declare function isDeclareClass(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareClass) + declare function isDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareFunction) + declare function isDeclareInterface(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareInterface) + declare function isDeclareModule(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModule) + declare function isDeclareModuleExports(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModuleExports) + declare function isDeclareTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareTypeAlias) + declare function isDeclareOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareOpaqueType) + declare function isDeclareVariable(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareVariable) + declare function isDeclareExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportDeclaration) + declare function isDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportAllDeclaration) + declare function isDeclaredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclaredPredicate) + declare function isExistsTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExistsTypeAnnotation) + declare function isFunctionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeAnnotation) + declare function isFunctionTypeParam(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeParam) + declare function isGenericTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeGenericTypeAnnotation) + declare function isInferredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInferredPredicate) + declare function isInterfaceExtends(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceExtends) + declare function isInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceDeclaration) + declare function isInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceTypeAnnotation) + declare function isIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIntersectionTypeAnnotation) + declare function isMixedTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMixedTypeAnnotation) + declare function isEmptyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyTypeAnnotation) + declare function isNullableTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullableTypeAnnotation) + declare function isNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberLiteralTypeAnnotation) + declare function isNumberTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberTypeAnnotation) + declare function isObjectTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeAnnotation) + declare function isObjectTypeInternalSlot(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeInternalSlot) + declare function isObjectTypeCallProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeCallProperty) + declare function isObjectTypeIndexer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeIndexer) + declare function isObjectTypeProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeProperty) + declare function isObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeSpreadProperty) + declare function isOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOpaqueType) + declare function isQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeQualifiedTypeIdentifier) + declare function isStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteralTypeAnnotation) + declare function isStringTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringTypeAnnotation) + declare function isThisTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisTypeAnnotation) + declare function isTupleTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleTypeAnnotation) + declare function isTypeofTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeofTypeAnnotation) + declare function isTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAlias) + declare function isTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAnnotation) + declare function isTypeCastExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeCastExpression) + declare function isTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameter) + declare function isTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterDeclaration) + declare function isTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterInstantiation) + declare function isUnionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnionTypeAnnotation) + declare function isVariance(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariance) + declare function isVoidTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVoidTypeAnnotation) + declare function isJSXAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXAttribute) + declare function isJSXClosingElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingElement) + declare function isJSXElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXElement) + declare function isJSXEmptyExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXEmptyExpression) + declare function isJSXExpressionContainer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXExpressionContainer) + declare function isJSXSpreadChild(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadChild) + declare function isJSXIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXIdentifier) + declare function isJSXMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXMemberExpression) + declare function isJSXNamespacedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXNamespacedName) + declare function isJSXOpeningElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningElement) + declare function isJSXSpreadAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadAttribute) + declare function isJSXText(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXText) + declare function isJSXFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXFragment) + declare function isJSXOpeningFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningFragment) + declare function isJSXClosingFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingFragment) + declare function isNoop(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNoop) + declare function isParenthesizedExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeParenthesizedExpression) + declare function isAwaitExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAwaitExpression) + declare function isBindExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBindExpression) + declare function isClassProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassProperty) + declare function isOptionalMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalMemberExpression) + declare function isPipelineTopicExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineTopicExpression) + declare function isPipelineBareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineBareFunction) + declare function isPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelinePrimaryTopicReference) + declare function isOptionalCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalCallExpression) + declare function isClassPrivateProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateProperty) + declare function isClassPrivateMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateMethod) + declare function isImport(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImport) + declare function isDecorator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecorator) + declare function isDoExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoExpression) + declare function isExportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultSpecifier) + declare function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamespaceSpecifier) + declare function isPrivateName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePrivateName) + declare function isBigIntLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBigIntLiteral) + declare function isTSParameterProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParameterProperty) + declare function isTSDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareFunction) + declare function isTSDeclareMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareMethod) + declare function isTSQualifiedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSQualifiedName) + declare function isTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSCallSignatureDeclaration) + declare function isTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructSignatureDeclaration) + declare function isTSPropertySignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSPropertySignature) + declare function isTSMethodSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMethodSignature) + declare function isTSIndexSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexSignature) + declare function isTSAnyKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAnyKeyword) + declare function isTSUnknownKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnknownKeyword) + declare function isTSNumberKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNumberKeyword) + declare function isTSObjectKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSObjectKeyword) + declare function isTSBooleanKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBooleanKeyword) + declare function isTSStringKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSStringKeyword) + declare function isTSSymbolKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSSymbolKeyword) + declare function isTSVoidKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSVoidKeyword) + declare function isTSUndefinedKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUndefinedKeyword) + declare function isTSNullKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNullKeyword) + declare function isTSNeverKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNeverKeyword) + declare function isTSThisType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSThisType) + declare function isTSFunctionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSFunctionType) + declare function isTSConstructorType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructorType) + declare function isTSTypeReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeReference) + declare function isTSTypePredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypePredicate) + declare function isTSTypeQuery(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeQuery) + declare function isTSTypeLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeLiteral) + declare function isTSArrayType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSArrayType) + declare function isTSTupleType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTupleType) + declare function isTSOptionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSOptionalType) + declare function isTSRestType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSRestType) + declare function isTSUnionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnionType) + declare function isTSIntersectionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntersectionType) + declare function isTSConditionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConditionalType) + declare function isTSInferType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInferType) + declare function isTSParenthesizedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParenthesizedType) + declare function isTSTypeOperator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeOperator) + declare function isTSIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexedAccessType) + declare function isTSMappedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMappedType) + declare function isTSLiteralType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSLiteralType) + declare function isTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExpressionWithTypeArguments) + declare function isTSInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceDeclaration) + declare function isTSInterfaceBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceBody) + declare function isTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAliasDeclaration) + declare function isTSAsExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAsExpression) + declare function isTSTypeAssertion(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAssertion) + declare function isTSEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumDeclaration) + declare function isTSEnumMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumMember) + declare function isTSModuleDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleDeclaration) + declare function isTSModuleBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleBlock) + declare function isTSImportType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportType) + declare function isTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportEqualsDeclaration) + declare function isTSExternalModuleReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExternalModuleReference) + declare function isTSNonNullExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNonNullExpression) + declare function isTSExportAssignment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExportAssignment) + declare function isTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamespaceExportDeclaration) + declare function isTSTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAnnotation) + declare function isTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterInstantiation) + declare function isTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterDeclaration) + declare function isTSTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameter) + declare function isExpression(node: ?Object, opts?: ?Object): boolean + declare function isBinary(node: ?Object, opts?: ?Object): boolean + declare function isScopable(node: ?Object, opts?: ?Object): boolean + declare function isBlockParent(node: ?Object, opts?: ?Object): boolean + declare function isBlock(node: ?Object, opts?: ?Object): boolean + declare function isStatement(node: ?Object, opts?: ?Object): boolean + declare function isTerminatorless(node: ?Object, opts?: ?Object): boolean + declare function isCompletionStatement(node: ?Object, opts?: ?Object): boolean + declare function isConditional(node: ?Object, opts?: ?Object): boolean + declare function isLoop(node: ?Object, opts?: ?Object): boolean + declare function isWhile(node: ?Object, opts?: ?Object): boolean + declare function isExpressionWrapper(node: ?Object, opts?: ?Object): boolean + declare function isFor(node: ?Object, opts?: ?Object): boolean + declare function isForXStatement(node: ?Object, opts?: ?Object): boolean + declare function isFunction(node: ?Object, opts?: ?Object): boolean + declare function isFunctionParent(node: ?Object, opts?: ?Object): boolean + declare function isPureish(node: ?Object, opts?: ?Object): boolean + declare function isDeclaration(node: ?Object, opts?: ?Object): boolean + declare function isPatternLike(node: ?Object, opts?: ?Object): boolean + declare function isLVal(node: ?Object, opts?: ?Object): boolean + declare function isTSEntityName(node: ?Object, opts?: ?Object): boolean + declare function isLiteral(node: ?Object, opts?: ?Object): boolean + declare function isImmutable(node: ?Object, opts?: ?Object): boolean + declare function isUserWhitespacable(node: ?Object, opts?: ?Object): boolean + declare function isMethod(node: ?Object, opts?: ?Object): boolean + declare function isObjectMember(node: ?Object, opts?: ?Object): boolean + declare function isProperty(node: ?Object, opts?: ?Object): boolean + declare function isUnaryLike(node: ?Object, opts?: ?Object): boolean + declare function isPattern(node: ?Object, opts?: ?Object): boolean + declare function isClass(node: ?Object, opts?: ?Object): boolean + declare function isModuleDeclaration(node: ?Object, opts?: ?Object): boolean + declare function isExportDeclaration(node: ?Object, opts?: ?Object): boolean + declare function isModuleSpecifier(node: ?Object, opts?: ?Object): boolean + declare function isFlow(node: ?Object, opts?: ?Object): boolean + declare function isFlowType(node: ?Object, opts?: ?Object): boolean + declare function isFlowBaseAnnotation(node: ?Object, opts?: ?Object): boolean + declare function isFlowDeclaration(node: ?Object, opts?: ?Object): boolean + declare function isFlowPredicate(node: ?Object, opts?: ?Object): boolean + declare function isJSX(node: ?Object, opts?: ?Object): boolean + declare function isPrivate(node: ?Object, opts?: ?Object): boolean + declare function isTSTypeElement(node: ?Object, opts?: ?Object): boolean + declare function isTSType(node: ?Object, opts?: ?Object): boolean + declare function isNumberLiteral(node: ?Object, opts?: ?Object): boolean + declare function isRegexLiteral(node: ?Object, opts?: ?Object): boolean + declare function isRestProperty(node: ?Object, opts?: ?Object): boolean + declare function isSpreadProperty(node: ?Object, opts?: ?Object): boolean + declare function validate(n: BabelNode, key: string, value: mixed): void; + declare function clone(n: T): T; + declare function cloneDeep(n: T): T; + declare function removeProperties(n: T, opts: ?{}): void; + declare function removePropertiesDeep(n: T, opts: ?{}): T; + declare type TraversalAncestors = Array<{ + node: BabelNode, + key: string, + index?: number, + }>; + declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; + declare type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, + }; + declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void; +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js index f9d971c6237d1c..6a0ac93c5cf9b1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js @@ -1,15 +1,13 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = appendToMemberExpression; var _generated = require("../builders/generated"); -function appendToMemberExpression(member, append, computed) { - if (computed === void 0) { - computed = false; - } - +function appendToMemberExpression(member, append, computed = false) { member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed); member.property = append; member.computed = !!computed; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js index c0f402088c52ce..089179e2579ab5 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js @@ -1,18 +1,20 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = removeTypeDuplicates; var _generated = require("../../validators/generated"); function removeTypeDuplicates(nodes) { - var generics = {}; - var bases = {}; - var typeGroups = []; - var types = []; + const generics = {}; + const bases = {}; + const typeGroups = []; + const types = []; - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; if (!node) continue; if (types.indexOf(node) >= 0) { @@ -38,10 +40,10 @@ function removeTypeDuplicates(nodes) { } if ((0, _generated.isGenericTypeAnnotation)(node)) { - var name = node.id.name; + const name = node.id.name; if (generics[name]) { - var existing = generics[name]; + let existing = generics[name]; if (existing.typeParameters) { if (node.typeParameters) { @@ -60,12 +62,12 @@ function removeTypeDuplicates(nodes) { types.push(node); } - for (var type in bases) { + for (const type in bases) { types.push(bases[type]); } - for (var _name in generics) { - types.push(generics[_name]); + for (const name in generics) { + types.push(generics[name]); } return types; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js index 195f714cf3afd3..452811d37682f8 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inherits; var _constants = require("../constants"); @@ -11,25 +13,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function inherits(child, parent) { if (!child || !parent) return child; - var _arr = _constants.INHERIT_KEYS.optional; - - for (var _i = 0; _i < _arr.length; _i++) { - var key = _arr[_i]; + for (const key of _constants.INHERIT_KEYS.optional) { if (child[key] == null) { child[key] = parent[key]; } } - for (var _key in parent) { - if (_key[0] === "_" && _key !== "__clone") child[_key] = parent[_key]; + for (const key in parent) { + if (key[0] === "_" && key !== "__clone") child[key] = parent[key]; } - var _arr2 = _constants.INHERIT_KEYS.force; - - for (var _i2 = 0; _i2 < _arr2.length; _i2++) { - var _key2 = _arr2[_i2]; - child[_key2] = parent[_key2]; + for (const key of _constants.INHERIT_KEYS.force) { + child[key] = parent[key]; } (0, _inheritsComments.default)(child, parent); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js index 9b0f8aef69a1c7..ee6de0ec332885 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = prependToMemberExpression; var _generated = require("../builders/generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js index 0f3a5c31b8be4c..913598168801c8 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js @@ -1,56 +1,30 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = removeProperties; var _constants = require("../constants"); -var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; +const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; -var CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); +const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); -function removeProperties(node, opts) { - if (opts === void 0) { - opts = {}; - } - - var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; - - for (var _iterator = map, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; +function removeProperties(node, opts = {}) { + const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var _key2 = _ref; - if (node[_key2] != null) node[_key2] = undefined; + for (const key of map) { + if (node[key] != null) node[key] = undefined; } - for (var _key in node) { - if (_key[0] === "_" && node[_key] != null) node[_key] = undefined; + for (const key in node) { + if (key[0] === "_" && node[key] != null) node[key] = undefined; } - var symbols = Object.getOwnPropertySymbols(node); - - for (var _iterator2 = symbols, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } + const symbols = Object.getOwnPropertySymbols(node); - var _sym = _ref2; - node[_sym] = null; + for (const sym of symbols) { + node[sym] = null; } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js index 78453469680298..d11a84a8327c62 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = removePropertiesDeep; var _traverseFast = _interopRequireDefault(require("../traverse/traverseFast")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js index 689b15e6a4cc38..189f4b8eb3be51 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js @@ -1,22 +1,24 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = getBindingIdentifiers; var _generated = require("../validators/generated"); function getBindingIdentifiers(node, duplicates, outerOnly) { - var search = [].concat(node); - var ids = Object.create(null); + let search = [].concat(node); + const ids = Object.create(null); while (search.length) { - var id = search.shift(); + const id = search.shift(); if (!id) continue; - var keys = getBindingIdentifiers.keys[id.type]; + const keys = getBindingIdentifiers.keys[id.type]; if ((0, _generated.isIdentifier)(id)) { if (duplicates) { - var _ids = ids[id.name] = ids[id.name] || []; + const _ids = ids[id.name] = ids[id.name] || []; _ids.push(id); } else { @@ -46,8 +48,8 @@ function getBindingIdentifiers(node, duplicates, outerOnly) { } if (keys) { - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; if (id[key]) { search = search.concat(id[key]); @@ -64,6 +66,9 @@ getBindingIdentifiers.keys = { DeclareFunction: ["id"], DeclareModule: ["id"], DeclareVariable: ["id"], + DeclareInterface: ["id"], + DeclareTypeAlias: ["id"], + DeclareOpaqueType: ["id"], InterfaceDeclaration: ["id"], TypeAlias: ["id"], OpaqueType: ["id"], @@ -80,6 +85,9 @@ getBindingIdentifiers.keys = { ExportDefaultSpecifier: ["exported"], FunctionDeclaration: ["id", "params"], FunctionExpression: ["id", "params"], + ArrowFunctionExpression: ["params"], + ObjectMethod: ["params"], + ClassMethod: ["params"], ForInStatement: ["left"], ForOfStatement: ["left"], ClassDeclaration: ["id"], diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js index 367f2d87a523eb..8e1e3cb200d864 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = getOuterBindingIdentifiers; var _getBindingIdentifiers = _interopRequireDefault(require("./getBindingIdentifiers")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js index b51ed99de03a7e..775aed1eede16c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = traverse; var _definitions = require("../definitions"); @@ -12,39 +14,28 @@ function traverse(node, handlers, state) { }; } - var _ref = handlers, - enter = _ref.enter, - exit = _ref.exit; + const { + enter, + exit + } = handlers; traverseSimpleImpl(node, enter, exit, state, []); } function traverseSimpleImpl(node, enter, exit, state, ancestors) { - var keys = _definitions.VISITOR_KEYS[node.type]; + const keys = _definitions.VISITOR_KEYS[node.type]; if (!keys) return; if (enter) enter(node, ancestors, state); - for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var _key2 = _ref2; - var subNode = node[_key2]; + for (const key of keys) { + const subNode = node[key]; if (Array.isArray(subNode)) { - for (var i = 0; i < subNode.length; i++) { - var child = subNode[i]; + for (let i = 0; i < subNode.length; i++) { + const child = subNode[i]; if (!child) continue; ancestors.push({ - node: node, - key: _key2, + node, + key, index: i }); traverseSimpleImpl(child, enter, exit, state, ancestors); @@ -52,8 +43,8 @@ function traverseSimpleImpl(node, enter, exit, state, ancestors) { } } else if (subNode) { ancestors.push({ - node: node, - key: _key2 + node, + key }); traverseSimpleImpl(subNode, enter, exit, state, ancestors); ancestors.pop(); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js index 1ccd727f367aa7..f038dd835ed939 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js @@ -1,47 +1,25 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = traverseFast; var _definitions = require("../definitions"); function traverseFast(node, enter, opts) { if (!node) return; - var keys = _definitions.VISITOR_KEYS[node.type]; + const keys = _definitions.VISITOR_KEYS[node.type]; if (!keys) return; opts = opts || {}; enter(node, opts); - for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var _key = _ref; - var subNode = node[_key]; + for (const key of keys) { + const subNode = node[key]; if (Array.isArray(subNode)) { - for (var _iterator2 = subNode, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var _node2 = _ref2; - traverseFast(_node2, enter, opts); + for (const node of subNode) { + traverseFast(node, enter, opts); } } else { traverseFast(subNode, enter, opts); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js index 6c57f50d239af4..46b32efe8a5ce5 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js @@ -1,14 +1,24 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = inherit; -var _uniq = _interopRequireDefault(require("lodash/uniq")); +function _uniq() { + const data = _interopRequireDefault(require("lodash/uniq")); + + _uniq = function () { + return data; + }; + + return data; +} function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function inherit(key, child, parent) { if (child && parent) { - child[key] = (0, _uniq.default)([].concat(child[key], parent[key]).filter(Boolean)); + child[key] = (0, _uniq().default)([].concat(child[key], parent[key]).filter(Boolean)); } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js index 84de7435c9aa11..f0ca13369be108 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js @@ -1,28 +1,30 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = cleanJSXElementLiteralChild; var _generated = require("../../builders/generated"); function cleanJSXElementLiteralChild(child, args) { - var lines = child.value.split(/\r\n|\n|\r/); - var lastNonEmptyLine = 0; + const lines = child.value.split(/\r\n|\n|\r/); + let lastNonEmptyLine = 0; - for (var i = 0; i < lines.length; i++) { + for (let i = 0; i < lines.length; i++) { if (lines[i].match(/[^ \t]/)) { lastNonEmptyLine = i; } } - var str = ""; + let str = ""; - for (var _i = 0; _i < lines.length; _i++) { - var line = lines[_i]; - var isFirstLine = _i === 0; - var isLastLine = _i === lines.length - 1; - var isLastNonEmptyLine = _i === lastNonEmptyLine; - var trimmedLine = line.replace(/\t/g, " "); + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + const isFirstLine = i === 0; + const isLastLine = i === lines.length - 1; + const isLastNonEmptyLine = i === lastNonEmptyLine; + let trimmedLine = line.replace(/\t/g, " "); if (!isFirstLine) { trimmedLine = trimmedLine.replace(/^[ ]+/, ""); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js index 8969d543a854d7..fae259e4fc5311 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js @@ -1,15 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = shallowEqual; function shallowEqual(actual, expected) { - var keys = Object.keys(expected); - var _arr = keys; - - for (var _i = 0; _i < _arr.length; _i++) { - var key = _arr[_i]; + const keys = Object.keys(expected); + for (const key of keys) { if (actual[key] !== expected[key]) { return false; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js index 5c5d242d196852..0faa29c5d610d4 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = buildMatchMemberExpression; var _matchesPattern = _interopRequireDefault(require("./matchesPattern")); @@ -8,8 +10,6 @@ var _matchesPattern = _interopRequireDefault(require("./matchesPattern")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function buildMatchMemberExpression(match, allowPartial) { - var parts = match.split("."); - return function (member) { - return (0, _matchesPattern.default)(member, parts, allowPartial); - }; + const parts = match.split("."); + return member => (0, _matchesPattern.default)(member, parts, allowPartial); } \ No newline at end of file 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 684966d41dfe06..93edeab2de0293 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 @@ -1,9 +1,12 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.isArrayExpression = isArrayExpression; exports.isAssignmentExpression = isAssignmentExpression; exports.isBinaryExpression = isBinaryExpression; +exports.isInterpreterDirective = isInterpreterDirective; exports.isDirective = isDirective; exports.isDirectiveLiteral = isDirectiveLiteral; exports.isBlockStatement = isBlockStatement; @@ -98,6 +101,7 @@ exports.isGenericTypeAnnotation = isGenericTypeAnnotation; exports.isInferredPredicate = isInferredPredicate; exports.isInterfaceExtends = isInterfaceExtends; exports.isInterfaceDeclaration = isInterfaceDeclaration; +exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation; exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation; exports.isMixedTypeAnnotation = isMixedTypeAnnotation; exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation; @@ -105,6 +109,7 @@ exports.isNullableTypeAnnotation = isNullableTypeAnnotation; exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation; exports.isNumberTypeAnnotation = isNumberTypeAnnotation; exports.isObjectTypeAnnotation = isObjectTypeAnnotation; +exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot; exports.isObjectTypeCallProperty = isObjectTypeCallProperty; exports.isObjectTypeIndexer = isObjectTypeIndexer; exports.isObjectTypeProperty = isObjectTypeProperty; @@ -123,6 +128,7 @@ exports.isTypeParameter = isTypeParameter; exports.isTypeParameterDeclaration = isTypeParameterDeclaration; exports.isTypeParameterInstantiation = isTypeParameterInstantiation; exports.isUnionTypeAnnotation = isUnionTypeAnnotation; +exports.isVariance = isVariance; exports.isVoidTypeAnnotation = isVoidTypeAnnotation; exports.isJSXAttribute = isJSXAttribute; exports.isJSXClosingElement = isJSXClosingElement; @@ -144,11 +150,20 @@ exports.isParenthesizedExpression = isParenthesizedExpression; exports.isAwaitExpression = isAwaitExpression; exports.isBindExpression = isBindExpression; exports.isClassProperty = isClassProperty; +exports.isOptionalMemberExpression = isOptionalMemberExpression; +exports.isPipelineTopicExpression = isPipelineTopicExpression; +exports.isPipelineBareFunction = isPipelineBareFunction; +exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference; +exports.isOptionalCallExpression = isOptionalCallExpression; +exports.isClassPrivateProperty = isClassPrivateProperty; +exports.isClassPrivateMethod = isClassPrivateMethod; exports.isImport = isImport; exports.isDecorator = isDecorator; exports.isDoExpression = isDoExpression; exports.isExportDefaultSpecifier = isExportDefaultSpecifier; exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; +exports.isPrivateName = isPrivateName; +exports.isBigIntLiteral = isBigIntLiteral; exports.isTSParameterProperty = isTSParameterProperty; exports.isTSDeclareFunction = isTSDeclareFunction; exports.isTSDeclareMethod = isTSDeclareMethod; @@ -159,6 +174,7 @@ exports.isTSPropertySignature = isTSPropertySignature; exports.isTSMethodSignature = isTSMethodSignature; exports.isTSIndexSignature = isTSIndexSignature; exports.isTSAnyKeyword = isTSAnyKeyword; +exports.isTSUnknownKeyword = isTSUnknownKeyword; exports.isTSNumberKeyword = isTSNumberKeyword; exports.isTSObjectKeyword = isTSObjectKeyword; exports.isTSBooleanKeyword = isTSBooleanKeyword; @@ -177,8 +193,12 @@ exports.isTSTypeQuery = isTSTypeQuery; exports.isTSTypeLiteral = isTSTypeLiteral; exports.isTSArrayType = isTSArrayType; exports.isTSTupleType = isTSTupleType; +exports.isTSOptionalType = isTSOptionalType; +exports.isTSRestType = isTSRestType; exports.isTSUnionType = isTSUnionType; exports.isTSIntersectionType = isTSIntersectionType; +exports.isTSConditionalType = isTSConditionalType; +exports.isTSInferType = isTSInferType; exports.isTSParenthesizedType = isTSParenthesizedType; exports.isTSTypeOperator = isTSTypeOperator; exports.isTSIndexedAccessType = isTSIndexedAccessType; @@ -194,6 +214,7 @@ exports.isTSEnumDeclaration = isTSEnumDeclaration; exports.isTSEnumMember = isTSEnumMember; exports.isTSModuleDeclaration = isTSModuleDeclaration; exports.isTSModuleBlock = isTSModuleBlock; +exports.isTSImportType = isTSImportType; exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration; exports.isTSExternalModuleReference = isTSExternalModuleReference; exports.isTSNonNullExpression = isTSNonNullExpression; @@ -237,10 +258,12 @@ exports.isModuleDeclaration = isModuleDeclaration; exports.isExportDeclaration = isExportDeclaration; exports.isModuleSpecifier = isModuleSpecifier; exports.isFlow = isFlow; +exports.isFlowType = isFlowType; exports.isFlowBaseAnnotation = isFlowBaseAnnotation; exports.isFlowDeclaration = isFlowDeclaration; exports.isFlowPredicate = isFlowPredicate; exports.isJSX = isJSX; +exports.isPrivate = isPrivate; exports.isTSTypeElement = isTSTypeElement; exports.isTSType = isTSType; exports.isNumberLiteral = isNumberLiteral; @@ -248,994 +271,4015 @@ exports.isRegexLiteral = isRegexLiteral; exports.isRestProperty = isRestProperty; exports.isSpreadProperty = isSpreadProperty; -var _is = _interopRequireDefault(require("../is")); +var _shallowEqual = _interopRequireDefault(require("../../utils/shallowEqual")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isArrayExpression(node, opts) { - return (0, _is.default)("ArrayExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ArrayExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isAssignmentExpression(node, opts) { - return (0, _is.default)("AssignmentExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "AssignmentExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBinaryExpression(node, opts) { - return (0, _is.default)("BinaryExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BinaryExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isInterpreterDirective(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "InterpreterDirective") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDirective(node, opts) { - return (0, _is.default)("Directive", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Directive") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDirectiveLiteral(node, opts) { - return (0, _is.default)("DirectiveLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DirectiveLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBlockStatement(node, opts) { - return (0, _is.default)("BlockStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BlockStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBreakStatement(node, opts) { - return (0, _is.default)("BreakStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BreakStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isCallExpression(node, opts) { - return (0, _is.default)("CallExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "CallExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isCatchClause(node, opts) { - return (0, _is.default)("CatchClause", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "CatchClause") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isConditionalExpression(node, opts) { - return (0, _is.default)("ConditionalExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ConditionalExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isContinueStatement(node, opts) { - return (0, _is.default)("ContinueStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ContinueStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDebuggerStatement(node, opts) { - return (0, _is.default)("DebuggerStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DebuggerStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDoWhileStatement(node, opts) { - return (0, _is.default)("DoWhileStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DoWhileStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isEmptyStatement(node, opts) { - return (0, _is.default)("EmptyStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EmptyStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExpressionStatement(node, opts) { - return (0, _is.default)("ExpressionStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExpressionStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFile(node, opts) { - return (0, _is.default)("File", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "File") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isForInStatement(node, opts) { - return (0, _is.default)("ForInStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ForInStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isForStatement(node, opts) { - return (0, _is.default)("ForStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ForStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunctionDeclaration(node, opts) { - return (0, _is.default)("FunctionDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FunctionDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunctionExpression(node, opts) { - return (0, _is.default)("FunctionExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FunctionExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isIdentifier(node, opts) { - return (0, _is.default)("Identifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Identifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isIfStatement(node, opts) { - return (0, _is.default)("IfStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "IfStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isLabeledStatement(node, opts) { - return (0, _is.default)("LabeledStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "LabeledStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isStringLiteral(node, opts) { - return (0, _is.default)("StringLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "StringLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNumericLiteral(node, opts) { - return (0, _is.default)("NumericLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NumericLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNullLiteral(node, opts) { - return (0, _is.default)("NullLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NullLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBooleanLiteral(node, opts) { - return (0, _is.default)("BooleanLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BooleanLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isRegExpLiteral(node, opts) { - return (0, _is.default)("RegExpLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "RegExpLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isLogicalExpression(node, opts) { - return (0, _is.default)("LogicalExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "LogicalExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isMemberExpression(node, opts) { - return (0, _is.default)("MemberExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "MemberExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNewExpression(node, opts) { - return (0, _is.default)("NewExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NewExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isProgram(node, opts) { - return (0, _is.default)("Program", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Program") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectExpression(node, opts) { - return (0, _is.default)("ObjectExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectMethod(node, opts) { - return (0, _is.default)("ObjectMethod", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectMethod") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectProperty(node, opts) { - return (0, _is.default)("ObjectProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isRestElement(node, opts) { - return (0, _is.default)("RestElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "RestElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isReturnStatement(node, opts) { - return (0, _is.default)("ReturnStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ReturnStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSequenceExpression(node, opts) { - return (0, _is.default)("SequenceExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SequenceExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSwitchCase(node, opts) { - return (0, _is.default)("SwitchCase", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SwitchCase") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSwitchStatement(node, opts) { - return (0, _is.default)("SwitchStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SwitchStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isThisExpression(node, opts) { - return (0, _is.default)("ThisExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ThisExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isThrowStatement(node, opts) { - return (0, _is.default)("ThrowStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ThrowStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTryStatement(node, opts) { - return (0, _is.default)("TryStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TryStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isUnaryExpression(node, opts) { - return (0, _is.default)("UnaryExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "UnaryExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isUpdateExpression(node, opts) { - return (0, _is.default)("UpdateExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "UpdateExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isVariableDeclaration(node, opts) { - return (0, _is.default)("VariableDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "VariableDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isVariableDeclarator(node, opts) { - return (0, _is.default)("VariableDeclarator", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "VariableDeclarator") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isWhileStatement(node, opts) { - return (0, _is.default)("WhileStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "WhileStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isWithStatement(node, opts) { - return (0, _is.default)("WithStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "WithStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isAssignmentPattern(node, opts) { - return (0, _is.default)("AssignmentPattern", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "AssignmentPattern") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isArrayPattern(node, opts) { - return (0, _is.default)("ArrayPattern", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ArrayPattern") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isArrowFunctionExpression(node, opts) { - return (0, _is.default)("ArrowFunctionExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ArrowFunctionExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassBody(node, opts) { - return (0, _is.default)("ClassBody", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassDeclaration(node, opts) { - return (0, _is.default)("ClassDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassExpression(node, opts) { - return (0, _is.default)("ClassExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportAllDeclaration(node, opts) { - return (0, _is.default)("ExportAllDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportAllDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportDefaultDeclaration(node, opts) { - return (0, _is.default)("ExportDefaultDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportDefaultDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportNamedDeclaration(node, opts) { - return (0, _is.default)("ExportNamedDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportNamedDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportSpecifier(node, opts) { - return (0, _is.default)("ExportSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isForOfStatement(node, opts) { - return (0, _is.default)("ForOfStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ForOfStatement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImportDeclaration(node, opts) { - return (0, _is.default)("ImportDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ImportDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImportDefaultSpecifier(node, opts) { - return (0, _is.default)("ImportDefaultSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ImportDefaultSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImportNamespaceSpecifier(node, opts) { - return (0, _is.default)("ImportNamespaceSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ImportNamespaceSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImportSpecifier(node, opts) { - return (0, _is.default)("ImportSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ImportSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isMetaProperty(node, opts) { - return (0, _is.default)("MetaProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "MetaProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassMethod(node, opts) { - return (0, _is.default)("ClassMethod", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassMethod") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectPattern(node, opts) { - return (0, _is.default)("ObjectPattern", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectPattern") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSpreadElement(node, opts) { - return (0, _is.default)("SpreadElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SpreadElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSuper(node, opts) { - return (0, _is.default)("Super", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Super") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTaggedTemplateExpression(node, opts) { - return (0, _is.default)("TaggedTemplateExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TaggedTemplateExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTemplateElement(node, opts) { - return (0, _is.default)("TemplateElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TemplateElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTemplateLiteral(node, opts) { - return (0, _is.default)("TemplateLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TemplateLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isYieldExpression(node, opts) { - return (0, _is.default)("YieldExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "YieldExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isAnyTypeAnnotation(node, opts) { - return (0, _is.default)("AnyTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "AnyTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isArrayTypeAnnotation(node, opts) { - return (0, _is.default)("ArrayTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ArrayTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBooleanTypeAnnotation(node, opts) { - return (0, _is.default)("BooleanTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BooleanTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBooleanLiteralTypeAnnotation(node, opts) { - return (0, _is.default)("BooleanLiteralTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BooleanLiteralTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNullLiteralTypeAnnotation(node, opts) { - return (0, _is.default)("NullLiteralTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NullLiteralTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassImplements(node, opts) { - return (0, _is.default)("ClassImplements", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassImplements") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareClass(node, opts) { - return (0, _is.default)("DeclareClass", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareClass") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareFunction(node, opts) { - return (0, _is.default)("DeclareFunction", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareFunction") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareInterface(node, opts) { - return (0, _is.default)("DeclareInterface", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareInterface") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareModule(node, opts) { - return (0, _is.default)("DeclareModule", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareModule") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareModuleExports(node, opts) { - return (0, _is.default)("DeclareModuleExports", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareModuleExports") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareTypeAlias(node, opts) { - return (0, _is.default)("DeclareTypeAlias", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareTypeAlias") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareOpaqueType(node, opts) { - return (0, _is.default)("DeclareOpaqueType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareOpaqueType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareVariable(node, opts) { - return (0, _is.default)("DeclareVariable", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareVariable") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareExportDeclaration(node, opts) { - return (0, _is.default)("DeclareExportDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareExportDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclareExportAllDeclaration(node, opts) { - return (0, _is.default)("DeclareExportAllDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclareExportAllDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclaredPredicate(node, opts) { - return (0, _is.default)("DeclaredPredicate", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DeclaredPredicate") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExistsTypeAnnotation(node, opts) { - return (0, _is.default)("ExistsTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExistsTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunctionTypeAnnotation(node, opts) { - return (0, _is.default)("FunctionTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FunctionTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunctionTypeParam(node, opts) { - return (0, _is.default)("FunctionTypeParam", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FunctionTypeParam") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isGenericTypeAnnotation(node, opts) { - return (0, _is.default)("GenericTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "GenericTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isInferredPredicate(node, opts) { - return (0, _is.default)("InferredPredicate", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "InferredPredicate") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isInterfaceExtends(node, opts) { - return (0, _is.default)("InterfaceExtends", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "InterfaceExtends") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isInterfaceDeclaration(node, opts) { - return (0, _is.default)("InterfaceDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "InterfaceDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isInterfaceTypeAnnotation(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "InterfaceTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isIntersectionTypeAnnotation(node, opts) { - return (0, _is.default)("IntersectionTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "IntersectionTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isMixedTypeAnnotation(node, opts) { - return (0, _is.default)("MixedTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "MixedTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isEmptyTypeAnnotation(node, opts) { - return (0, _is.default)("EmptyTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EmptyTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNullableTypeAnnotation(node, opts) { - return (0, _is.default)("NullableTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NullableTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNumberLiteralTypeAnnotation(node, opts) { - return (0, _is.default)("NumberLiteralTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NumberLiteralTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNumberTypeAnnotation(node, opts) { - return (0, _is.default)("NumberTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NumberTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectTypeAnnotation(node, opts) { - return (0, _is.default)("ObjectTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isObjectTypeInternalSlot(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeInternalSlot") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectTypeCallProperty(node, opts) { - return (0, _is.default)("ObjectTypeCallProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeCallProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectTypeIndexer(node, opts) { - return (0, _is.default)("ObjectTypeIndexer", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeIndexer") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectTypeProperty(node, opts) { - return (0, _is.default)("ObjectTypeProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectTypeSpreadProperty(node, opts) { - return (0, _is.default)("ObjectTypeSpreadProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectTypeSpreadProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isOpaqueType(node, opts) { - return (0, _is.default)("OpaqueType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "OpaqueType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isQualifiedTypeIdentifier(node, opts) { - return (0, _is.default)("QualifiedTypeIdentifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "QualifiedTypeIdentifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isStringLiteralTypeAnnotation(node, opts) { - return (0, _is.default)("StringLiteralTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "StringLiteralTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isStringTypeAnnotation(node, opts) { - return (0, _is.default)("StringTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "StringTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isThisTypeAnnotation(node, opts) { - return (0, _is.default)("ThisTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ThisTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTupleTypeAnnotation(node, opts) { - return (0, _is.default)("TupleTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TupleTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeofTypeAnnotation(node, opts) { - return (0, _is.default)("TypeofTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeofTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeAlias(node, opts) { - return (0, _is.default)("TypeAlias", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeAlias") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeAnnotation(node, opts) { - return (0, _is.default)("TypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeCastExpression(node, opts) { - return (0, _is.default)("TypeCastExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeCastExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeParameter(node, opts) { - return (0, _is.default)("TypeParameter", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeParameter") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeParameterDeclaration(node, opts) { - return (0, _is.default)("TypeParameterDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeParameterDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTypeParameterInstantiation(node, opts) { - return (0, _is.default)("TypeParameterInstantiation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TypeParameterInstantiation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isUnionTypeAnnotation(node, opts) { - return (0, _is.default)("UnionTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "UnionTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isVariance(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Variance") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isVoidTypeAnnotation(node, opts) { - return (0, _is.default)("VoidTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "VoidTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXAttribute(node, opts) { - return (0, _is.default)("JSXAttribute", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXAttribute") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXClosingElement(node, opts) { - return (0, _is.default)("JSXClosingElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXClosingElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXElement(node, opts) { - return (0, _is.default)("JSXElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXEmptyExpression(node, opts) { - return (0, _is.default)("JSXEmptyExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXEmptyExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXExpressionContainer(node, opts) { - return (0, _is.default)("JSXExpressionContainer", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXExpressionContainer") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXSpreadChild(node, opts) { - return (0, _is.default)("JSXSpreadChild", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXSpreadChild") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXIdentifier(node, opts) { - return (0, _is.default)("JSXIdentifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXIdentifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXMemberExpression(node, opts) { - return (0, _is.default)("JSXMemberExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXMemberExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXNamespacedName(node, opts) { - return (0, _is.default)("JSXNamespacedName", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXNamespacedName") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXOpeningElement(node, opts) { - return (0, _is.default)("JSXOpeningElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXOpeningElement") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXSpreadAttribute(node, opts) { - return (0, _is.default)("JSXSpreadAttribute", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXSpreadAttribute") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXText(node, opts) { - return (0, _is.default)("JSXText", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXText") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXFragment(node, opts) { - return (0, _is.default)("JSXFragment", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXFragment") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXOpeningFragment(node, opts) { - return (0, _is.default)("JSXOpeningFragment", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXOpeningFragment") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSXClosingFragment(node, opts) { - return (0, _is.default)("JSXClosingFragment", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSXClosingFragment") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNoop(node, opts) { - return (0, _is.default)("Noop", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Noop") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isParenthesizedExpression(node, opts) { - return (0, _is.default)("ParenthesizedExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ParenthesizedExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isAwaitExpression(node, opts) { - return (0, _is.default)("AwaitExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "AwaitExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBindExpression(node, opts) { - return (0, _is.default)("BindExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BindExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClassProperty(node, opts) { - return (0, _is.default)("ClassProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isOptionalMemberExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "OptionalMemberExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isPipelineTopicExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "PipelineTopicExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isPipelineBareFunction(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "PipelineBareFunction") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isPipelinePrimaryTopicReference(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "PipelinePrimaryTopicReference") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isOptionalCallExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "OptionalCallExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isClassPrivateProperty(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassPrivateProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isClassPrivateMethod(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ClassPrivateMethod") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImport(node, opts) { - return (0, _is.default)("Import", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Import") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDecorator(node, opts) { - return (0, _is.default)("Decorator", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Decorator") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDoExpression(node, opts) { - return (0, _is.default)("DoExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "DoExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportDefaultSpecifier(node, opts) { - return (0, _is.default)("ExportDefaultSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportDefaultSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportNamespaceSpecifier(node, opts) { - return (0, _is.default)("ExportNamespaceSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportNamespaceSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isPrivateName(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "PrivateName") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isBigIntLiteral(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BigIntLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSParameterProperty(node, opts) { - return (0, _is.default)("TSParameterProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSParameterProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSDeclareFunction(node, opts) { - return (0, _is.default)("TSDeclareFunction", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSDeclareFunction") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSDeclareMethod(node, opts) { - return (0, _is.default)("TSDeclareMethod", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSDeclareMethod") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSQualifiedName(node, opts) { - return (0, _is.default)("TSQualifiedName", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSQualifiedName") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSCallSignatureDeclaration(node, opts) { - return (0, _is.default)("TSCallSignatureDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSCallSignatureDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSConstructSignatureDeclaration(node, opts) { - return (0, _is.default)("TSConstructSignatureDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSConstructSignatureDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSPropertySignature(node, opts) { - return (0, _is.default)("TSPropertySignature", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSPropertySignature") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSMethodSignature(node, opts) { - return (0, _is.default)("TSMethodSignature", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSMethodSignature") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSIndexSignature(node, opts) { - return (0, _is.default)("TSIndexSignature", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSIndexSignature") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSAnyKeyword(node, opts) { - return (0, _is.default)("TSAnyKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSAnyKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSUnknownKeyword(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSUnknownKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSNumberKeyword(node, opts) { - return (0, _is.default)("TSNumberKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNumberKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSObjectKeyword(node, opts) { - return (0, _is.default)("TSObjectKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSObjectKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSBooleanKeyword(node, opts) { - return (0, _is.default)("TSBooleanKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSBooleanKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSStringKeyword(node, opts) { - return (0, _is.default)("TSStringKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSStringKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSSymbolKeyword(node, opts) { - return (0, _is.default)("TSSymbolKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSSymbolKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSVoidKeyword(node, opts) { - return (0, _is.default)("TSVoidKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSVoidKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSUndefinedKeyword(node, opts) { - return (0, _is.default)("TSUndefinedKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSUndefinedKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSNullKeyword(node, opts) { - return (0, _is.default)("TSNullKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNullKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSNeverKeyword(node, opts) { - return (0, _is.default)("TSNeverKeyword", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNeverKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSThisType(node, opts) { - return (0, _is.default)("TSThisType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSThisType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSFunctionType(node, opts) { - return (0, _is.default)("TSFunctionType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSFunctionType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSConstructorType(node, opts) { - return (0, _is.default)("TSConstructorType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSConstructorType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeReference(node, opts) { - return (0, _is.default)("TSTypeReference", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeReference") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypePredicate(node, opts) { - return (0, _is.default)("TSTypePredicate", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypePredicate") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeQuery(node, opts) { - return (0, _is.default)("TSTypeQuery", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeQuery") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeLiteral(node, opts) { - return (0, _is.default)("TSTypeLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSArrayType(node, opts) { - return (0, _is.default)("TSArrayType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSArrayType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTupleType(node, opts) { - return (0, _is.default)("TSTupleType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTupleType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSOptionalType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSOptionalType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSRestType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSRestType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSUnionType(node, opts) { - return (0, _is.default)("TSUnionType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSUnionType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSIntersectionType(node, opts) { - return (0, _is.default)("TSIntersectionType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSIntersectionType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSConditionalType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSConditionalType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSInferType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSInferType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSParenthesizedType(node, opts) { - return (0, _is.default)("TSParenthesizedType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSParenthesizedType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeOperator(node, opts) { - return (0, _is.default)("TSTypeOperator", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeOperator") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSIndexedAccessType(node, opts) { - return (0, _is.default)("TSIndexedAccessType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSIndexedAccessType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSMappedType(node, opts) { - return (0, _is.default)("TSMappedType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSMappedType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSLiteralType(node, opts) { - return (0, _is.default)("TSLiteralType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSLiteralType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSExpressionWithTypeArguments(node, opts) { - return (0, _is.default)("TSExpressionWithTypeArguments", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSExpressionWithTypeArguments") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSInterfaceDeclaration(node, opts) { - return (0, _is.default)("TSInterfaceDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSInterfaceDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSInterfaceBody(node, opts) { - return (0, _is.default)("TSInterfaceBody", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSInterfaceBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeAliasDeclaration(node, opts) { - return (0, _is.default)("TSTypeAliasDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeAliasDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSAsExpression(node, opts) { - return (0, _is.default)("TSAsExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSAsExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeAssertion(node, opts) { - return (0, _is.default)("TSTypeAssertion", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeAssertion") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSEnumDeclaration(node, opts) { - return (0, _is.default)("TSEnumDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSEnumDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSEnumMember(node, opts) { - return (0, _is.default)("TSEnumMember", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSEnumMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSModuleDeclaration(node, opts) { - return (0, _is.default)("TSModuleDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSModuleDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSModuleBlock(node, opts) { - return (0, _is.default)("TSModuleBlock", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSModuleBlock") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSImportType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSImportType") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSImportEqualsDeclaration(node, opts) { - return (0, _is.default)("TSImportEqualsDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSImportEqualsDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSExternalModuleReference(node, opts) { - return (0, _is.default)("TSExternalModuleReference", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSExternalModuleReference") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSNonNullExpression(node, opts) { - return (0, _is.default)("TSNonNullExpression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNonNullExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSExportAssignment(node, opts) { - return (0, _is.default)("TSExportAssignment", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSExportAssignment") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSNamespaceExportDeclaration(node, opts) { - return (0, _is.default)("TSNamespaceExportDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNamespaceExportDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeAnnotation(node, opts) { - return (0, _is.default)("TSTypeAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeParameterInstantiation(node, opts) { - return (0, _is.default)("TSTypeParameterInstantiation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeParameterInstantiation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeParameterDeclaration(node, opts) { - return (0, _is.default)("TSTypeParameterDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeParameterDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeParameter(node, opts) { - return (0, _is.default)("TSTypeParameter", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeParameter") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExpression(node, opts) { - return (0, _is.default)("Expression", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "ParenthesizedExpression" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBinary(node, opts) { - return (0, _is.default)("Binary", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Binary" || "BinaryExpression" === nodeType || "LogicalExpression" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isScopable(node, opts) { - return (0, _is.default)("Scopable", 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) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBlockParent(node, opts) { - return (0, _is.default)("BlockParent", 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) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isBlock(node, opts) { - return (0, _is.default)("Block", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isStatement(node, opts) { - return (0, _is.default)("Statement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTerminatorless(node, opts) { - return (0, _is.default)("Terminatorless", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Terminatorless" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isCompletionStatement(node, opts) { - return (0, _is.default)("CompletionStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "CompletionStatement" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isConditional(node, opts) { - return (0, _is.default)("Conditional", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Conditional" || "ConditionalExpression" === nodeType || "IfStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isLoop(node, opts) { - return (0, _is.default)("Loop", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Loop" || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isWhile(node, opts) { - return (0, _is.default)("While", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "While" || "DoWhileStatement" === nodeType || "WhileStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExpressionWrapper(node, opts) { - return (0, _is.default)("ExpressionWrapper", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExpressionWrapper" || "ExpressionStatement" === nodeType || "TypeCastExpression" === nodeType || "ParenthesizedExpression" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFor(node, opts) { - return (0, _is.default)("For", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "For" || "ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isForXStatement(node, opts) { - return (0, _is.default)("ForXStatement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ForXStatement" || "ForInStatement" === nodeType || "ForOfStatement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunction(node, opts) { - return (0, _is.default)("Function", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Function" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFunctionParent(node, opts) { - return (0, _is.default)("FunctionParent", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FunctionParent" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isPureish(node, opts) { - return (0, _is.default)("Pureish", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "BigIntLiteral" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isDeclaration(node, opts) { - return (0, _is.default)("Declaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isPatternLike(node, opts) { - return (0, _is.default)("PatternLike", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "PatternLike" || "Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isLVal(node, opts) { - return (0, _is.default)("LVal", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "LVal" || "Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSEntityName(node, opts) { - return (0, _is.default)("TSEntityName", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSEntityName" || "Identifier" === nodeType || "TSQualifiedName" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isLiteral(node, opts) { - return (0, _is.default)("Literal", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isImmutable(node, opts) { - return (0, _is.default)("Immutable", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "BigIntLiteral" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isUserWhitespacable(node, opts) { - return (0, _is.default)("UserWhitespacable", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "UserWhitespacable" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isMethod(node, opts) { - return (0, _is.default)("Method", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Method" || "ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isObjectMember(node, opts) { - return (0, _is.default)("ObjectMember", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ObjectMember" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isProperty(node, opts) { - return (0, _is.default)("Property", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Property" || "ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isUnaryLike(node, opts) { - return (0, _is.default)("UnaryLike", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "UnaryLike" || "UnaryExpression" === nodeType || "SpreadElement" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isPattern(node, opts) { - return (0, _is.default)("Pattern", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Pattern" || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isClass(node, opts) { - return (0, _is.default)("Class", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Class" || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isModuleDeclaration(node, opts) { - return (0, _is.default)("ModuleDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ModuleDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isExportDeclaration(node, opts) { - return (0, _is.default)("ExportDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isModuleSpecifier(node, opts) { - return (0, _is.default)("ModuleSpecifier", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFlow(node, opts) { - return (0, _is.default)("Flow", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isFlowType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFlowBaseAnnotation(node, opts) { - return (0, _is.default)("FlowBaseAnnotation", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFlowDeclaration(node, opts) { - return (0, _is.default)("FlowDeclaration", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FlowDeclaration" || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isFlowPredicate(node, opts) { - return (0, _is.default)("FlowPredicate", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "FlowPredicate" || "DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isJSX(node, opts) { - return (0, _is.default)("JSX", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "JSX" || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isPrivate(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Private" || "ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSTypeElement(node, opts) { - return (0, _is.default)("TSTypeElement", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSTypeElement" || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isTSType(node, opts) { - return (0, _is.default)("TSType", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isNumberLiteral(node, opts) { console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - return (0, _is.default)("NumberLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "NumberLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isRegexLiteral(node, opts) { console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - return (0, _is.default)("RegexLiteral", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "RegexLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isRestProperty(node, opts) { console.trace("The node type RestProperty has been renamed to RestElement"); - return (0, _is.default)("RestProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "RestProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } function isSpreadProperty(node, opts) { console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - return (0, _is.default)("SpreadProperty", node, opts); + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SpreadProperty") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js index c1e50d857b94a8..5aa809d25e563a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = is; var _shallowEqual = _interopRequireDefault(require("../utils/shallowEqual")); @@ -11,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function is(type, node, opts) { if (!node) return false; - var matches = (0, _isType.default)(node.type, type); + const matches = (0, _isType.default)(node.type, type); if (!matches) return false; if (typeof opts === "undefined") { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js index 3644879cdde3c4..24d781bf042e8c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isBinding; var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBindingIdentifiers")); @@ -8,12 +10,12 @@ var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBi function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isBinding(node, parent) { - var keys = _getBindingIdentifiers.default.keys[parent.type]; + const keys = _getBindingIdentifiers.default.keys[parent.type]; if (keys) { - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = parent[key]; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const val = parent[key]; if (Array.isArray(val)) { if (val.indexOf(node) >= 0) return true; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js index da5c53fce452a4..7e6549e03b1ea4 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isBlockScoped; var _generated = require("./generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js index 2ea002713e0de7..b00b23d4ce0997 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isImmutable; var _isType = _interopRequireDefault(require("./isType")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js index a3a6169a030fa1..93d75628082195 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isLet; var _generated = require("./generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js index 641cb9c52b46c2..e88a47aac457f1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isNode; var _definitions = require("../definitions"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js index 549c0b470ff1d9..01c5c1848ace9f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isNodesEquivalent; var _definitions = require("../definitions"); @@ -14,11 +16,10 @@ function isNodesEquivalent(a, b) { return false; } - var fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); - - for (var _i = 0; _i < fields.length; _i++) { - var field = fields[_i]; + const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); + const visitorKeys = _definitions.VISITOR_KEYS[a.type]; + for (const field of fields) { if (typeof a[field] !== typeof b[field]) { return false; } @@ -32,7 +33,7 @@ function isNodesEquivalent(a, b) { return false; } - for (var i = 0; i < a[field].length; i++) { + for (let i = 0; i < a[field].length; i++) { if (!isNodesEquivalent(a[field][i], b[field][i])) { return false; } @@ -41,6 +42,16 @@ function isNodesEquivalent(a, b) { continue; } + if (typeof a[field] === "object" && (!visitorKeys || !visitorKeys.includes(field))) { + for (const key in a[field]) { + if (a[field][key] !== b[field][key]) { + return false; + } + } + + continue; + } + if (!isNodesEquivalent(a[field], b[field])) { return false; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js index 5bb68b4ad44001..26c047efb4f7dd 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js @@ -1,98 +1,94 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isReferenced; function isReferenced(node, parent) { switch (parent.type) { - case "BindExpression": - return parent.object === node || parent.callee === node; - case "MemberExpression": case "JSXMemberExpression": - if (parent.property === node && parent.computed) { - return true; - } else if (parent.object === node) { - return true; - } else { - return false; + case "OptionalMemberExpression": + if (parent.property === node) { + return !!parent.computed; } - case "MetaProperty": - return false; - - case "ObjectProperty": - if (parent.key === node) { - return parent.computed; - } + return parent.object === node; case "VariableDeclarator": - return parent.id !== node; + return parent.init === node; case "ArrowFunctionExpression": - case "FunctionDeclaration": - case "FunctionExpression": - var _arr = parent.params; - - for (var _i = 0; _i < _arr.length; _i++) { - var param = _arr[_i]; - if (param === node) return false; - } - - return parent.id !== node; + return parent.body === node; case "ExportSpecifier": if (parent.source) { return false; - } else { - return parent.local === node; } - case "ExportNamespaceSpecifier": - case "ExportDefaultSpecifier": - return false; - - case "JSXAttribute": - return parent.name !== node; + return parent.local === node; + case "ObjectProperty": case "ClassProperty": + case "ClassPrivateProperty": + case "ClassMethod": + case "ClassPrivateMethod": + case "ObjectMethod": if (parent.key === node) { - return parent.computed; - } else { - return parent.value === node; + return !!parent.computed; } - case "ImportDefaultSpecifier": - case "ImportNamespaceSpecifier": - case "ImportSpecifier": - return false; + return parent.value === node; case "ClassDeclaration": case "ClassExpression": - return parent.id !== node; + return parent.superClass === node; - case "ClassMethod": - case "ObjectMethod": - return parent.key === node && parent.computed; + case "AssignmentExpression": + return parent.right === node; + + case "AssignmentPattern": + return parent.right === node; case "LabeledStatement": return false; case "CatchClause": - return parent.param !== node; + return false; case "RestElement": return false; - case "AssignmentExpression": - return parent.right === node; + case "BreakStatement": + case "ContinueStatement": + return false; - case "AssignmentPattern": - return parent.right === node; + case "FunctionDeclaration": + case "FunctionExpression": + return false; + + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + + case "JSXAttribute": + return false; case "ObjectPattern": case "ArrayPattern": return false; + + case "MetaProperty": + return false; + + case "ObjectTypeProperty": + return parent.key !== node; } return true; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js index 91928ca59ef83a..c808631faf2c61 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isScope; var _generated = require("./generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js index 936d58e9e5b8e0..25431cc2732b34 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isSpecifierDefault; var _generated = require("./generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js index 04410ca5d0b878..59d31dfbbfcafd 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isType; var _definitions = require("../definitions"); @@ -8,25 +10,13 @@ var _definitions = require("../definitions"); function isType(nodeType, targetType) { if (nodeType === targetType) return true; if (_definitions.ALIAS_KEYS[targetType]) return false; - var aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; + const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; if (aliases) { if (aliases[0] === nodeType) return true; - for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var _alias = _ref; - if (nodeType === _alias) return true; + for (const alias of aliases) { + if (nodeType === alias) return true; } } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js index ce98b3819c748a..8455cab269bae2 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js @@ -1,13 +1,15 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isValidES3Identifier; var _isValidIdentifier = _interopRequireDefault(require("./isValidIdentifier")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); +const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); function isValidES3Identifier(name) { return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js index 981ae2a6473fe4..8c54b7ac8680db 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js @@ -1,18 +1,28 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isValidIdentifier; -var _esutils = _interopRequireDefault(require("esutils")); +function _esutils() { + const data = _interopRequireDefault(require("esutils")); + + _esutils = function () { + return data; + }; + + return data; +} function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isValidIdentifier(name) { - if (typeof name !== "string" || _esutils.default.keyword.isReservedWordES6(name, true)) { + if (typeof name !== "string" || _esutils().default.keyword.isReservedWordES6(name, true)) { return false; } else if (name === "await") { return false; } else { - return _esutils.default.keyword.isIdentifierNameES6(name); + return _esutils().default.keyword.isIdentifierNameES6(name); } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js index df6b20731c833f..a34801d18fe375 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js @@ -1,6 +1,8 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isVar; var _generated = require("./generated"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js index b2cf579423a404..538e011f4ca257 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js @@ -1,15 +1,17 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = matchesPattern; var _generated = require("./generated"); function matchesPattern(member, match, allowPartial) { if (!(0, _generated.isMemberExpression)(member)) return false; - var parts = Array.isArray(match) ? match : match.split("."); - var nodes = []; - var node; + const parts = Array.isArray(match) ? match : match.split("."); + const nodes = []; + let node; for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) { nodes.push(node.property); @@ -19,14 +21,14 @@ function matchesPattern(member, match, allowPartial) { if (nodes.length < parts.length) return false; if (!allowPartial && nodes.length > parts.length) return false; - for (var i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { - var _node = nodes[j]; - var value = void 0; + for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { + const node = nodes[j]; + let value; - if ((0, _generated.isIdentifier)(_node)) { - value = _node.name; - } else if ((0, _generated.isStringLiteral)(_node)) { - value = _node.value; + if ((0, _generated.isIdentifier)(node)) { + value = node.name; + } else if ((0, _generated.isStringLiteral)(node)) { + value = node.value; } else { return false; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js index f5dc829a9b9529..57761c2b1b15bd 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js @@ -1,8 +1,10 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = isCompatTag; function isCompatTag(tagName) { - return !!tagName && /^[a-z]|-/.test(tagName); + return !!tagName && /^[a-z]/.test(tagName); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js index af7abc2b0719a6..33b30d71e9700d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js @@ -1,12 +1,14 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = void 0; var _buildMatchMemberExpression = _interopRequireDefault(require("../buildMatchMemberExpression")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); +const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); var _default = isReactComponent; exports.default = _default; \ No newline at end of file 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 ab96408b3a7760..1fe1c1c9b80d57 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 @@ -1,15 +1,17 @@ "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.default = validate; var _definitions = require("../definitions"); function validate(node, key, val) { if (!node) return; - var fields = _definitions.NODE_FIELDS[node.type]; + const fields = _definitions.NODE_FIELDS[node.type]; if (!fields) return; - var field = fields[key]; + const field = fields[key]; 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 af3128ee9f3589..b365bb91f11e3c 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 @@ -1,32 +1,4 @@ { - "_from": "@babel/types@7.0.0-beta.36", - "_id": "@babel/types@7.0.0-beta.36", - "_inBundle": false, - "_integrity": "sha512-PyAORDO9um9tfnrddXgmWN9e6Sq9qxraQIt5ynqBOSXKA5qvK1kUr+Q3nSzKFdzorsiK+oqcUnAFvEoKxv9D+Q==", - "_location": "/babel-eslint/@babel/types", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/types@7.0.0-beta.36", - "name": "@babel/types", - "escapedName": "@babel%2ftypes", - "scope": "@babel", - "rawSpec": "7.0.0-beta.36", - "saveSpec": null, - "fetchSpec": "7.0.0-beta.36" - }, - "_requiredBy": [ - "/babel-eslint", - "/babel-eslint/@babel/helper-function-name", - "/babel-eslint/@babel/helper-get-function-arity", - "/babel-eslint/@babel/template", - "/babel-eslint/@babel/traverse" - ], - "_resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.36.tgz", - "_shasum": "64f2004353de42adb72f9ebb4665fc35b5499d23", - "_spec": "@babel/types@7.0.0-beta.36", - "_where": "/home/mzasso/git/nodejs/node/tools/babel-eslint-tmp/node_modules/babel-eslint", "author": { "name": "Sebastian McKenzie", "email": "sebmck@gmail.com" @@ -34,15 +6,16 @@ "bundleDependencies": false, "dependencies": { "esutils": "^2.0.2", - "lodash": "^4.2.0", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" }, "deprecated": false, "description": "Babel Types is a Lodash-esque utility library for AST nodes", "devDependencies": { - "@babel/generator": "7.0.0-beta.36", - "babylon": "7.0.0-beta.36" + "@babel/generator": "^7.3.4", + "@babel/parser": "^7.3.4" }, + "gitHead": "1f6454cc90fe33e0a32260871212e2f719f35741", "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", @@ -51,5 +24,6 @@ "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-types" }, - "version": "7.0.0-beta.36" -} + "types": "lib/index.d.ts", + "version": "7.3.4" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js index e122145c3ca1f7..794b214adff561 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js @@ -1,6 +1,7 @@ "use strict"; const fs = require("fs"); const path = require("path"); +const chalk = require("chalk"); const generateBuilders = require("./generators/generateBuilders"); const generateValidators = require("./generators/generateValidators"); const generateAsserts = require("./generators/generateAsserts"); @@ -26,6 +27,13 @@ function writeFile(content, location) { console.log("Generating @babel/types dynamic functions"); writeFile(generateBuilders(), "builders/generated/index.js"); +console.log(` ${chalk.green("✔")} Generated builders`); + writeFile(generateValidators(), "validators/generated/index.js"); +console.log(` ${chalk.green("✔")} Generated validators`); + writeFile(generateAsserts(), "asserts/generated/index.js"); +console.log(` ${chalk.green("✔")} Generated asserts`); + writeFile(generateConstants(), "constants/generated/index.js"); +console.log(` ${chalk.green("✔")} Generated constants`); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js new file mode 100644 index 00000000000000..3bbb52362400bb --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js @@ -0,0 +1,117 @@ +"use strict"; + +const util = require("util"); +const stringifyValidator = require("../utils/stringifyValidator"); +const toFunctionName = require("../utils/toFunctionName"); + +const types = require("../../"); + +const readme = [ + `# @babel/types + +> This module contains methods for building ASTs manually and for checking the types of AST nodes. + +## Install + +\`\`\`sh +npm install --save-dev @babel/types +\`\`\` + +## API`, +]; + +const customTypes = { + ClassMethod: { + key: "if computed then `Expression` else `Identifier | Literal`", + }, + Identifier: { + name: "`string`", + }, + MemberExpression: { + property: "if computed then `Expression` else `Identifier`", + }, + ObjectMethod: { + key: "if computed then `Expression` else `Identifier | Literal`", + }, + ObjectProperty: { + key: "if computed then `Expression` else `Identifier | Literal`", + }, +}; +Object.keys(types.BUILDER_KEYS) + .sort() + .forEach(function(key) { + readme.push("### " + key[0].toLowerCase() + key.substr(1)); + readme.push("```javascript"); + readme.push( + "t." + + toFunctionName(key) + + "(" + + types.BUILDER_KEYS[key].join(", ") + + ")" + ); + readme.push("```"); + readme.push(""); + readme.push( + "See also `t.is" + + key + + "(node, opts)` and `t.assert" + + key + + "(node, opts)`." + ); + readme.push(""); + if (types.ALIAS_KEYS[key] && types.ALIAS_KEYS[key].length) { + readme.push( + "Aliases: " + + types.ALIAS_KEYS[key] + .map(function(key) { + return "`" + key + "`"; + }) + .join(", ") + ); + readme.push(""); + } + Object.keys(types.NODE_FIELDS[key]) + .sort(function(fieldA, fieldB) { + const indexA = types.BUILDER_KEYS[key].indexOf(fieldA); + const indexB = types.BUILDER_KEYS[key].indexOf(fieldB); + if (indexA === indexB) return fieldA < fieldB ? -1 : 1; + if (indexA === -1) return 1; + if (indexB === -1) return -1; + return indexA - indexB; + }) + .forEach(function(field) { + const defaultValue = types.NODE_FIELDS[key][field].default; + const fieldDescription = ["`" + field + "`"]; + const validator = types.NODE_FIELDS[key][field].validate; + if (customTypes[key] && customTypes[key][field]) { + fieldDescription.push(`: ${customTypes[key][field]}`); + } else if (validator) { + try { + fieldDescription.push( + ": `" + stringifyValidator(validator, "") + "`" + ); + } catch (ex) { + if (ex.code === "UNEXPECTED_VALIDATOR_TYPE") { + console.log( + "Unrecognised validator type for " + key + "." + field + ); + console.dir(ex.validator, { depth: 10, colors: true }); + } + } + } + if (defaultValue !== null || types.NODE_FIELDS[key][field].optional) { + fieldDescription.push( + " (default: `" + util.inspect(defaultValue) + "`)" + ); + } else { + fieldDescription.push(" (required)"); + } + readme.push(" - " + fieldDescription.join("")); + }); + + readme.push(""); + readme.push("---"); + readme.push(""); + }); + +process.stdout.write(readme.join("\n")); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js new file mode 100644 index 00000000000000..daab2411d74235 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js @@ -0,0 +1,153 @@ +"use strict"; + +const t = require("../../"); +const stringifyValidator = require("../utils/stringifyValidator"); +const toFunctionName = require("../utils/toFunctionName"); + +const NODE_PREFIX = "BabelNode"; + +let code = `// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/flow.js for script used. + +declare class ${NODE_PREFIX}Comment { + value: string; + start: number; + end: number; + loc: ${NODE_PREFIX}SourceLocation; +} + +declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { + type: "CommentBlock"; +} + +declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { + type: "CommentLine"; +} + +declare class ${NODE_PREFIX}SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +declare class ${NODE_PREFIX} { + leadingComments?: Array<${NODE_PREFIX}Comment>; + innerComments?: Array<${NODE_PREFIX}Comment>; + trailingComments?: Array<${NODE_PREFIX}Comment>; + start: ?number; + end: ?number; + loc: ?${NODE_PREFIX}SourceLocation; +}\n\n`; + +// + +const lines = []; + +for (const type in t.NODE_FIELDS) { + const fields = t.NODE_FIELDS[type]; + + const struct = ['type: "' + type + '";']; + const args = []; + + Object.keys(t.NODE_FIELDS[type]) + .sort((fieldA, fieldB) => { + const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); + const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); + if (indexA === indexB) return fieldA < fieldB ? -1 : 1; + if (indexA === -1) return 1; + if (indexB === -1) return -1; + return indexA - indexB; + }) + .forEach(fieldName => { + const field = fields[fieldName]; + + let suffix = ""; + if (field.optional || field.default != null) suffix += "?"; + + let typeAnnotation = "any"; + + const validate = field.validate; + if (validate) { + typeAnnotation = stringifyValidator(validate, NODE_PREFIX); + } + + if (typeAnnotation) { + suffix += ": " + typeAnnotation; + } + + args.push(t.toBindingIdentifierName(fieldName) + suffix); + + if (t.isValidIdentifier(fieldName)) { + struct.push(fieldName + suffix + ";"); + } + }); + + code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} { + ${struct.join("\n ").trim()} +}\n\n`; + + // Flow chokes on super() and import() :/ + if (type !== "Super" && type !== "Import") { + lines.push( + `declare function ${toFunctionName(type)}(${args.join( + ", " + )}): ${NODE_PREFIX}${type};` + ); + } +} + +for (let i = 0; i < t.TYPES.length; i++) { + let decl = `declare function is${ + t.TYPES[i] + }(node: ?Object, opts?: ?Object): boolean`; + + if (t.NODE_FIELDS[t.TYPES[i]]) { + decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`; + } + + lines.push(decl); +} + +lines.push( + `declare function validate(n: BabelNode, key: string, value: mixed): void;`, + `declare function clone(n: T): T;`, + `declare function cloneDeep(n: T): T;`, + `declare function removeProperties(n: T, opts: ?{}): void;`, + `declare function removePropertiesDeep(n: T, opts: ?{}): T;`, + `declare type TraversalAncestors = Array<{ + node: BabelNode, + key: string, + index?: number, + }>; + declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; + declare type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, + };`.replace(/(^|\n) {2}/g, "$1"), + // eslint-disable-next-line + `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;` +); + +for (const type in t.FLIPPED_ALIAS_KEYS) { + const types = t.FLIPPED_ALIAS_KEYS[type]; + code += `type ${NODE_PREFIX}${type} = ${types + .map(type => `${NODE_PREFIX}${type}`) + .join(" | ")};\n`; +} + +code += `\ndeclare module "@babel/types" { + ${lines + .join("\n") + .replace(/\n/g, "\n ") + .trim()} +}\n`; + +// + +process.stdout.write(code); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js index b523d6adc85354..1e1ed321be6288 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js @@ -1,9 +1,31 @@ "use strict"; const definitions = require("../../lib/definitions"); -function addIsHelper(type) { - return `export function is${type}(node: Object, opts?: Object): boolean { - return is("${type}", node, opts) } +function addIsHelper(type, aliasKeys, deprecated) { + const targetType = JSON.stringify(type); + let aliasSource = ""; + if (aliasKeys) { + aliasSource = + " || " + + aliasKeys.map(JSON.stringify).join(" === nodeType || ") + + " === nodeType"; + } + + return `export function is${type}(node: ?Object, opts?: Object): boolean { + ${deprecated || ""} + if (!node) return false; + + const nodeType = node.type; + if (nodeType === ${targetType}${aliasSource}) { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; + } `; } @@ -13,22 +35,20 @@ module.exports = function generateValidators() { * This file is auto-generated! Do not modify it directly. * To re-generate run 'make build' */ -import is from "../is";\n\n`; +import shallowEqual from "../../utils/shallowEqual";\n\n`; Object.keys(definitions.VISITOR_KEYS).forEach(type => { output += addIsHelper(type); }); Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => { - output += addIsHelper(type); + output += addIsHelper(type, definitions.FLIPPED_ALIAS_KEYS[type]); }); Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { const newType = definitions.DEPRECATED_KEYS[type]; - output += `export function is${type}(node: Object, opts: Object): boolean { - console.trace("The node type ${type} has been renamed to ${newType}"); - return is("${type}", node, opts); -}\n`; + const deprecated = `console.trace("The node type ${type} has been renamed to ${newType}");`; + output += addIsHelper(type, null, deprecated); }); return output; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js new file mode 100644 index 00000000000000..b6019ec373240d --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js @@ -0,0 +1,200 @@ +"use strict"; + +const t = require("../../"); +const stringifyValidator = require("../utils/stringifyValidator"); +const toFunctionName = require("../utils/toFunctionName"); + +let code = `// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/typescript.js for script used. + +interface BaseComment { + value: string; + start: number; + end: number; + loc: SourceLocation; + type: "CommentBlock" | "CommentLine"; +} + +export interface CommentBlock extends BaseComment { + type: "CommentBlock"; +} + +export interface CommentLine extends BaseComment { + type: "CommentLine"; +} + +export type Comment = CommentBlock | CommentLine; + +export interface SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +interface BaseNode { + leadingComments: ReadonlyArray | null; + innerComments: ReadonlyArray | null; + trailingComments: ReadonlyArray | null; + start: number | null; + end: number | null; + loc: SourceLocation | null; + type: Node["type"]; +} + +export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; + +// + +const lines = []; + +for (const type in t.NODE_FIELDS) { + const fields = t.NODE_FIELDS[type]; + const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); + + const struct = ['type: "' + type + '";']; + const args = []; + + fieldNames.forEach(fieldName => { + const field = fields[fieldName]; + let typeAnnotation = stringifyValidator(field.validate, ""); + + if (isNullable(field) && !hasDefault(field)) { + typeAnnotation += " | null"; + } + + if (areAllRemainingFieldsNullable(fieldName, fieldNames, fields)) { + args.push( + `${t.toBindingIdentifierName(fieldName)}${ + isNullable(field) ? "?:" : ":" + } ${typeAnnotation}` + ); + } else { + args.push( + `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${ + isNullable(field) ? " | undefined" : "" + }` + ); + } + + const alphaNumeric = /^\w+$/; + + if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { + struct.push(`${fieldName}: ${typeAnnotation};`); + } else { + struct.push(`"${fieldName}": ${typeAnnotation};`); + } + }); + + code += `export interface ${type} extends BaseNode { + ${struct.join("\n ").trim()} +}\n\n`; + + // super and import are reserved words in JavaScript + if (type !== "Super" && type !== "Import") { + lines.push( + `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` + ); + } +} + +for (let i = 0; i < t.TYPES.length; i++) { + let decl = `export function is${ + t.TYPES[i] + }(node: object | null | undefined, opts?: object | null): `; + + if (t.NODE_FIELDS[t.TYPES[i]]) { + decl += `node is ${t.TYPES[i]};`; + } else if (t.FLIPPED_ALIAS_KEYS[t.TYPES[i]]) { + decl += `node is ${t.TYPES[i]};`; + } else { + decl += `boolean;`; + } + + lines.push(decl); +} + +lines.push( + `export function validate(n: Node, key: string, value: any): void;`, + `export function clone(n: T): T;`, + `export function cloneDeep(n: T): T;`, + `export function removeProperties( + n: Node, + opts?: { preserveComments: boolean } | null +): void;`, + `export function removePropertiesDeep( + n: T, + opts?: { preserveComments: boolean } | null +): T;`, + `export type TraversalAncestors = ReadonlyArray<{ + node: Node, + key: string, + index?: number, + }>; + export type TraversalHandler = (node: Node, parent: TraversalAncestors, type: T) => void; + export type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, + };`.replace(/(^|\n) {2}/g, "$1"), + // eslint-disable-next-line + `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;` +); + +for (const type in t.DEPRECATED_KEYS) { + code += `/** + * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\` + */ +export type ${type} = ${t.DEPRECATED_KEYS[type]};\n +`; +} + +for (const type in t.FLIPPED_ALIAS_KEYS) { + const types = t.FLIPPED_ALIAS_KEYS[type]; + code += `export type ${type} = ${types + .map(type => `${type}`) + .join(" | ")};\n`; +} +code += "\n"; + +code += "export interface Aliases {\n"; +for (const type in t.FLIPPED_ALIAS_KEYS) { + code += ` ${type}: ${type};\n`; +} +code += "}\n\n"; + +code += lines.join("\n") + "\n"; + +// + +process.stdout.write(code); + +// + +function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { + const index = fieldNames.indexOf(fieldName); + return fieldNames.slice(index).every(_ => isNullable(fields[_])); +} + +function hasDefault(field) { + return field.default != null; +} + +function isNullable(field) { + return field.optional || hasDefault(field); +} + +function sortFieldNames(fields, type) { + return fields.sort((fieldA, fieldB) => { + const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); + const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); + if (indexA === indexB) return fieldA < fieldB ? -1 : 1; + if (indexA === -1) return 1; + if (indexB === -1) return -1; + return indexA - indexB; + }); +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatCode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatCode.js index 9d279e6e49ec41..1ed327bd82bf77 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatCode.js +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatCode.js @@ -4,6 +4,8 @@ const prettier = require("prettier"); module.exports = function formatCode(code, filename) { filename = filename || __filename; const prettierConfig = prettier.resolveConfig.sync(filename); + prettierConfig.filepath = filename; + prettierConfig.parser = "babylon"; return prettier.format(code, prettierConfig); }; 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 new file mode 100644 index 00000000000000..ff33e8e25ade29 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js @@ -0,0 +1,43 @@ +module.exports = function stringifyValidator(validator, nodePrefix) { + if (validator === undefined) { + return "any"; + } + + if (validator.each) { + return `Array<${stringifyValidator(validator.each, nodePrefix)}>`; + } + + if (validator.chainOf) { + return stringifyValidator(validator.chainOf[1], nodePrefix); + } + + if (validator.oneOf) { + return validator.oneOf.map(JSON.stringify).join(" | "); + } + + if (validator.oneOfNodeTypes) { + return validator.oneOfNodeTypes.map(_ => nodePrefix + _).join(" | "); + } + + if (validator.oneOfNodeOrValueTypes) { + return validator.oneOfNodeOrValueTypes + .map(_ => { + return isValueType(_) ? _ : nodePrefix + _; + }) + .join(" | "); + } + + if (validator.type) { + return validator.type; + } + + return ["any"]; +}; + +/** + * Heuristic to decide whether or not the given type is a value type (eg. "null") + * or a Node type (eg. "Expression"). + */ +function isValueType(type) { + return type.charAt(0).toLowerCase() === type.charAt(0); +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/toFunctionName.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/toFunctionName.js new file mode 100644 index 00000000000000..627c9a7d8f0156 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/toFunctionName.js @@ -0,0 +1,4 @@ +module.exports = function toFunctionName(typeName) { + const _ = typeName.replace(/^TS/, "ts").replace(/^JSX/, "jsx"); + return _.slice(0, 1).toLowerCase() + _.slice(1); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js b/tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js index 3d3baa66d75d1c..90a871c4d78f6f 100644 --- a/tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js +++ b/tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js @@ -102,30 +102,43 @@ function assembleStyles() { }); } + const ansi2ansi = n => n; const rgb2rgb = (r, g, b) => [r, g, b]; styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; - styles.color.ansi = {}; - styles.color.ansi256 = {}; + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; styles.color.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 0) }; - styles.bgColor.ansi = {}; - styles.bgColor.ansi256 = {}; + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; styles.bgColor.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 10) }; - for (const key of Object.keys(colorConvert)) { + for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== 'object') { continue; } const suite = colorConvert[key]; + if (key === 'ansi16') { + key = 'ansi'; + } + if ('ansi16' in suite) { styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json b/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json index 6e9e19423b4668..5663ace24b4607 100644 --- a/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json +++ b/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json @@ -1,27 +1,4 @@ { - "_from": "ansi-styles@^3.1.0", - "_id": "ansi-styles@3.2.0", - "_inBundle": false, - "_integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "_location": "/babel-eslint/ansi-styles", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-styles@^3.1.0", - "name": "ansi-styles", - "escapedName": "ansi-styles", - "rawSpec": "^3.1.0", - "saveSpec": null, - "fetchSpec": "^3.1.0" - }, - "_requiredBy": [ - "/babel-eslint/chalk" - ], - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "_shasum": "c159b8d5be0f9e5a6f346dab94f16ce022161b88", - "_spec": "ansi-styles@^3.1.0", - "_where": "/home/mzasso/git/nodejs/node/tools/babel-eslint-tmp/node_modules/babel-eslint/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -42,6 +19,7 @@ "devDependencies": { "ava": "*", "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", "xo": "*" }, "engines": { @@ -80,7 +58,8 @@ "url": "git+https://github.com/chalk/ansi-styles.git" }, "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", "test": "xo && ava" }, - "version": "3.2.0" -} + "version": "3.2.1" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md b/tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md index dce368742b42af..3158e2df59ce66 100644 --- a/tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md @@ -4,7 +4,7 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. -![](screenshot.png) + ## Install diff --git a/tools/node_modules/babel-eslint/node_modules/babylon/README.md b/tools/node_modules/babel-eslint/node_modules/babylon/README.md deleted file mode 100644 index 78dd00be332591..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/babylon/README.md +++ /dev/null @@ -1,163 +0,0 @@ -

- babylon -

- -

- Babylon is a JavaScript parser used in Babel. -

- - - The latest ECMAScript version enabled by default (ES2017). - - Comment attachment. - - Support for JSX, Flow, Typescript. - - Support for experimental language proposals (accepting PRs for anything at least [stage-0](https://github.com/tc39/proposals/blob/master/stage-0-proposals.md)). - -## Credits - -Heavily based on [acorn](https://github.com/marijnh/acorn) and [acorn-jsx](https://github.com/RReverser/acorn-jsx), -thanks to the awesome work of [@RReverser](https://github.com/RReverser) and [@marijnh](https://github.com/marijnh). - -## API - -### `babylon.parse(code, [options])` - -### `babylon.parseExpression(code, [options])` - -`parse()` parses the provided `code` as an entire ECMAScript program, while -`parseExpression()` tries to parse a single Expression with performance in -mind. When in doubt, use `.parse()`. - -### Options - -- **allowImportExportEverywhere**: By default, `import` and `export` - declarations can only appear at a program's top level. Setting this - option to `true` allows them anywhere where a statement is allowed. - -- **allowReturnOutsideFunction**: By default, a return statement at - the top level raises an error. Set this to `true` to accept such - code. - -- **allowSuperOutsideMethod**: TODO - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - one of `"script"`, `"module"`, or `"unambiguous"`. Defaults to `"script"`. `"unambiguous"` will make Babylon attempt to _guess_, based on the presence of ES6 `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`. - -- **sourceFilename**: Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files. - -- **startLine**: By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools. - -- **plugins**: Array containing the plugins that you want to enable. - -- **strictMode**: TODO - -- **ranges**: Adds a `ranges` property to each node: `[node.start, node.end]` - -- **tokens**: Adds all parsed tokens to a `tokens` property on the `File` node - -### Output - -Babylon generates AST according to [Babel AST format][]. -It is based on [ESTree spec][] with the following deviations: - -> There is now an `estree` plugin which reverts these deviations - -- [Literal][] token is replaced with [StringLiteral][], [NumericLiteral][], [BooleanLiteral][], [NullLiteral][], [RegExpLiteral][] -- [Property][] token is replaced with [ObjectProperty][] and [ObjectMethod][] -- [MethodDefinition][] is replaced with [ClassMethod][] -- [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][] -- [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node. - -AST for JSX code is based on [Facebook JSX AST][] with the addition of one node type: - -- `JSXText` - -[Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md -[ESTree spec]: https://github.com/estree/estree - -[Literal]: https://github.com/estree/estree/blob/master/es5.md#literal -[Property]: https://github.com/estree/estree/blob/master/es5.md#property -[MethodDefinition]: https://github.com/estree/estree/blob/master/es2015.md#methoddefinition - -[StringLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#stringliteral -[NumericLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#numericliteral -[BooleanLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#booleanliteral -[NullLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#nullliteral -[RegExpLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#regexpliteral -[ObjectProperty]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectproperty -[ObjectMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectmethod -[ClassMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#classmethod -[Program]: https://github.com/babel/babylon/blob/master/ast/spec.md#programs -[BlockStatement]: https://github.com/babel/babylon/blob/master/ast/spec.md#blockstatement -[Directive]: https://github.com/babel/babylon/blob/master/ast/spec.md#directive -[DirectiveLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#directiveliteral -[FunctionExpression]: https://github.com/babel/babylon/blob/master/ast/spec.md#functionexpression - -[Facebook JSX AST]: https://github.com/facebook/jsx/blob/master/AST.md - -### Semver - -Babylon follows semver in most situations. The only thing to note is that some spec-compliancy bug fixes may be released under patch versions. - -For example: We push a fix to early error on something like [#107](https://github.com/babel/babylon/pull/107) - multiple default exports per file. That would be considered a bug fix even though it would cause a build to fail. - -### Example - -```javascript -require("babylon").parse("code", { - // parse in strict mode and allow module declarations - sourceType: "module", - - plugins: [ - // enable jsx and flow syntax - "jsx", - "flow" - ] -}); -``` - -### Plugins - -| Name | Code Example | -|------|--------------| -| `estree` ([repo](https://github.com/estree/estree)) | n/a | -| `jsx` ([repo](https://facebook.github.io/jsx/)) | `{s}` | -| `flow` ([repo](https://github.com/facebook/flow)) | `var a: string = "";` | -| `typescript` ([repo](https://github.com/Microsoft/TypeScript)) | `var a: string = "";` | -| `doExpressions` | `var a = do { if (true) { 'hi'; } };` | -| `objectRestSpread` ([proposal](https://github.com/tc39/proposal-object-rest-spread)) | `var a = { b, ...c };` | -| `decorators` (Stage 1) and `decorators2` (Stage 2 [proposal](https://github.com/tc39/proposal-decorators)) | `@a class A {}` | -| `classProperties` ([proposal](https://github.com/tc39/proposal-class-public-fields)) | `class A { b = 1; }` | -| `classPrivateProperties` ([proposal](https://github.com/tc39/proposal-private-fields)) | `class A { #b = 1; }` | -| `classPrivateMethods` ([proposal](https://github.com/tc39/proposal-private-methods)) | `class A { #c() {} }` | -| `exportExtensions` ([proposal 1](https://github.com/leebyron/ecmascript-export-default-from)), ([proposal 2](https://github.com/leebyron/ecmascript-export-ns-from)) | Proposal 1: `export v from "mod"` Proposal 2: `export * as ns from "mod"` | -| `asyncGenerators` ([proposal](https://github.com/tc39/proposal-async-iteration)) | `async function*() {}`, `for await (let a of b) {}` | -| `functionBind` ([proposal](https://github.com/zenparsing/es-function-bind)) | `a::b`, `::console.log` | -| `functionSent` | `function.sent` | -| `dynamicImport` ([proposal](https://github.com/tc39/proposal-dynamic-import)) | `import('./guy').then(a)` | -| `numericSeparator` ([proposal](https://github.com/samuelgoto/proposal-numeric-separator)) | `1_000_000` | -| `optionalChaining` ([proposal](https://github.com/tc39/proposal-optional-chaining)) | `a?.b` | -| `importMeta` ([proposal](https://github.com/tc39/proposal-import-meta)) | `import.meta.url` | -| `bigInt` ([proposal](https://github.com/tc39/proposal-bigint)) | `100n` | -| `optionalCatchBinding` ([proposal](https://github.com/babel/proposals/issues/7)) | `try {throw 0;} catch{do();}` | -| `throwExpressions` ([proposal](https://github.com/babel/proposals/issues/23)) | `() => throw new Error("")` | -| `pipelineOperator` ([proposal](https://github.com/babel/proposals/issues/29)) | `a \|> b` | -| `nullishCoalescingOperator` ([proposal](https://github.com/babel/proposals/issues/14)) | `a ?? b` | - -### FAQ - -#### Will Babylon support a plugin system? - -Previous issues: [babel/babel#1351](https://github.com/babel/babel/issues/1351), [#500](https://github.com/babel/babylon/issues/500). - -We currently aren't willing to commit to supporting the API for plugins or the resulting ecosystem (there is already enough work maintaining Babel's own plugin system). It's not clear how to make that API effective, and it would limit out ability to refactor and optimize the codebase. - -Our current recommendation for those that want to create their own custom syntax is for users to fork Babylon. - -To consume your custom parser, you can add to your `.babelrc` via its npm package name or require it if using JavaScript, - -```json -{ - "parserOpts": { - "parser": "custom-fork-of-babylon-on-npm-here" - } -} -``` diff --git a/tools/node_modules/babel-eslint/node_modules/babylon/lib/index.js b/tools/node_modules/babel-eslint/node_modules/babylon/lib/index.js deleted file mode 100644 index 901202fd4d02b9..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/babylon/lib/index.js +++ /dev/null @@ -1,10635 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -// A second optional argument can be given to further configure -// the parser process. These options are recognized: -var defaultOptions = { - // Source type ("script" or "module") for different semantics - sourceType: "script", - // Source filename. - sourceFilename: undefined, - // Line from which to start counting source. Useful for - // integration with other tools. - startLine: 1, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program. - allowImportExportEverywhere: false, - // TODO - allowSuperOutsideMethod: false, - // An array of plugins to enable - plugins: [], - // TODO - strictMode: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // Adds all parsed tokens to a `tokens` property on the `File` node - tokens: false -}; // Interpret and default an options object - -function getOptions(opts) { - var options = {}; - - for (var key in defaultOptions) { - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - - return options; -} - -// ## Token types -// The assignment of fine-grained, information-carrying type objects -// allows the tokenizer to store the information it has about a -// token in a way that is very cheap for the parser to look up. -// All token type variables start with an underscore, to make them -// easy to recognize. -// The `beforeExpr` property is used to disambiguate between regular -// expressions and divisions. It is set on all token types that can -// be followed by an expression (thus, a slash after them would be a -// regular expression). -// -// `isLoop` marks a keyword as starting a loop, which is important -// to know when parsing a label, in order to allow or disallow -// continue jumps to that label. -var beforeExpr = true; -var startsExpr = true; -var isLoop = true; -var isAssign = true; -var prefix = true; -var postfix = true; -var TokenType = function TokenType(label, conf) { - if (conf === void 0) { - conf = {}; - } - - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop === 0 ? 0 : conf.binop || null; - this.updateContext = null; -}; - -var KeywordTokenType = -/*#__PURE__*/ -function (_TokenType) { - _inheritsLoose(KeywordTokenType, _TokenType); - - function KeywordTokenType(name, options) { - if (options === void 0) { - options = {}; - } - - options.keyword = name; - return _TokenType.call(this, name, options) || this; - } - - return KeywordTokenType; -}(TokenType); - -var BinopTokenType = -/*#__PURE__*/ -function (_TokenType2) { - _inheritsLoose(BinopTokenType, _TokenType2); - - function BinopTokenType(name, prec) { - return _TokenType2.call(this, name, { - beforeExpr, - binop: prec - }) || this; - } - - return BinopTokenType; -}(TokenType); -var types = { - num: new TokenType("num", { - startsExpr - }), - bigint: new TokenType("bigint", { - startsExpr - }), - regexp: new TokenType("regexp", { - startsExpr - }), - string: new TokenType("string", { - startsExpr - }), - name: new TokenType("name", { - startsExpr - }), - eof: new TokenType("eof"), - // Punctuation token types. - bracketL: new TokenType("[", { - beforeExpr, - startsExpr - }), - bracketR: new TokenType("]"), - braceL: new TokenType("{", { - beforeExpr, - startsExpr - }), - braceBarL: new TokenType("{|", { - beforeExpr, - startsExpr - }), - braceR: new TokenType("}"), - braceBarR: new TokenType("|}"), - parenL: new TokenType("(", { - beforeExpr, - startsExpr - }), - parenR: new TokenType(")"), - comma: new TokenType(",", { - beforeExpr - }), - semi: new TokenType(";", { - beforeExpr - }), - colon: new TokenType(":", { - beforeExpr - }), - doubleColon: new TokenType("::", { - beforeExpr - }), - dot: new TokenType("."), - question: new TokenType("?", { - beforeExpr - }), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", { - beforeExpr - }), - template: new TokenType("template"), - ellipsis: new TokenType("...", { - beforeExpr - }), - backQuote: new TokenType("`", { - startsExpr - }), - dollarBraceL: new TokenType("${", { - beforeExpr, - startsExpr - }), - at: new TokenType("@"), - hash: new TokenType("#"), - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - eq: new TokenType("=", { - beforeExpr, - isAssign - }), - assign: new TokenType("_=", { - beforeExpr, - isAssign - }), - incDec: new TokenType("++/--", { - prefix, - postfix, - startsExpr - }), - bang: new TokenType("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: new TokenType("~", { - beforeExpr, - prefix, - startsExpr - }), - pipeline: new BinopTokenType("|>", 0), - nullishCoalescing: new BinopTokenType("??", 1), - logicalOR: new BinopTokenType("||", 1), - logicalAND: new BinopTokenType("&&", 2), - bitwiseOR: new BinopTokenType("|", 3), - bitwiseXOR: new BinopTokenType("^", 4), - bitwiseAND: new BinopTokenType("&", 5), - equality: new BinopTokenType("==/!=", 6), - relational: new BinopTokenType("", 7), - bitShift: new BinopTokenType("<>", 8), - plusMin: new TokenType("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: new BinopTokenType("%", 10), - star: new BinopTokenType("*", 10), - slash: new BinopTokenType("/", 10), - exponent: new TokenType("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }) -}; -var keywords = { - break: new KeywordTokenType("break"), - case: new KeywordTokenType("case", { - beforeExpr - }), - catch: new KeywordTokenType("catch"), - continue: new KeywordTokenType("continue"), - debugger: new KeywordTokenType("debugger"), - default: new KeywordTokenType("default", { - beforeExpr - }), - do: new KeywordTokenType("do", { - isLoop, - beforeExpr - }), - else: new KeywordTokenType("else", { - beforeExpr - }), - finally: new KeywordTokenType("finally"), - for: new KeywordTokenType("for", { - isLoop - }), - function: new KeywordTokenType("function", { - startsExpr - }), - if: new KeywordTokenType("if"), - return: new KeywordTokenType("return", { - beforeExpr - }), - switch: new KeywordTokenType("switch"), - throw: new KeywordTokenType("throw", { - beforeExpr, - prefix, - startsExpr - }), - try: new KeywordTokenType("try"), - var: new KeywordTokenType("var"), - let: new KeywordTokenType("let"), - const: new KeywordTokenType("const"), - while: new KeywordTokenType("while", { - isLoop - }), - with: new KeywordTokenType("with"), - new: new KeywordTokenType("new", { - beforeExpr, - startsExpr - }), - this: new KeywordTokenType("this", { - startsExpr - }), - super: new KeywordTokenType("super", { - startsExpr - }), - class: new KeywordTokenType("class"), - extends: new KeywordTokenType("extends", { - beforeExpr - }), - export: new KeywordTokenType("export"), - import: new KeywordTokenType("import", { - startsExpr - }), - yield: new KeywordTokenType("yield", { - beforeExpr, - startsExpr - }), - null: new KeywordTokenType("null", { - startsExpr - }), - true: new KeywordTokenType("true", { - startsExpr - }), - false: new KeywordTokenType("false", { - startsExpr - }), - in: new KeywordTokenType("in", { - beforeExpr, - binop: 7 - }), - instanceof: new KeywordTokenType("instanceof", { - beforeExpr, - binop: 7 - }), - typeof: new KeywordTokenType("typeof", { - beforeExpr, - prefix, - startsExpr - }), - void: new KeywordTokenType("void", { - beforeExpr, - prefix, - startsExpr - }), - delete: new KeywordTokenType("delete", { - beforeExpr, - prefix, - startsExpr - }) -}; // Map keyword names to token types. - -Object.keys(keywords).forEach(function (name) { - types["_" + name] = keywords[name]; -}); - -/* eslint max-len: 0 */ -function makePredicate(words) { - var wordsArr = words.split(" "); - return function (str) { - return wordsArr.indexOf(str) >= 0; - }; -} // Reserved word lists for various dialects of the language - - -var reservedWords = { - "6": makePredicate("enum await"), - strict: makePredicate("implements interface let package private protected public static yield"), - strictBind: makePredicate("eval arguments") -}; // And the keywords - -var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"); // ## Character categories -// Big ugly regular expressions that match characters in the -// whitespace, identifier, and identifier-start categories. These -// are only applied when a character is found to actually have a -// code point above 128. -// Generated by `bin/generate-identifier-regex.js`. - -/* prettier-ignore */ - -var nonASCIIidentifierStartChars = "\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\u0860-\u086a\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\u09fc\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-\u312e\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fea\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"; -/* prettier-ignore */ - -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the -// >0xffff code points that are a valid part of identifiers. The -// offset starts at 0x10000, and each pair of numbers represents an -// offset to the next range, and then a size of the range. They were -// generated by `bin/generate-identifier-regex.js`. - -/* prettier-ignore */ - -var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 257, 0, 11, 39, 8, 0, 22, 0, 12, 39, 3, 3, 55, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 698, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 1, 31, 6124, 20, 754, 9486, 286, 82, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 60, 67, 1213, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541]; -/* prettier-ignore */ - -var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 280, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 19719, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 2214, 6, 110, 6, 6, 9, 792487, 239]; // This has a complexity linear to the value of the code. The -// assumption is that looking up astral identifier characters is -// rare. - -function isInAstralSet(code, set) { - var pos = 0x10000; - - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} // Test whether a given character code starts an identifier. - - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} // Test whether a given character is part of an identifier. - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -// Matches a whole line break (where CRLF is considered a single -// line break). Used to count lines. -var lineBreak = /\r\n?|\n|\u2028|\u2029/; -var lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; -} -var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - -// The algorithm used to determine whether a regexp can appear at a -// given point in the program is loosely based on sweet.js' approach. -// See https://github.com/mozilla/sweet.js/wiki/design -var TokContext = function TokContext(token, isExpr, preserveSpace, override) // Takes a Tokenizer as a this-parameter, and returns void. -{ - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; -}; -var types$1 = { - braceStatement: new TokContext("{", false), - braceExpression: new TokContext("{", true), - templateQuasi: new TokContext("${", true), - parenStatement: new TokContext("(", false), - parenExpression: new TokContext("(", true), - template: new TokContext("`", true, true, function (p) { - return p.readTmplToken(); - }), - functionExpression: new TokContext("function", true) -}; // Token-specific context update code - -types.parenR.updateContext = types.braceR.updateContext = function () { - if (this.state.context.length === 1) { - this.state.exprAllowed = true; - return; - } - - var out = this.state.context.pop(); - - if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) { - this.state.context.pop(); - this.state.exprAllowed = false; - } else if (out === types$1.templateQuasi) { - this.state.exprAllowed = true; - } else { - this.state.exprAllowed = !out.isExpr; - } -}; - -types.name.updateContext = function (prevType) { - if (this.state.value === "of" && this.curContext() === types$1.parenStatement) { - this.state.exprAllowed = !prevType.beforeExpr; - return; - } - - this.state.exprAllowed = false; - - if (prevType === types._let || prevType === types._const || prevType === types._var) { - if (lineBreak.test(this.input.slice(this.state.end))) { - this.state.exprAllowed = true; - } - } -}; - -types.braceL.updateContext = function (prevType) { - this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); - this.state.exprAllowed = true; -}; - -types.dollarBraceL.updateContext = function () { - this.state.context.push(types$1.templateQuasi); - this.state.exprAllowed = true; -}; - -types.parenL.updateContext = function (prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); - this.state.exprAllowed = true; -}; - -types.incDec.updateContext = function () {// tokExprAllowed stays unchanged -}; - -types._function.updateContext = function () { - if (this.curContext() !== types$1.braceStatement) { - this.state.context.push(types$1.functionExpression); - } - - this.state.exprAllowed = false; -}; - -types.backQuote.updateContext = function () { - if (this.curContext() === types$1.template) { - this.state.context.pop(); - } else { - this.state.context.push(types$1.template); - } - - this.state.exprAllowed = false; -}; - -// These are used when `options.locations` is on, for the -// `startLoc` and `endLoc` properties. -var Position = function Position(line, col) { - this.line = line; - this.column = col; -}; -var SourceLocation = function SourceLocation(start, end) { - this.start = start; // $FlowIgnore (may start as null, but initialized later) - - this.end = end; -}; // The `getLineInfo` function is mostly useful when the -// `locations` option is off (for performance reasons) and you -// want to find the line/column position for a given character -// offset. `input` should be the code string that the offset refers -// into. - -function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur); - } - } // istanbul ignore next - - - throw new Error("Unreachable"); -} - -var BaseParser = -/*#__PURE__*/ -function () { - function BaseParser() {} - - var _proto = BaseParser.prototype; - - // Properties set by constructor in index.js - // Initialized by Tokenizer - _proto.isReservedWord = function isReservedWord(word) { - if (word === "await") { - return this.inModule; - } else { - return reservedWords[6](word); - } - }; - - _proto.hasPlugin = function hasPlugin(name) { - return !!this.plugins[name]; - }; - - return BaseParser; -}(); - -/* eslint max-len: 0 */ - -/** - * Based on the comment attachment algorithm used in espree and estraverse. - * - * 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 last(stack) { - return stack[stack.length - 1]; -} - -var CommentsParser = -/*#__PURE__*/ -function (_BaseParser) { - _inheritsLoose(CommentsParser, _BaseParser); - - function CommentsParser() { - return _BaseParser.apply(this, arguments) || this; - } - - var _proto = CommentsParser.prototype; - - _proto.addComment = function addComment(comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.trailingComments.push(comment); - this.state.leadingComments.push(comment); - }; - - _proto.processComment = function processComment(node) { - if (node.type === "Program" && node.body.length > 0) return; - var stack = this.state.commentStack; - var firstChild, lastChild, trailingComments, i, j; - - if (this.state.trailingComments.length > 0) { - // If the first comment in trailingComments comes after the - // current node, then we're good - all comments in the array will - // come after the node and so it's safe to add them as official - // trailingComments. - if (this.state.trailingComments[0].start >= node.end) { - trailingComments = this.state.trailingComments; - this.state.trailingComments = []; - } else { - // Otherwise, if the first comment doesn't come after the - // current node, that means we have a mix of leading and trailing - // comments in the array and that leadingComments contains the - // same items as trailingComments. Reset trailingComments to - // zero items and we'll handle this by evaluating leadingComments - // later. - this.state.trailingComments.length = 0; - } - } else { - if (stack.length > 0) { - var lastInStack = last(stack); - - if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - lastInStack.trailingComments = null; - } - } - } // Eating the stack. - - - if (stack.length > 0 && last(stack).start >= node.start) { - firstChild = stack.pop(); - } - - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); - } - - if (!lastChild && firstChild) lastChild = firstChild; // Attach comments that follow a trailing comma on the last - // property in an object literal or a trailing comma in function arguments - // as trailing comments - - if (firstChild && this.state.leadingComments.length > 0) { - var lastComment = last(this.state.leadingComments); - - if (firstChild.type === "ObjectProperty") { - if (lastComment.start >= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - if (this.state.leadingComments.length > 0) { - firstChild.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } else if (node.type === "CallExpression" && node.arguments && node.arguments.length) { - var lastArg = last(node.arguments); - - if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) { - if (this.state.commentPreviousNode) { - if (this.state.leadingComments.length > 0) { - lastArg.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } - } - - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) { - node.leadingComments = lastChild.leadingComments; - lastChild.leadingComments = null; - } else { - // A leading comment for an anonymous class had been stolen by its first ClassMethod, - // so this takes back the leading comment. - // See also: https://github.com/eslint/espree/issues/158 - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].end <= node.start) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; - } - } - } - } - } else if (this.state.leadingComments.length > 0) { - if (last(this.state.leadingComments).end <= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - } - - if (this.state.leadingComments.length > 0) { - node.leadingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } else { - // https://github.com/eslint/espree/issues/2 - // - // In special cases, such as return (without a value) and - // debugger, all comments will end up as leadingComments and - // will otherwise be eliminated. This step runs when the - // commentStack is empty and there are comments left - // in leadingComments. - // - // This loop figures out the stopping point between the actual - // leading and trailing comments by finding the location of the - // first comment that comes after the given node. - for (i = 0; i < this.state.leadingComments.length; i++) { - if (this.state.leadingComments[i].end > node.start) { - break; - } - } // Split the array based on the location of the first comment - // that comes after the node. Keep in mind that this could - // result in an empty array, and if so, the array must be - // deleted. - - - var leadingComments = this.state.leadingComments.slice(0, i); - node.leadingComments = leadingComments.length === 0 ? null : leadingComments; // Similarly, trailing comments are attached later. The variable - // must be reset to null if there are no trailing comments. - - trailingComments = this.state.leadingComments.slice(i); - - if (trailingComments.length === 0) { - trailingComments = null; - } - } - } - - this.state.commentPreviousNode = node; - - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; - } - } - - stack.push(node); - }; - - return CommentsParser; -}(BaseParser); - -// takes an offset integer (into the current `input`) to indicate -// the location of the error, attaches the position to the end -// of the error message, and then raises a `SyntaxError` with that -// message. - -var LocationParser = -/*#__PURE__*/ -function (_CommentsParser) { - _inheritsLoose(LocationParser, _CommentsParser); - - function LocationParser() { - return _CommentsParser.apply(this, arguments) || this; - } - - var _proto = LocationParser.prototype; - - _proto.raise = function raise(pos, message, missingPluginNames) { - var loc = getLineInfo(this.input, pos); - message += ` (${loc.line}:${loc.column})`; // $FlowIgnore - - var err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - - if (missingPluginNames) { - err.missingPlugin = missingPluginNames; - } - - throw err; - }; - - return LocationParser; -}(CommentsParser); - -var State = -/*#__PURE__*/ -function () { - function State() {} - - var _proto = State.prototype; - - _proto.init = function init(options, input) { - this.strict = options.strictMode === false ? false : options.sourceType === "module"; - this.input = input; - this.potentialArrowAt = -1; - this.noArrowAt = []; - this.noArrowParamsConversionAt = []; // eslint-disable-next-line max-len - - this.inMethod = this.inFunction = this.inParameters = this.maybeInArrowParameters = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false; - this.classLevel = 0; - this.labels = []; - this.decoratorStack = [[]]; - this.yieldInPossibleArrowParameters = null; - this.tokens = []; - this.comments = []; - this.trailingComments = []; - this.leadingComments = []; - this.commentStack = []; // $FlowIgnore - - this.commentPreviousNode = null; - this.pos = this.lineStart = 0; - this.curLine = options.startLine; - this.type = types.eof; - this.value = null; - this.start = this.end = this.pos; - this.startLoc = this.endLoc = this.curPosition(); // $FlowIgnore - - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - this.context = [types$1.braceStatement]; - this.exprAllowed = true; - this.containsEsc = this.containsOctal = false; - this.octalPosition = null; - this.invalidTemplateEscapePosition = null; - this.exportedIdentifiers = []; - }; // TODO - - - _proto.curPosition = function curPosition() { - return new Position(this.curLine, this.pos - this.lineStart); - }; - - _proto.clone = function clone(skipArrays) { - var _this = this; - - var state = new State(); - Object.keys(this).forEach(function (key) { - // $FlowIgnore - var val = _this[key]; - - if ((!skipArrays || key === "context") && Array.isArray(val)) { - val = val.slice(); - } // $FlowIgnore - - - state[key] = val; - }); - return state; - }; - - return State; -}(); - -var _isDigit = function isDigit(code) { - return code >= 48 && code <= 57; -}; - -/* eslint max-len: 0 */ -// an immediate sibling of NumericLiteralSeparator _ - -var forbiddenNumericSeparatorSiblings = { - decBinOct: [46, 66, 69, 79, 95, // multiple separators are not allowed - 98, 101, 111], - hex: [46, 88, 95, // multiple separators are not allowed - 120] -}; -var allowedNumericSeparatorSiblings = {}; -allowedNumericSeparatorSiblings.bin = [// 0 - 1 -48, 49]; -allowedNumericSeparatorSiblings.oct = allowedNumericSeparatorSiblings.bin.concat([50, 51, 52, 53, 54, 55]); -allowedNumericSeparatorSiblings.dec = allowedNumericSeparatorSiblings.oct.concat([56, 57]); -allowedNumericSeparatorSiblings.hex = allowedNumericSeparatorSiblings.dec.concat([65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]); // Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. - -var Token = function Token(state) { - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new SourceLocation(state.startLoc, state.endLoc); -}; // ## Tokenizer - -function codePointToString(code) { - // UTF-16 Decoding - if (code <= 0xffff) { - return String.fromCharCode(code); - } else { - return String.fromCharCode((code - 0x10000 >> 10) + 0xd800, (code - 0x10000 & 1023) + 0xdc00); - } -} - -var Tokenizer = -/*#__PURE__*/ -function (_LocationParser) { - _inheritsLoose(Tokenizer, _LocationParser); - - // Forward-declarations - // parser/util.js - function Tokenizer(options, input) { - var _this; - - _this = _LocationParser.call(this) || this; - _this.state = new State(); - - _this.state.init(options, input); - - _this.isLookahead = false; - return _this; - } // Move to the next token - - - var _proto = Tokenizer.prototype; - - _proto.next = function next() { - if (this.options.tokens && !this.isLookahead) { - this.state.tokens.push(new Token(this.state)); - } - - this.state.lastTokEnd = this.state.end; - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - }; // TODO - - - _proto.eat = function eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - }; // TODO - - - _proto.match = function match(type) { - return this.state.type === type; - }; // TODO - - - _proto.isKeyword = function isKeyword$$1(word) { - return isKeyword(word); - }; // TODO - - - _proto.lookahead = function lookahead() { - var old = this.state; - this.state = old.clone(true); - this.isLookahead = true; - this.next(); - this.isLookahead = false; - var curr = this.state; - this.state = old; - return curr; - }; // Toggle strict mode. Re-reads the next number or string to please - // pedantic tests (`"use strict"; 010;` should fail). - - - _proto.setStrict = function setStrict(strict) { - this.state.strict = strict; - if (!this.match(types.num) && !this.match(types.string)) return; - this.state.pos = this.state.start; - - while (this.state.pos < this.state.lineStart) { - this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; - --this.state.curLine; - } - - this.nextToken(); - }; - - _proto.curContext = function curContext() { - return this.state.context[this.state.context.length - 1]; - }; // Read a single token, updating the parser object's token-related - // properties. - - - _proto.nextToken = function nextToken() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) this.skipSpace(); - this.state.containsOctal = false; - this.state.octalPosition = null; - this.state.start = this.state.pos; - this.state.startLoc = this.state.curPosition(); - - if (this.state.pos >= this.input.length) { - this.finishToken(types.eof); - return; - } - - if (curContext.override) { - curContext.override(this); - } else { - this.readToken(this.fullCharCodeAtPos()); - } - }; - - _proto.readToken = function readToken(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code) || code === 92) { - this.readWord(); - } else { - this.getTokenFromCode(code); - } - }; - - _proto.fullCharCodeAtPos = function fullCharCodeAtPos() { - var code = this.input.charCodeAt(this.state.pos); - if (code <= 0xd7ff || code >= 0xe000) return code; - var next = this.input.charCodeAt(this.state.pos + 1); - return (code << 10) + next - 0x35fdc00; - }; - - _proto.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "CommentBlock" : "CommentLine", - value: text, - start: start, - end: end, - loc: new SourceLocation(startLoc, endLoc) - }; - - if (!this.isLookahead) { - if (this.options.tokens) this.state.tokens.push(comment); - this.state.comments.push(comment); - this.addComment(comment); - } - }; - - _proto.skipBlockComment = function skipBlockComment() { - var startLoc = this.state.curPosition(); - var start = this.state.pos; - var end = this.input.indexOf("*/", this.state.pos += 2); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); - this.state.pos = end + 2; - lineBreakG.lastIndex = start; - var match; - - while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { - ++this.state.curLine; - this.state.lineStart = match.index + match[0].length; - } - - this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); - }; - - _proto.skipLineComment = function skipLineComment(startSkip) { - var start = this.state.pos; - var startLoc = this.state.curPosition(); - var ch = this.input.charCodeAt(this.state.pos += startSkip); - - if (this.state.pos < this.input.length) { - while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.input.length) { - ch = this.input.charCodeAt(this.state.pos); - } - } - - this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); - }; // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. - - - _proto.skipSpace = function skipSpace() { - loop: while (this.state.pos < this.input.length) { - var ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 32: - case 160: - ++this.state.pos; - break; - - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - - case 10: - case 8232: - case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - - case 47: - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - - case 47: - this.skipLineComment(2); - break; - - default: - break loop; - } - - break; - - default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.state.pos; - } else { - break loop; - } - - } - } - }; // Called at the end of every token. Sets `end`, `val`, and - // maintains `context` and `exprAllowed`, and skips the space after - // the token, so that the next one's `start` will point at the - // right position. - - - _proto.finishToken = function finishToken(type, val) { - this.state.end = this.state.pos; - this.state.endLoc = this.state.curPosition(); - var prevType = this.state.type; - this.state.type = type; - this.state.value = val; - this.updateContext(prevType); - }; // ### Token reading - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - - - _proto.readToken_dot = function readToken_dot() { - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next >= 48 && next <= 57) { - this.readNumber(true); - return; - } - - var next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 46 && next2 === 46) { - this.state.pos += 3; - this.finishToken(types.ellipsis); - } else { - ++this.state.pos; - this.finishToken(types.dot); - } - }; - - _proto.readToken_slash = function readToken_slash() { - // '/' - if (this.state.exprAllowed) { - ++this.state.pos; - this.readRegexp(); - return; - } - - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.slash, 1); - } - }; - - _proto.readToken_mult_modulo = function readToken_mult_modulo(code) { - // '%*' - var type = code === 42 ? types.star : types.modulo; - var width = 1; - var next = this.input.charCodeAt(this.state.pos + 1); - var exprAllowed = this.state.exprAllowed; // Exponentiation operator ** - - if (code === 42 && next === 42) { - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = types.exponent; - } - - if (next === 61 && !exprAllowed) { - width++; - type = types.assign; - } - - this.finishOp(type, width); - }; - - _proto.readToken_pipe_amp = function readToken_pipe_amp(code) { - // '|&' - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); - return; - } - - if (code === 124) { - // '|>' - if (next === 62) { - this.finishOp(types.pipeline, 2); - return; - } else if (next === 125 && this.hasPlugin("flow")) { - // '|}' - this.finishOp(types.braceBarR, 2); - return; - } - } - - if (next === 61) { - this.finishOp(types.assign, 2); - return; - } - - this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); - }; - - _proto.readToken_caret = function readToken_caret() { - // '^' - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.bitwiseXOR, 1); - } - }; - - _proto.readToken_plus_min = function readToken_plus_min(code) { - // '+-' - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - this.nextToken(); - return; - } - - this.finishOp(types.incDec, 2); - return; - } - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.plusMin, 1); - } - }; - - _proto.readToken_lt_gt = function readToken_lt_gt(code) { - // '<>' - var next = this.input.charCodeAt(this.state.pos + 1); - var size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(types.assign, size + 1); - return; - } - - this.finishOp(types.bitShift, size); - return; - } - - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - // ` + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. + +* `column`: The column number in the generated source. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. + +* `column`: The column number in the original source, or null if this + information is not available. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +* `column`: The column number in the original source. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +* `column`: Optional. The column number in the original source. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.debug.js b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.debug.js new file mode 100644 index 00000000000000..b5ab6382abbabc --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.debug.js @@ -0,0 +1,3091 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap) + : new BasicSourceMapConsumer(sourceMap); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + if (source != null && sourceRoot != null) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: Optional. the column number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + if (!this._sources.has(needle.source)) { + return []; + } + needle.source = this._sources.indexOf(needle.source); + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The only parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._sources.toArray().map(function (s) { + return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; + }, this); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + if (this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot != null) { + aSource = util.relative(this.sourceRoot, aSource); + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + aSource)) { + return this.sourcesContent[this._sources.indexOf("/" + aSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + if (this.sourceRoot != null) { + source = util.relative(this.sourceRoot, source); + } + if (!this._sources.has(source)) { + return { + line: null, + column: null, + lastColumn: null + }; + } + source = this._sources.indexOf(source); + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The only parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map')) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if (section.consumer.sourceRoot !== null) { + source = util.join(section.consumer.sourceRoot, source); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCBlNDczOGZjNzJhN2IyMzAzOTg4OSIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWNrOi8vLy4vbGliL21hcHBpbmctbGlzdC5qcyIsIndlYnBhY2s6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dW1uOiBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uXG4gICAgICAgIH0pO1xuICAgICAgICBpZiAob3JpZ2luYWwuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgICAvLyBDb3B5IG1hcHBpbmdcbiAgICAgICAgICBtYXBwaW5nLnNvdXJjZSA9IG9yaWdpbmFsLnNvdXJjZTtcbiAgICAgICAgICBpZiAoYVNvdXJjZU1hcFBhdGggIT0gbnVsbCkge1xuICAgICAgICAgICAgbWFwcGluZy5zb3VyY2UgPSB1dGlsLmpvaW4oYVNvdXJjZU1hcFBhdGgsIG1hcHBpbmcuc291cmNlKVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICAgICAgICBtYXBwaW5nLnNvdXJjZSA9IHV0aWwucmVsYXRpdmUoc291cmNlUm9vdCwgbWFwcGluZy5zb3VyY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsTGluZSA9IG9yaWdpbmFsLmxpbmU7XG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbiA9IG9yaWdpbmFsLmNvbHVtbjtcbiAgICAgICAgICBpZiAob3JpZ2luYWwubmFtZSAhPSBudWxsKSB7XG4gICAgICAgICAgICBtYXBwaW5nLm5hbWUgPSBvcmlnaW5hbC5uYW1lO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB2YXIgc291cmNlID0gbWFwcGluZy5zb3VyY2U7XG4gICAgICBpZiAoc291cmNlICE9IG51bGwgJiYgIW5ld1NvdXJjZXMuaGFzKHNvdXJjZSkpIHtcbiAgICAgICAgbmV3U291cmNlcy5hZGQoc291cmNlKTtcbiAgICAgIH1cblxuICAgICAgdmFyIG5hbWUgPSBtYXBwaW5nLm5hbWU7XG4gICAgICBpZiAobmFtZSAhPSBudWxsICYmICFuZXdOYW1lcy5oYXMobmFtZSkpIHtcbiAgICAg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ksXG4gICAgICBvcmlnaW5hbExpbmU6IGxpbmUsXG4gICAgICBvcmlnaW5hbENvbHVtbjogdXRpbC5nZXRBcmcoYUFyZ3MsICdjb2x1bW4nLCAwKVxuICAgIH07XG5cbiAgICBpZiAodGhpcy5zb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgIG5lZWRsZS5zb3VyY2UgPSB1dGlsLnJlbGF0aXZlKHRoaXMuc291cmNlUm9vdCwgbmVlZGxlLnNvdXJjZSk7XG4gICAgfVxuICAgIGlmICghdGhpcy5fc291cmNlcy5oYXMobmVlZGxlLnNvdXJjZSkpIHtcbiAgICAgIHJldHVybiBbXTtcbiAgICB9XG4gICAgbmVlZGxlLnNvdXJjZSA9IHRoaXMuX3NvdXJjZXMuaW5kZXhPZihuZWVkbGUuc291cmNlKTtcblxuICAgIHZhciBtYXBwaW5ncyA9IFtdO1xuXG4gICAgdmFyIGluZGV4ID0gdGhpcy5fZmluZE1hcHBpbmcobmVlZGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29yaWdpbmFsTWFwcGluZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvcmlnaW5hbExpbmVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9yaWdpbmFsQ29sdW1uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRpbC5jb21wYXJlQnlPcmlnaW5hbFBvc2l0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5hcnlTZWFyY2guTEVBU1RfVVBQRVJfQk9VTkQpO1xuICAgIGlmIChpbmRleCA+PSAwKSB7XG4gICAgICB2YXIgbWFwcGluZyA9IHRoaXMuX29yaWdpbmFsTWFwcGluZ3NbaW5kZXhdO1xuXG4gICAgICBpZiAoYUFyZ3MuY29sdW1uID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgdmFyIG9yaWdpbmFsTGluZ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0gZWxzZSB7XG4gICAgICAgICAgc2VnbWVudCA9IFtdO1xuICAgICAgICAgIHdoaWxlIChpbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgYmFzZTY0VkxRLmRlY29kZShhU3RyLCBpbmRleCwgdGVtcCk7XG4gICAgICAgICAgICB2YWx1ZSA9IHRlbXAudmFsdWU7XG4gICAgICAgICAgICBpbmRleCA9IHRlbXAucmVzdDtcbiAgICAgICAgICAgIHNlZ21lbnQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlLCBidXQgbm8gbGluZSBhbmQgY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZvdW5kIGEgc291cmNlIGFuZCBsaW5lLCBidXQgbm8gY29sdW1uJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FjaGVkU2VnbWVudHNbc3RyXSA9IHNlZ21lbnQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZWQgY29sdW1uLlxuICAgICAgICBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbiA9IHByZXZpb3VzR2VuZXJhdGVkQ29sdW1uICsgc2VnbWVudFswXTtcbiAgICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291c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4gICAgICAgICAgaWYgKHRoaXMuc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICAgICAgICBzb3VyY2UgPSB1dGlsLmpvaW4odGhpcy5zb3VyY2VSb290LCBzb3VyY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgbmFtZSA9IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICduYW1lJywgbnVsbCk7XG4gICAgICAgIGlmIChuYW1lICE9PSBudWxsKSB7XG4gICAgICAgICAgbmFtZSA9IHRoaXMuX25hbWVzLmF0KG5hbWUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgc291cmNlOiBzb3VyY2UsXG4gICAgICAgICAgbGluZTogdXRpbC5nZXRBcmcobWFwcGluZywgJ29yaWdpbmFsTGluZScsIG51bGwpLFxuICAgICAgICAgIGNvbHVtbjogdXRpbC5nZXRBcmcobWFwcGluZywgJ29yaWdpbmFsQ29sdW1uJywgbnVsbCksXG4gICAgICAgICAgbmFtZTogbmFtZVxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBzb3VyY2U6IG51bGwsXG4gICAgICBsaW5lOiBudWxsLFxuICAgICAgY29sdW1uOiBudWxsLFxuICAgICAgbmFtZTogbnVsbFxuICAgIH07XG4gIH07XG5cbi8qKlxuICogUmV0dXJuIHRydWUgaWYgd2UgaGF2ZSB0aGUgc291cmNlIGNvbnRlbnQgZm9yIGV2ZXJ5IHNvdXJjZSBpbiB0aGUgc291cmNlXG4gKiBtYXAsIGZhbHNlIG90aGVyd2lzZS5cbiAqL1xuQmFzaWNTb3VyY2VNYXBDb25zdW1lci5wcm90b3R5cGUuaGFzQ29udGVudHNPZkFsbFNvdXJjZXMgPVxuICBmdW5jdGlvbiBCYXNpY1NvdXJjZU1hcENvbnN1bWVyX2hhc0NvbnRlbnRzT2ZBbGxTb3VyY2VzKCkge1xuICAgIGlmICghdGhpcy5zb3VyY2V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AgIGxpbmU6IGdlbmVyYXRlZC5saW5lLFxuICAgICAgICAgIGNvbHVtbjogZ2VuZXJhdGVkLmNvbHVtblxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGxhc3RPcmlnaW5hbFNvdXJjZSA9IG51bGw7XG4gICAgICBzb3VyY2VNYXBwaW5nQWN0aXZlID0gZmFsc2U7XG4gICAgfVxuICAgIGZvciAodmFyIGlkeCA9IDAsIGxlbmd0aCA9IGNodW5rLmxlbmd0aDsgaWR4IDwgbGVuZ3RoOyBpZHgrKykge1xuICAgICAgaWYgKGNodW5rLmNoYXJDb2RlQXQoaWR4KSA9PT0gTkVXTElORV9DT0RFKSB7XG4gICAgICAgIGdlbmVyYXRlZC5saW5lKys7XG4gICAgICAgIGdlbmVyYXRlZC5jb2x1bW4gPSAwO1xuICAgICAgICAvLyBNYXBwaW5ncyBlbmQgYXQgZW9sXG4gICAgICAgIGlmIChpZHggKyAxID09PSBsZW5ndGgpIHtcbiAgICAgICAgICBsYXN0T3JpZ2luYWxTb3VyY2UgPSBudWxsO1xuICAgICAgICAgIHNvdXJjZU1hcHBpbmdBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIGlmIChzb3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgc291cmNlOiBvcmlnaW5hbC5zb3VyY2UsXG4gICAgICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.js b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.js new file mode 100644 index 00000000000000..4e630e29434ca5 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.js @@ -0,0 +1,3090 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap) + : new BasicSourceMapConsumer(sourceMap); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + if (source != null && sourceRoot != null) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: Optional. the column number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + if (!this._sources.has(needle.source)) { + return []; + } + needle.source = this._sources.indexOf(needle.source); + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The only parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._sources.toArray().map(function (s) { + return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; + }, this); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + if (this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot != null) { + aSource = util.relative(this.sourceRoot, aSource); + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + aSource)) { + return this.sourcesContent[this._sources.indexOf("/" + aSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + if (this.sourceRoot != null) { + source = util.relative(this.sourceRoot, source); + } + if (!this._sources.has(source)) { + return { + line: null, + column: null, + lastColumn: null + }; + } + source = this._sources.indexOf(source); + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The only parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map')) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if (section.consumer.sourceRoot !== null) { + source = util.join(section.consumer.sourceRoot, source); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.min.js b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.min.js new file mode 100644 index 00000000000000..f2a46bd02536a3 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.min.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&r.setSourceContent(n,t)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=e.source-n.source;return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:e.name-n.name))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=e.source-n.source,0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:e.name-n.name))))}function f(e,n){return e===n?0:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}n.getArg=r;var m=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(m)},n.relative=a;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?u:l,n.fromSetString=v?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),t=a.getArg(n,"sources"),o=a.getArg(n,"names",[]),i=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),u=a.getArg(n,"mappings"),c=a.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);t=t.map(String).map(a.normalize).map(function(e){return i&&a.isAbsolute(i)&&a.isAbsolute(e)?a.relative(i,e):e}),this._names=l.fromArray(o.map(String),!0),this._sources=l.fromArray(t,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=u,this.file=c}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),o=a.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new l,this._names=new l;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),r=a.getArg(n,"line"),o=a.getArg(n,"column");if(r=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.fromSourceMap=function(e){var n=Object.create(o.prototype),r=n._names=l.fromArray(e._names.toArray(),!0),t=n._sources=l.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=s.length;p1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),S.push(r),"number"==typeof r.originalLine&&A.push(r)}g(S,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,g(A,a.compareByOriginalPositions),this.__originalMappings=A},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=a.join(this.sourceRoot,i)));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=a.urlParse(this.sourceRoot))){var t=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = mappingA.source - mappingB.source;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return mappingA.name - mappingB.name;\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.source - mappingB.source;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return mappingA.name - mappingB.name;\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap)\n\t : new BasicSourceMapConsumer(sourceMap);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t if (source != null && sourceRoot != null) {\n\t source = util.join(sourceRoot, source);\n\t }\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source.\n\t * - column: Optional. the column number in the original source.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null.\n\t * - column: The column number in the generated source, or null.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t if (this.sourceRoot != null) {\n\t needle.source = util.relative(this.sourceRoot, needle.source);\n\t }\n\t if (!this._sources.has(needle.source)) {\n\t return [];\n\t }\n\t needle.source = this._sources.indexOf(needle.source);\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The only parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._sources.toArray().map(function (s) {\n\t return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n\t }, this);\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source.\n\t * - column: The column number in the generated source.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null.\n\t * - column: The column number in the original source, or null.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t if (this.sourceRoot != null) {\n\t source = util.join(this.sourceRoot, source);\n\t }\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t if (this.sourceRoot != null) {\n\t aSource = util.relative(this.sourceRoot, aSource);\n\t }\n\t\n\t if (this._sources.has(aSource)) {\n\t return this.sourcesContent[this._sources.indexOf(aSource)];\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + aSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source.\n\t * - column: The column number in the original source.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null.\n\t * - column: The column number in the generated source, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t if (this.sourceRoot != null) {\n\t source = util.relative(this.sourceRoot, source);\n\t }\n\t if (!this._sources.has(source)) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t source = this._sources.indexOf(source);\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The only parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source.\n\t * - column: The column number in the generated source.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null.\n\t * - column: The column number in the original source, or null.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source.\n\t * - column: The column number in the original source.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null.\n\t * - column: The column number in the generated source, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t if (section.consumer.sourceRoot !== null) {\n\t source = util.join(section.consumer.sourceRoot, source);\n\t }\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex];\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex];\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 42c329f865e32e011afb","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex];\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex];\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/array-set.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/array-set.js new file mode 100644 index 00000000000000..fbd5c81cae66fa --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64-vlq.js new file mode 100644 index 00000000000000..612b404018ece9 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64.js new file mode 100644 index 00000000000000..8aa86b30264363 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/binary-search.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/binary-search.js new file mode 100644 index 00000000000000..010ac941e1568d --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/mapping-list.js new file mode 100644 index 00000000000000..06d1274a025a8a --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/quick-sort.js new file mode 100644 index 00000000000000..6a7caadbbdbea1 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/quick-sort.js @@ -0,0 +1,114 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ +exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-consumer.js new file mode 100644 index 00000000000000..6abcc280eea160 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-consumer.js @@ -0,0 +1,1082 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap) + : new BasicSourceMapConsumer(sourceMap); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + if (source != null && sourceRoot != null) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: Optional. the column number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + if (!this._sources.has(needle.source)) { + return []; + } + needle.source = this._sources.indexOf(needle.source); + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The only parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._sources.toArray().map(function (s) { + return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; + }, this); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + if (this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot != null) { + aSource = util.relative(this.sourceRoot, aSource); + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + aSource)) { + return this.sourcesContent[this._sources.indexOf("/" + aSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + if (this.sourceRoot != null) { + source = util.relative(this.sourceRoot, source); + } + if (!this._sources.has(source)) { + return { + line: null, + column: null, + lastColumn: null + }; + } + source = this._sources.indexOf(source); + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The only parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map')) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if (section.consumer.sourceRoot !== null) { + source = util.join(section.consumer.sourceRoot, source); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-generator.js new file mode 100644 index 00000000000000..aff1e7fb268acc --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-generator.js @@ -0,0 +1,416 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-node.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-node.js new file mode 100644 index 00000000000000..d196a53f8c0eda --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/util.js b/tools/node_modules/babel-eslint/node_modules/source-map/lib/util.js new file mode 100644 index 00000000000000..44e0e45205233e --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/lib/util.js @@ -0,0 +1,417 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +} +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/package.json b/tools/node_modules/babel-eslint/node_modules/source-map/package.json new file mode 100644 index 00000000000000..9e2674cec8bd3c --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/package.json @@ -0,0 +1,188 @@ +{ + "author": { + "name": "Nick Fitzgerald", + "email": "nfitzgerald@mozilla.com" + }, + "bugs": { + "url": "https://github.com/mozilla/source-map/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Tobias Koppers", + "email": "tobias.koppers@googlemail.com" + }, + { + "name": "Duncan Beevers", + "email": "duncan@dweebd.com" + }, + { + "name": "Stephen Crane", + "email": "scrane@mozilla.com" + }, + { + "name": "Ryan Seddon", + "email": "seddon.ryan@gmail.com" + }, + { + "name": "Miles Elam", + "email": "miles.elam@deem.com" + }, + { + "name": "Mihai Bazon", + "email": "mihai.bazon@gmail.com" + }, + { + "name": "Michael Ficarra", + "email": "github.public.email@michael.ficarra.me" + }, + { + "name": "Todd Wolfson", + "email": "todd@twolfson.com" + }, + { + "name": "Alexander Solovyov", + "email": "alexander@solovyov.net" + }, + { + "name": "Felix Gnass", + "email": "fgnass@gmail.com" + }, + { + "name": "Conrad Irwin", + "email": "conrad.irwin@gmail.com" + }, + { + "name": "usrbincc", + "email": "usrbincc@yahoo.com" + }, + { + "name": "David Glasser", + "email": "glasser@davidglasser.net" + }, + { + "name": "Chase Douglas", + "email": "chase@newrelic.com" + }, + { + "name": "Evan Wallace", + "email": "evan.exe@gmail.com" + }, + { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com" + }, + { + "name": "David Glasser", + "email": "glasser@davidglasser.net" + }, + { + "name": "Simon Lydell", + "email": "simon.lydell@gmail.com" + }, + { + "name": "Jmeas Smith", + "email": "jellyes2@gmail.com" + }, + { + "name": "Michael Z Goddard", + "email": "mzgoddard@gmail.com" + }, + { + "name": "azu", + "email": "azu@users.noreply.github.com" + }, + { + "name": "John Gozde", + "email": "john@gozde.ca" + }, + { + "name": "Adam Kirkton", + "email": "akirkton@truefitinnovation.com" + }, + { + "name": "Chris Montgomery", + "email": "christopher.montgomery@dowjones.com" + }, + { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com" + }, + { + "name": "Jack Herrington", + "email": "jherrington@walmartlabs.com" + }, + { + "name": "Chris Truter", + "email": "jeffpalentine@gmail.com" + }, + { + "name": "Daniel Espeset", + "email": "daniel@danielespeset.com" + }, + { + "name": "Jamie Wong", + "email": "jamie.lf.wong@gmail.com" + }, + { + "name": "Eddy Bruël", + "email": "ejpbruel@mozilla.com" + }, + { + "name": "Hawken Rives", + "email": "hawkrives@gmail.com" + }, + { + "name": "Gilad Peleg", + "email": "giladp007@gmail.com" + }, + { + "name": "djchie", + "email": "djchie.dev@gmail.com" + }, + { + "name": "Gary Ye", + "email": "garysye@gmail.com" + }, + { + "name": "Nicolas Lalevée", + "email": "nicolas.lalevee@hibnet.org" + } + ], + "deprecated": false, + "description": "Generates and consumes source maps", + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "source-map.js", + "lib/", + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" + ], + "homepage": "https://github.com/mozilla/source-map", + "license": "BSD-3-Clause", + "main": "./source-map.js", + "name": "source-map", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/mozilla/source-map.git" + }, + "scripts": { + "build": "webpack --color", + "test": "npm run build && node test/run-tests.js", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "typings": "source-map", + "version": "0.5.7" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/source-map.js b/tools/node_modules/babel-eslint/node_modules/source-map/source-map.js new file mode 100644 index 00000000000000..bc88fe820c87a2 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/source-map/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/browser.js b/tools/node_modules/babel-eslint/node_modules/supports-color/browser.js index ae7c87b17cc486..62afa3a7425dc6 100644 --- a/tools/node_modules/babel-eslint/node_modules/supports-color/browser.js +++ b/tools/node_modules/babel-eslint/node_modules/supports-color/browser.js @@ -1,2 +1,5 @@ 'use strict'; -module.exports = false; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/index.js b/tools/node_modules/babel-eslint/node_modules/supports-color/index.js index 20a29230e8fd63..1704131bdf6c8f 100644 --- a/tools/node_modules/babel-eslint/node_modules/supports-color/index.js +++ b/tools/node_modules/babel-eslint/node_modules/supports-color/index.js @@ -4,7 +4,22 @@ const hasFlag = require('has-flag'); const env = process.env; -const support = level => { +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { if (level === 0) { return false; } @@ -15,12 +30,10 @@ const support = level => { has256: level >= 2, has16m: level >= 3 }; -}; +} -let supportLevel = (() => { - if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { +function supportsColor(stream) { + if (forceColor === false) { return 0; } @@ -34,30 +47,26 @@ let supportLevel = (() => { return 2; } - if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - return 1; - } - - if (process.stdout && !process.stdout.isTTY) { + if (stream && !stream.isTTY && forceColor !== true) { return 0; } + const min = forceColor ? 1 : 0; + if (process.platform === 'win32') { // Node.js 7.5.0 is the first version of Node.js to include a patch to // libuv that enables 256 color output on Windows. Anything earlier and it // won't work. However, here we target Node.js 8 at minimum as it is an LTS // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { - return 2; + return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; @@ -68,21 +77,23 @@ let supportLevel = (() => { return 1; } - return 0; + return min; } if ('TEAMCITY_VERSION' in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } + if (env.COLORTERM === 'truecolor') { + return 3; + } + if ('TERM_PROGRAM' in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); switch (env.TERM_PROGRAM) { case 'iTerm.app': return version >= 3 ? 3 : 2; - case 'Hyper': - return 3; case 'Apple_Terminal': return 2; // No default @@ -93,7 +104,7 @@ let supportLevel = (() => { return 2; } - if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } @@ -102,14 +113,19 @@ let supportLevel = (() => { } if (env.TERM === 'dumb') { - return 0; + return min; } - return 0; -})(); + return min; +} -if ('FORCE_COLOR' in env) { - supportLevel = parseInt(env.FORCE_COLOR, 10) === 0 ? 0 : (supportLevel || 1); +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); } -module.exports = process && support(supportLevel); +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/package.json b/tools/node_modules/babel-eslint/node_modules/supports-color/package.json index f6daea6ce9d83c..9e4eafa8573232 100644 --- a/tools/node_modules/babel-eslint/node_modules/supports-color/package.json +++ b/tools/node_modules/babel-eslint/node_modules/supports-color/package.json @@ -1,27 +1,4 @@ { - "_from": "supports-color@^4.0.0", - "_id": "supports-color@4.5.0", - "_inBundle": false, - "_integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "_location": "/babel-eslint/supports-color", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "supports-color@^4.0.0", - "name": "supports-color", - "escapedName": "supports-color", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/babel-eslint/chalk" - ], - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "_shasum": "be7a0de484dec5c5cddf8b3d59125044912f635b", - "_spec": "supports-color@^4.0.0", - "_where": "/home/mzasso/git/nodejs/node/tools/babel-eslint-tmp/node_modules/babel-eslint/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -33,14 +10,14 @@ }, "bundleDependencies": false, "dependencies": { - "has-flag": "^2.0.0" + "has-flag": "^3.0.0" }, "deprecated": false, "description": "Detect whether a terminal supports color", "devDependencies": { - "ava": "*", + "ava": "^0.25.0", "import-fresh": "^2.0.0", - "xo": "*" + "xo": "^0.20.0" }, "engines": { "node": ">=4" @@ -81,5 +58,5 @@ "scripts": { "test": "xo && ava" }, - "version": "4.5.0" -} + "version": "5.5.0" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/readme.md b/tools/node_modules/babel-eslint/node_modules/supports-color/readme.md index 3bef57db0ecf3f..f6e40195730ae8 100644 --- a/tools/node_modules/babel-eslint/node_modules/supports-color/readme.md +++ b/tools/node_modules/babel-eslint/node_modules/supports-color/readme.md @@ -15,25 +15,25 @@ $ npm install supports-color ```js const supportsColor = require('supports-color'); -if (supportsColor) { - console.log('Terminal supports color'); +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); } -if (supportsColor.has256) { - console.log('Terminal supports 256 colors'); +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); } -if (supportsColor.has16m) { - console.log('Terminal supports 16 million colors (truecolor)'); +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); } ``` ## API -Returns an `Object`, or `false` if color is not supported. +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. -The returned object specifies a level of support for color through a `.level` property and a corresponding flag: +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) - `.level = 2` and `.has256 = true`: 256 color support diff --git a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json b/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json index f1afc91ae7f7e9..2c80c243891203 100644 --- a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json +++ b/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json @@ -1,27 +1,4 @@ { - "_from": "to-fast-properties@^2.0.0", - "_id": "to-fast-properties@2.0.0", - "_inBundle": false, - "_integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "_location": "/babel-eslint/to-fast-properties", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "to-fast-properties@^2.0.0", - "name": "to-fast-properties", - "escapedName": "to-fast-properties", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/babel-eslint/@babel/types" - ], - "_resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "_shasum": "dc5e698cbd079265bc73e0377681a4e4e83f616e", - "_spec": "to-fast-properties@^2.0.0", - "_where": "/home/mzasso/git/nodejs/node/tools/babel-eslint-tmp/node_modules/babel-eslint/node_modules/@babel/types", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -64,4 +41,4 @@ "test": "node --allow-natives-syntax test.js" }, "version": "2.0.0" -} +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/index.js b/tools/node_modules/babel-eslint/node_modules/trim-right/index.js new file mode 100644 index 00000000000000..666f4b2f4eeb6a --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/trim-right/index.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = function (str) { + var tail = str.length; + + while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { + tail--; + } + + return str.slice(0, tail); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/object-assign/license b/tools/node_modules/babel-eslint/node_modules/trim-right/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/object-assign/license rename to tools/node_modules/babel-eslint/node_modules/trim-right/license diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/package.json b/tools/node_modules/babel-eslint/node_modules/trim-right/package.json new file mode 100644 index 00000000000000..4ed056783bb584 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/trim-right/package.json @@ -0,0 +1,46 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/trim-right/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Similar to String#trim() but removes only whitespace on the right", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/trim-right#readme", + "keywords": [ + "trim", + "right", + "string", + "str", + "util", + "utils", + "utility", + "whitespace", + "space", + "remove", + "delete" + ], + "license": "MIT", + "name": "trim-right", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/trim-right.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md b/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md new file mode 100644 index 00000000000000..0a4438acd7a898 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md @@ -0,0 +1,30 @@ +# trim-right [![Build Status](https://travis-ci.org/sindresorhus/trim-right.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-right) + +> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only whitespace on the right + + +## Install + +``` +$ npm install --save trim-right +``` + + +## Usage + +```js +var trimRight = require('trim-right'); + +trimRight(' unicorn '); +//=> ' unicorn' +``` + + +## Related + +- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/babel-eslint/package.json b/tools/node_modules/babel-eslint/package.json index acd55ec47591e5..73a82acccd0fbc 100644 --- a/tools/node_modules/babel-eslint/package.json +++ b/tools/node_modules/babel-eslint/package.json @@ -1,28 +1,4 @@ { - "_from": "babel-eslint@latest", - "_id": "babel-eslint@8.2.1", - "_inBundle": false, - "_integrity": "sha512-RzdVOyWKQRUnLXhwLk+eKb4oyW+BykZSkpYwFhM4tnfzAG5OWfvG0w/uyzMp5XKEU0jN82+JefHr39bG2+KhRQ==", - "_location": "/babel-eslint", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "babel-eslint@latest", - "name": "babel-eslint", - "escapedName": "babel-eslint", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.1.tgz", - "_shasum": "136888f3c109edc65376c23ebf494f36a3e03951", - "_spec": "babel-eslint@latest", - "_where": "/home/mzasso/git/nodejs/node/tools/babel-eslint-tmp", "author": { "name": "Sebastian McKenzie", "email": "sebmck@gmail.com" @@ -32,32 +8,31 @@ }, "bundleDependencies": false, "dependencies": { - "@babel/code-frame": "7.0.0-beta.36", - "@babel/traverse": "7.0.0-beta.36", - "@babel/types": "7.0.0-beta.36", - "babylon": "7.0.0-beta.36", - "eslint-scope": "~3.7.1", + "@babel/code-frame": "^7.0.0", + "@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" }, "deprecated": false, "description": "Custom parser for ESLint", "devDependencies": { - "babel-eslint": "^8.0.0", + "babel-eslint": "^8.2.6", "dedent": "^0.7.0", - "eslint": "^4.14.0", + "eslint": "^5.6.0", "eslint-config-babel": "^7.0.1", - "eslint-old": "npm:eslint@4.13.1", "eslint-plugin-flowtype": "^2.30.3", - "eslint-plugin-import": "^2.8.0", + "eslint-plugin-import": "^2.14.0", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.5.2", - "husky": "^0.14.0", - "lint-staged": "^4.0.0", - "mocha": "^4.0.0", + "husky": "^1.0.0-rc.13", + "lint-staged": "^7.2.2", + "mocha": "^5.0.1", "prettier": "^1.4.4" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "lib" @@ -72,18 +47,21 @@ }, "main": "lib/index.js", "name": "babel-eslint", + "peerDependencies": { + "eslint": ">= 4.12.1" + }, "repository": { "type": "git", "url": "git+https://github.com/babel/babel-eslint.git" }, "scripts": { "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", - "fix": "eslint index.js babylon-to-espree test --fix", - "lint": "eslint index.js babylon-to-espree test", + "fix": "eslint lib test --fix", + "lint": "eslint lib test", "precommit": "lint-staged", "preversion": "npm test", "test": "npm run lint && npm run test-only", - "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js && mocha --require test/fixtures/use-eslint-old.js" + "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js" }, - "version": "8.2.1" -} + "version": "10.0.1" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index e1855ec3f49b1b..e0ee6a74ff5768 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -197,170 +197,82 @@ These folks keep the project moving and are resources for help. The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. - - - - - - - - - - - - - - -
- -
- Nicholas C. Zakas
-
- -
- Ilya Volodin
-
- -
- Brandon Mills
-
- -
- Gyandeep Singh
-
- -
- Toru Nagashima
-
- -
- Alberto Rodríguez
-
- -
- Kai Cataldo
-
- -
- Teddy Katz
-
- -
- Kevin Partington
-
+ + +
+ +
+Nicholas C. Zakas +
+
+ +
+Kevin Partington +
+
+ +
+Ilya Volodin +
+
+ +
+Brandon Mills +
+
+ +
+Toru Nagashima +
+
+ +
+Gyandeep Singh +
+
+ +
+Kai Cataldo +
+
+ +
+Teddy Katz +
+
### Committers The people who review and fix bugs and help triage issues. - - - - - - - -
- -
- 薛定谔的猫
-
- -
- Pig Fang
-
- - -### Alumni - -Former TSC members and committers who previously helped maintain ESLint. - - - - - - - - - - - - - - - - - - - - - - - -
- -
- Mathias Schreck
-
- -
- Jamund Ferguson
-
- -
- Ian VanSchooten
-
- -
- Burak Yiğit Kaya
-
- -
- Michael Ficarra
-
- -
- Mark Pedrotti
-
- -
- Oleg Gaidarenko
-
- -
- Mike Sherov
-
- -
- Henry Zhu
-
- -
- Marat Dulin
-
- -
- Alexej Yaroshevich
-
- -
- Vitor Balocco
-
- -
- James Henry
-
- -
- Reyad Attiyat
-
- -
- Victor Hom
-
+ + +
+ +
+薛定谔的猫 +
+
+ +
+Pig Fang +
+
## Sponsors +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website. + + + +

Gold Sponsors

+

Facebook Open Source Airbnb

Silver Sponsors

+

AMP Project

Bronze Sponsors

+

Faithlife

+ + +## Technology Sponsors + * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) diff --git a/tools/node_modules/eslint/lib/cli-engine.js b/tools/node_modules/eslint/lib/cli-engine.js index d7de2592a16d8f..dbf1abd00430c6 100644 --- a/tools/node_modules/eslint/lib/cli-engine.js +++ b/tools/node_modules/eslint/lib/cli-engine.js @@ -455,6 +455,9 @@ class CLIEngine { if (this.options.rules && Object.keys(this.options.rules).length) { const loadedRules = this.linter.getRules(); + // Ajv validator with default schema will mutate original object, so we must clone it recursively. + this.options.rules = lodash.cloneDeep(this.options.rules); + Object.keys(this.options.rules).forEach(name => { validator.validateRuleOptions(loadedRules.get(name), name, this.options.rules[name], "CLI"); }); diff --git a/tools/node_modules/eslint/lib/config/config-file.js b/tools/node_modules/eslint/lib/config/config-file.js index dde79cb40c87d9..f76b92830c447c 100644 --- a/tools/node_modules/eslint/lib/config/config-file.js +++ b/tools/node_modules/eslint/lib/config/config-file.js @@ -280,15 +280,38 @@ function writeYAMLConfigFile(config, filePath) { * Writes a configuration file in JavaScript format. * @param {Object} config The configuration object to write. * @param {string} filePath The filename to write to. + * @throws {Error} If an error occurs linting the config file contents. * @returns {void} * @private */ function writeJSConfigFile(config, filePath) { debug(`Writing JS config file: ${filePath}`); - const content = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};`; + let contentToWrite; + const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};`; - fs.writeFileSync(filePath, content, "utf8"); + try { + const CLIEngine = require("../cli-engine"); + const linter = new CLIEngine({ + baseConfig: config, + fix: true, + useEslintrc: false + }); + const report = linter.executeOnText(stringifiedContent); + + contentToWrite = report.results[0].output || stringifiedContent; + } catch (e) { + debug("Error linting JavaScript config file, writing unlinted version"); + const errorMessage = e.message; + + contentToWrite = stringifiedContent; + e.message = "An error occurred while generating your JavaScript config file. "; + e.message += "A config file was still generated, but the config file itself may not follow your linting rules."; + e.message += `\nError: ${errorMessage}`; + throw e; + } finally { + fs.writeFileSync(filePath, contentToWrite, "utf8"); + } } /** diff --git a/tools/node_modules/eslint/lib/config/config-initializer.js b/tools/node_modules/eslint/lib/config/config-initializer.js index a6791ba85307d2..b8126d4735c3c1 100644 --- a/tools/node_modules/eslint/lib/config/config-initializer.js +++ b/tools/node_modules/eslint/lib/config/config-initializer.js @@ -3,6 +3,7 @@ * @author Ilya Volodin */ + "use strict"; //------------------------------------------------------------------------------ @@ -28,6 +29,8 @@ const debug = require("debug")("eslint:config-initializer"); // Private //------------------------------------------------------------------------------ +const DEFAULT_ECMA_VERSION = 2018; + /* istanbul ignore next: hard to test fs function */ /** * Create .eslintrc file in the current working directory @@ -239,43 +242,65 @@ function configureRules(answers, config) { * @returns {Object} config object */ function processAnswers(answers) { - let config = { rules: {}, env: {}, parserOptions: {} }; + let config = { + rules: {}, + env: {}, + parserOptions: {}, + extends: [] + }; - config.parserOptions.ecmaVersion = answers.ecmaVersion; - if (answers.ecmaVersion >= 2015) { - if (answers.modules) { - config.parserOptions.sourceType = "module"; - } - config.env.es6 = true; - } + // set the latest ECMAScript version + config.parserOptions.ecmaVersion = DEFAULT_ECMA_VERSION; + config.env.es6 = true; + config.globals = { + Atomics: "readonly", + SharedArrayBuffer: "readonly" + }; - if (answers.commonjs) { + // set the module type + if (answers.moduleType === "esm") { + config.parserOptions.sourceType = "module"; + } else if (answers.moduleType === "commonjs") { config.env.commonjs = true; } + + // add in browser and node environments if necessary answers.env.forEach(env => { config.env[env] = true; }); - if (answers.jsx) { - config.parserOptions = config.parserOptions || {}; - config.parserOptions.ecmaFeatures = config.parserOptions.ecmaFeatures || {}; - config.parserOptions.ecmaFeatures.jsx = true; - if (answers.react) { - config.plugins = ["react"]; - config.parserOptions.ecmaVersion = 2018; - } + + // add in library information + if (answers.framework === "react") { + config.parserOptions.ecmaFeatures = { + jsx: true + }; + config.plugins = ["react"]; + } else if (answers.framework === "vue") { + config.plugins = ["vue"]; + config.extends.push("plugin:vue/essential"); } - if (answers.source === "prompt") { - config.extends = "eslint:recommended"; - config.rules.indent = ["error", answers.indent]; - config.rules.quotes = ["error", answers.quotes]; - config.rules["linebreak-style"] = ["error", answers.linebreak]; - config.rules.semi = ["error", answers.semi ? "always" : "never"]; + // setup rules based on problems/style enforcement preferences + if (answers.purpose === "problems") { + config.extends.unshift("eslint:recommended"); + } else if (answers.purpose === "style") { + if (answers.source === "prompt") { + config.extends.unshift("eslint:recommended"); + config.rules.indent = ["error", answers.indent]; + config.rules.quotes = ["error", answers.quotes]; + config.rules["linebreak-style"] = ["error", answers.linebreak]; + config.rules.semi = ["error", answers.semi ? "always" : "never"]; + } else if (answers.source === "auto") { + config = configureRules(answers, config); + config = autoconfig.extendFromRecommended(config); + } } - if (answers.source === "auto") { - config = configureRules(answers, config); - config = autoconfig.extendFromRecommended(config); + // normalize extends + if (config.extends.length === 0) { + delete config.extends; + } else if (config.extends.length === 1) { + config.extends = config.extends[0]; } ConfigOps.normalizeToStrings(config); @@ -324,7 +349,7 @@ function getLocalESLintVersion() { * @returns {string} The shareable config name. */ function getStyleGuideName(answers) { - if (answers.styleguide === "airbnb" && !answers.airbnbReact) { + if (answers.styleguide === "airbnb" && answers.framework !== "react") { return "airbnb-base"; } return answers.styleguide; @@ -417,16 +442,62 @@ function askInstallModules(modules, packageJsonExists) { function promptUser() { return inquirer.prompt([ + { + type: "list", + name: "purpose", + message: "How would you like to use ESLint?", + default: "problems", + choices: [ + { name: "To check syntax only", value: "syntax" }, + { name: "To check syntax and find problems", value: "problems" }, + { name: "To check syntax, find problems, and enforce code style", value: "style" } + ] + }, + { + type: "list", + name: "moduleType", + message: "What type of modules does your project use?", + default: "esm", + choices: [ + { name: "JavaScript modules (import/export)", value: "esm" }, + { name: "CommonJS (require/exports)", value: "commonjs" }, + { name: "None of these", value: "none" } + ] + }, + { + type: "list", + name: "framework", + message: "Which framework does your project use?", + default: "react", + choices: [ + { name: "React", value: "react" }, + { name: "Vue.js", value: "vue" }, + { name: "None of these", value: "none" } + ] + }, + { + type: "checkbox", + name: "env", + message: "Where does your code run?", + default: ["browser"], + choices: [ + { name: "Browser", value: "browser" }, + { name: "Node", value: "node" } + ] + }, { type: "list", name: "source", - message: "How would you like to configure ESLint?", - default: "prompt", + message: "How would you like to define a style for your project?", + default: "guide", choices: [ { name: "Use a popular style guide", value: "guide" }, { name: "Answer questions about your style", value: "prompt" }, { name: "Inspect your JavaScript file(s)", value: "auto" } - ] + ], + when(answers) { + return answers.purpose === "style"; + } }, { type: "list", @@ -442,15 +513,6 @@ function promptUser() { return answers.source === "guide" && answers.packageJsonExists; } }, - { - type: "confirm", - name: "airbnbReact", - message: "Do you use React?", - default: false, - when(answers) { - return answers.styleguide === "airbnb"; - } - }, { type: "input", name: "patterns", @@ -470,10 +532,7 @@ function promptUser() { name: "format", message: "What format do you want your config file to be in?", default: "JavaScript", - choices: ["JavaScript", "YAML", "JSON"], - when(answers) { - return ((answers.source === "guide" && answers.packageJsonExists) || answers.source === "auto"); - } + choices: ["JavaScript", "YAML", "JSON"] }, { type: "confirm", @@ -492,6 +551,15 @@ function promptUser() { } ]).then(earlyAnswers => { + // early exit if no style guide is necessary + if (earlyAnswers.purpose !== "style") { + const config = processAnswers(earlyAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + } + // early exit if you are using a style guide if (earlyAnswers.source === "guide") { if (!earlyAnswers.packageJsonExists) { @@ -501,130 +569,69 @@ function promptUser() { if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) { log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`); } - if (earlyAnswers.styleguide === "airbnb" && !earlyAnswers.airbnbReact) { + if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") { earlyAnswers.styleguide = "airbnb-base"; } - const config = getConfigForStyleGuide(earlyAnswers.styleguide); + const config = ConfigOps.merge(processAnswers(earlyAnswers), getConfigForStyleGuide(earlyAnswers.styleguide)); const modules = getModulesList(config); return askInstallModules(modules, earlyAnswers.packageJsonExists) .then(() => writeFile(config, earlyAnswers.format)); + } - // continue with the questions otherwise... + if (earlyAnswers.source === "auto") { + const combinedAnswers = Object.assign({}, earlyAnswers); + const config = processAnswers(combinedAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + } + + // continue with the style questions otherwise... return inquirer.prompt([ { type: "list", - name: "ecmaVersion", - message: "Which version of ECMAScript do you use?", - choices: [ - { name: "ES3", value: 3 }, - { name: "ES5", value: 5 }, - { name: "ES2015", value: 2015 }, - { name: "ES2016", value: 2016 }, - { name: "ES2017", value: 2017 }, - { name: "ES2018", value: 2018 } - ], - default: 1 // This is the index in the choices list + name: "indent", + message: "What style of indentation do you use?", + default: "tab", + choices: [{ name: "Tabs", value: "tab" }, { name: "Spaces", value: 4 }] }, { - type: "confirm", - name: "modules", - message: "Are you using ES6 modules?", - default: false, - when(answers) { - return answers.ecmaVersion >= 2015; - } - }, - { - type: "checkbox", - name: "env", - message: "Where will your code run?", - default: ["browser"], - choices: [{ name: "Browser", value: "browser" }, { name: "Node", value: "node" }] + type: "list", + name: "quotes", + message: "What quotes do you use for strings?", + default: "double", + choices: [{ name: "Double", value: "double" }, { name: "Single", value: "single" }] }, { - type: "confirm", - name: "commonjs", - message: "Do you use CommonJS?", - default: false, - when(answers) { - return answers.env.some(env => env === "browser"); - } + type: "list", + name: "linebreak", + message: "What line endings do you use?", + default: "unix", + choices: [{ name: "Unix", value: "unix" }, { name: "Windows", value: "windows" }] }, { type: "confirm", - name: "jsx", - message: "Do you use JSX?", - default: false + name: "semi", + message: "Do you require semicolons?", + default: true }, { - type: "confirm", - name: "react", - message: "Do you use React?", - default: false, - when(answers) { - return answers.jsx; - } - } - ]).then(secondAnswers => { - - // early exit if you are using automatic style generation - if (earlyAnswers.source === "auto") { - const combinedAnswers = Object.assign({}, earlyAnswers, secondAnswers); - - const config = processAnswers(combinedAnswers); - - const modules = getModulesList(config); - - return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + type: "list", + name: "format", + message: "What format do you want your config file to be in?", + default: "JavaScript", + choices: ["JavaScript", "YAML", "JSON"] } + ]).then(answers => { + const totalAnswers = Object.assign({}, earlyAnswers, answers); - // continue with the style questions otherwise... - return inquirer.prompt([ - { - type: "list", - name: "indent", - message: "What style of indentation do you use?", - default: "tab", - choices: [{ name: "Tabs", value: "tab" }, { name: "Spaces", value: 4 }] - }, - { - type: "list", - name: "quotes", - message: "What quotes do you use for strings?", - default: "double", - choices: [{ name: "Double", value: "double" }, { name: "Single", value: "single" }] - }, - { - type: "list", - name: "linebreak", - message: "What line endings do you use?", - default: "unix", - choices: [{ name: "Unix", value: "unix" }, { name: "Windows", value: "windows" }] - }, - { - type: "confirm", - name: "semi", - message: "Do you require semicolons?", - default: true - }, - { - type: "list", - name: "format", - message: "What format do you want your config file to be in?", - default: "JavaScript", - choices: ["JavaScript", "YAML", "JSON"] - } - ]).then(answers => { - const totalAnswers = Object.assign({}, earlyAnswers, secondAnswers, answers); - - const config = processAnswers(totalAnswers); - const modules = getModulesList(config); + const config = processAnswers(totalAnswers); + const modules = getModulesList(config); - return askInstallModules(modules).then(() => writeFile(config, answers.format)); - }); + return askInstallModules(modules).then(() => writeFile(config, answers.format)); }); }); } diff --git a/tools/node_modules/eslint/lib/config/config-ops.js b/tools/node_modules/eslint/lib/config/config-ops.js index 48f38b490528a8..b38cdf7d7ca1f4 100644 --- a/tools/node_modules/eslint/lib/config/config-ops.js +++ b/tools/node_modules/eslint/lib/config/config-ops.js @@ -386,12 +386,14 @@ module.exports = { case true: case "true": case "writeable": + case "writable": return "writeable"; case null: case false: case "false": case "readable": + case "readonly": return "readable"; // Fallback to minimize compatibility impact diff --git a/tools/node_modules/eslint/lib/rules/accessor-pairs.js b/tools/node_modules/eslint/lib/rules/accessor-pairs.js index 032e89430571fa..aca231848633ad 100644 --- a/tools/node_modules/eslint/lib/rules/accessor-pairs.js +++ b/tools/node_modules/eslint/lib/rules/accessor-pairs.js @@ -85,10 +85,12 @@ module.exports = { type: "object", properties: { getWithoutSet: { - type: "boolean" + type: "boolean", + default: false }, setWithoutGet: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js index a458e69f761687..b98fa9d27ca1b6 100644 --- a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js +++ b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -34,11 +34,13 @@ module.exports = { type: "object", properties: { multiline: { - type: "boolean" + type: "boolean", + default: true }, minItems: { type: ["integer", "null"], - minimum: 0 + minimum: 0, + default: null } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/array-callback-return.js b/tools/node_modules/eslint/lib/rules/array-callback-return.js index bfee39b037bc7d..f88f4b8bfaeddd 100644 --- a/tools/node_modules/eslint/lib/rules/array-callback-return.js +++ b/tools/node_modules/eslint/lib/rules/array-callback-return.js @@ -155,7 +155,8 @@ module.exports = { type: "object", properties: { allowImplicit: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/array-element-newline.js b/tools/node_modules/eslint/lib/rules/array-element-newline.js index dadb26fdd226de..0efceedd27e691 100644 --- a/tools/node_modules/eslint/lib/rules/array-element-newline.js +++ b/tools/node_modules/eslint/lib/rules/array-element-newline.js @@ -34,11 +34,13 @@ module.exports = { type: "object", properties: { multiline: { - type: "boolean" + type: "boolean", + default: false }, minItems: { type: ["integer", "null"], - minimum: 0 + minimum: 0, + default: null } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/arrow-body-style.js b/tools/node_modules/eslint/lib/rules/arrow-body-style.js index c2ce3b59e4f436..83fc28aba06fab 100644 --- a/tools/node_modules/eslint/lib/rules/arrow-body-style.js +++ b/tools/node_modules/eslint/lib/rules/arrow-body-style.js @@ -46,7 +46,7 @@ module.exports = { { type: "object", properties: { - requireReturnForObjectLiteral: { type: "boolean" } + requireReturnForObjectLiteral: { type: "boolean", default: false } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/arrow-parens.js b/tools/node_modules/eslint/lib/rules/arrow-parens.js index 637a0c1f1f13a5..217a9b60e13cbb 100644 --- a/tools/node_modules/eslint/lib/rules/arrow-parens.js +++ b/tools/node_modules/eslint/lib/rules/arrow-parens.js @@ -35,7 +35,8 @@ module.exports = { type: "object", properties: { requireForBlockBody: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/arrow-spacing.js b/tools/node_modules/eslint/lib/rules/arrow-spacing.js index 87d381840a95dc..95acb78772584b 100644 --- a/tools/node_modules/eslint/lib/rules/arrow-spacing.js +++ b/tools/node_modules/eslint/lib/rules/arrow-spacing.js @@ -32,10 +32,12 @@ module.exports = { type: "object", properties: { before: { - type: "boolean" + type: "boolean", + default: true }, after: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -54,11 +56,10 @@ module.exports = { create(context) { // merge rules with default - const rule = { before: true, after: true }, - option = context.options[0] || {}; + const rule = Object.assign({}, context.options[0]); - rule.before = option.before !== false; - rule.after = option.after !== false; + rule.before = rule.before !== false; + rule.after = rule.after !== false; const sourceCode = context.getSourceCode(); diff --git a/tools/node_modules/eslint/lib/rules/brace-style.js b/tools/node_modules/eslint/lib/rules/brace-style.js index d172124d2f48f7..17a5c7fdf9a37f 100644 --- a/tools/node_modules/eslint/lib/rules/brace-style.js +++ b/tools/node_modules/eslint/lib/rules/brace-style.js @@ -30,7 +30,8 @@ module.exports = { type: "object", properties: { allowSingleLine: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/camelcase.js b/tools/node_modules/eslint/lib/rules/camelcase.js index a8341c84b67bc1..6dd3793f665ed2 100644 --- a/tools/node_modules/eslint/lib/rules/camelcase.js +++ b/tools/node_modules/eslint/lib/rules/camelcase.js @@ -25,7 +25,8 @@ module.exports = { type: "object", properties: { ignoreDestructuring: { - type: "boolean" + type: "boolean", + default: false }, properties: { enum: ["always", "never"] @@ -54,7 +55,7 @@ module.exports = { const options = context.options[0] || {}; let properties = options.properties || ""; - const ignoreDestructuring = options.ignoreDestructuring || false; + const ignoreDestructuring = options.ignoreDestructuring; const allow = options.allow || []; if (properties !== "always" && properties !== "never") { diff --git a/tools/node_modules/eslint/lib/rules/capitalized-comments.js b/tools/node_modules/eslint/lib/rules/capitalized-comments.js index 7947833b270444..285f856379d487 100644 --- a/tools/node_modules/eslint/lib/rules/capitalized-comments.js +++ b/tools/node_modules/eslint/lib/rules/capitalized-comments.js @@ -17,12 +17,7 @@ const astUtils = require("../util/ast-utils"); const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, WHITESPACE = /\s/g, - MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/, // TODO: Combine w/ max-len pattern? - DEFAULTS = { - ignorePattern: null, - ignoreInlineComments: false, - ignoreConsecutiveComments: false - }; + MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/; // TODO: Combine w/ max-len pattern? /* * Base schema body for defining the basic capitalization rule, ignorePattern, @@ -33,17 +28,27 @@ const SCHEMA_BODY = { type: "object", properties: { ignorePattern: { - type: "string" + type: "string", + default: "" }, ignoreInlineComments: { - type: "boolean" + type: "boolean", + default: false }, ignoreConsecutiveComments: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false }; +const DEFAULTS = Object.keys(SCHEMA_BODY.properties).reduce( + (obj, current) => { + obj[current] = SCHEMA_BODY.properties[current].default; + return obj; + }, + {} +); /** * Get normalized options for either block or line comments from the given @@ -59,11 +64,7 @@ const SCHEMA_BODY = { * @param {string} which Either "line" or "block". * @returns {Object} The normalized options. */ -function getNormalizedOptions(rawOptions, which) { - if (!rawOptions) { - return Object.assign({}, DEFAULTS); - } - +function getNormalizedOptions(rawOptions = {}, which) { return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions); } 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 a15ab6b89e480f..0eb1da87f4c227 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 @@ -38,7 +38,7 @@ module.exports = { } }, create(context) { - const config = context.options[0] ? Object.assign({}, context.options[0]) : {}; + const config = Object.assign({}, context.options[0]); const exceptMethods = new Set(config.exceptMethods || []); const stack = []; diff --git a/tools/node_modules/eslint/lib/rules/comma-spacing.js b/tools/node_modules/eslint/lib/rules/comma-spacing.js index 2db0035b545348..a9f89676a4a3cd 100644 --- a/tools/node_modules/eslint/lib/rules/comma-spacing.js +++ b/tools/node_modules/eslint/lib/rules/comma-spacing.js @@ -28,10 +28,12 @@ module.exports = { type: "object", properties: { before: { - type: "boolean" + type: "boolean", + default: false }, after: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -50,8 +52,8 @@ module.exports = { const tokensAndComments = sourceCode.tokensAndComments; const options = { - before: context.options[0] ? !!context.options[0].before : false, - after: context.options[0] ? !!context.options[0].after : true + before: context.options[0] ? context.options[0].before : false, + after: context.options[0] ? context.options[0].after : true }; //-------------------------------------------------------------------------- @@ -118,6 +120,10 @@ module.exports = { report(reportItem, "before", tokens.left); } + if (tokens.right && astUtils.isClosingParenToken(tokens.right)) { + return; + } + if (tokens.right && !options.after && tokens.right.type === "Line") { return; } diff --git a/tools/node_modules/eslint/lib/rules/complexity.js b/tools/node_modules/eslint/lib/rules/complexity.js index af583c02791dd0..9f791e6de7c49a 100644 --- a/tools/node_modules/eslint/lib/rules/complexity.js +++ b/tools/node_modules/eslint/lib/rules/complexity.js @@ -41,11 +41,13 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0 + minimum: 0, + default: 20 }, max: { type: "integer", - minimum: 0 + minimum: 0, + default: 20 } }, additionalProperties: false @@ -63,13 +65,9 @@ module.exports = { const option = context.options[0]; let THRESHOLD = 20; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") { - THRESHOLD = option.maximum; - } - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { - THRESHOLD = option.max; - } - if (typeof option === "number") { + if (typeof option === "object") { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { THRESHOLD = option; } diff --git a/tools/node_modules/eslint/lib/rules/consistent-return.js b/tools/node_modules/eslint/lib/rules/consistent-return.js index ffd7ef20589490..68f9f9d8fbcad4 100644 --- a/tools/node_modules/eslint/lib/rules/consistent-return.js +++ b/tools/node_modules/eslint/lib/rules/consistent-return.js @@ -66,7 +66,8 @@ module.exports = { type: "object", properties: { treatUndefinedAsUnspecified: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/dot-notation.js b/tools/node_modules/eslint/lib/rules/dot-notation.js index 55ccea4ce38f4c..a1b091da0ea90d 100644 --- a/tools/node_modules/eslint/lib/rules/dot-notation.js +++ b/tools/node_modules/eslint/lib/rules/dot-notation.js @@ -33,10 +33,12 @@ module.exports = { type: "object", properties: { allowKeywords: { - type: "boolean" + type: "boolean", + default: true }, allowPattern: { - type: "string" + type: "string", + default: "" } }, additionalProperties: false @@ -53,7 +55,7 @@ module.exports = { create(context) { const options = context.options[0] || {}; - const allowKeywords = options.allowKeywords === void 0 || !!options.allowKeywords; + const allowKeywords = options.allowKeywords === void 0 || options.allowKeywords; const sourceCode = context.getSourceCode(); let allowPattern; diff --git a/tools/node_modules/eslint/lib/rules/eqeqeq.js b/tools/node_modules/eslint/lib/rules/eqeqeq.js index 3e8a392cf6983e..a52de67d750e95 100644 --- a/tools/node_modules/eslint/lib/rules/eqeqeq.js +++ b/tools/node_modules/eslint/lib/rules/eqeqeq.js @@ -38,7 +38,8 @@ module.exports = { type: "object", properties: { null: { - enum: ["always", "never", "ignore"] + enum: ["always", "never", "ignore"], + default: "always" } }, additionalProperties: false 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 c49aa9e59f7e9c..62bba144e6ff97 100644 --- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js @@ -50,7 +50,8 @@ module.exports = { type: "object", properties: { allowNewlines: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/func-style.js b/tools/node_modules/eslint/lib/rules/func-style.js index b7e368cbd2ea08..e150b1a76f26a6 100644 --- a/tools/node_modules/eslint/lib/rules/func-style.js +++ b/tools/node_modules/eslint/lib/rules/func-style.js @@ -27,7 +27,8 @@ module.exports = { type: "object", properties: { allowArrowFunctions: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -43,7 +44,7 @@ module.exports = { create(context) { const style = context.options[0], - allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true, + allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions, enforceDeclarations = (style === "declaration"), stack = []; diff --git a/tools/node_modules/eslint/lib/rules/getter-return.js b/tools/node_modules/eslint/lib/rules/getter-return.js index dc3d9d6b627e62..a1806c357b1afa 100644 --- a/tools/node_modules/eslint/lib/rules/getter-return.js +++ b/tools/node_modules/eslint/lib/rules/getter-return.js @@ -60,7 +60,8 @@ module.exports = { type: "object", properties: { allowImplicit: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/id-length.js b/tools/node_modules/eslint/lib/rules/id-length.js index 1f9c696e2a93b1..c8586ea3481895 100644 --- a/tools/node_modules/eslint/lib/rules/id-length.js +++ b/tools/node_modules/eslint/lib/rules/id-length.js @@ -26,10 +26,11 @@ module.exports = { type: "object", properties: { min: { - type: "number" + type: "integer", + default: 2 }, max: { - type: "number" + type: "integer" }, exceptions: { type: "array", diff --git a/tools/node_modules/eslint/lib/rules/id-match.js b/tools/node_modules/eslint/lib/rules/id-match.js index 5dc86f8dbfd7ac..3978a5ef684b7f 100644 --- a/tools/node_modules/eslint/lib/rules/id-match.js +++ b/tools/node_modules/eslint/lib/rules/id-match.js @@ -28,13 +28,16 @@ module.exports = { type: "object", properties: { properties: { - type: "boolean" + type: "boolean", + default: false }, onlyDeclarations: { - type: "boolean" + type: "boolean", + default: false }, ignoreDestructuring: { - type: "boolean" + type: "boolean", + default: false } } } diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js index c30d1f1e7bccc9..08b9250f05c09d 100644 --- a/tools/node_modules/eslint/lib/rules/indent.js +++ b/tools/node_modules/eslint/lib/rules/indent.js @@ -518,7 +518,8 @@ module.exports = { properties: { SwitchCase: { type: "integer", - minimum: 0 + minimum: 0, + default: 0 }, VariableDeclarator: { oneOf: [ @@ -582,7 +583,8 @@ module.exports = { ObjectExpression: ELEMENT_LIST_SCHEMA, ImportDeclaration: ELEMENT_LIST_SCHEMA, flatTernaryExpressions: { - type: "boolean" + type: "boolean", + default: false }, ignoredNodes: { type: "array", @@ -594,7 +596,8 @@ module.exports = { } }, ignoreComments: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -650,7 +653,7 @@ module.exports = { } if (context.options[1]) { - lodash.merge(options, context.options[1]); + Object.assign(options, context.options[1]); if (typeof options.VariableDeclarator === "number" || options.VariableDeclarator === "first") { options.VariableDeclarator = { diff --git a/tools/node_modules/eslint/lib/rules/init-declarations.js b/tools/node_modules/eslint/lib/rules/init-declarations.js index 65197358e60df8..484cbef0a57c4c 100644 --- a/tools/node_modules/eslint/lib/rules/init-declarations.js +++ b/tools/node_modules/eslint/lib/rules/init-declarations.js @@ -75,7 +75,8 @@ module.exports = { type: "object", properties: { ignoreForLoopInit: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/key-spacing.js b/tools/node_modules/eslint/lib/rules/key-spacing.js index c52a74d499f9ad..31ba9522e9bb72 100644 --- a/tools/node_modules/eslint/lib/rules/key-spacing.js +++ b/tools/node_modules/eslint/lib/rules/key-spacing.js @@ -148,16 +148,20 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, on: { - enum: ["colon", "value"] + enum: ["colon", "value"], + default: "colon" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -165,13 +169,16 @@ module.exports = { ] }, mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -183,13 +190,16 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -206,16 +216,20 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, on: { - enum: ["colon", "value"] + enum: ["colon", "value"], + default: "colon" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -223,13 +237,16 @@ module.exports = { ] }, mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -244,13 +261,16 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -259,13 +279,16 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -274,16 +297,20 @@ module.exports = { type: "object", properties: { mode: { - enum: ["strict", "minimum"] + enum: ["strict", "minimum"], + default: "strict" }, on: { - enum: ["colon", "value"] + enum: ["colon", "value"], + default: "colon" }, beforeColon: { - type: "boolean" + type: "boolean", + default: false }, afterColon: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/keyword-spacing.js b/tools/node_modules/eslint/lib/rules/keyword-spacing.js index 833092e4160c48..83ad6282688bab 100644 --- a/tools/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/tools/node_modules/eslint/lib/rules/keyword-spacing.js @@ -80,16 +80,16 @@ module.exports = { { type: "object", properties: { - before: { type: "boolean" }, - after: { type: "boolean" }, + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true }, overrides: { type: "object", properties: KEYS.reduce((retv, key) => { retv[key] = { type: "object", properties: { - before: { type: "boolean" }, - after: { type: "boolean" } + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true } }, additionalProperties: false }; @@ -228,9 +228,9 @@ module.exports = { * Keys are keywords (there are for every keyword). * Values are instances of `{"before": function, "after": function}`. */ - function parseOptions(options) { - const before = !options || options.before !== false; - const after = !options || options.after !== false; + function parseOptions(options = {}) { + const before = options.before !== false; + const after = options.after !== false; const defaultValue = { before: before ? expectSpaceBefore : unexpectSpaceBefore, after: after ? expectSpaceAfter : unexpectSpaceAfter diff --git a/tools/node_modules/eslint/lib/rules/line-comment-position.js b/tools/node_modules/eslint/lib/rules/line-comment-position.js index 6d0ac6d2ba8c4e..132a8ad875f558 100644 --- a/tools/node_modules/eslint/lib/rules/line-comment-position.js +++ b/tools/node_modules/eslint/lib/rules/line-comment-position.js @@ -31,16 +31,19 @@ module.exports = { type: "object", properties: { position: { - enum: ["above", "beside"] + enum: ["above", "beside"], + default: "above" }, ignorePattern: { type: "string" }, applyDefaultPatterns: { - type: "boolean" + type: "boolean", + default: true }, applyDefaultIgnorePatterns: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -69,9 +72,9 @@ module.exports = { ignorePattern = options.ignorePattern; if (Object.prototype.hasOwnProperty.call(options, "applyDefaultIgnorePatterns")) { - applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; + applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns; } else { - applyDefaultIgnorePatterns = options.applyDefaultPatterns !== false; + applyDefaultIgnorePatterns = options.applyDefaultPatterns; } } diff --git a/tools/node_modules/eslint/lib/rules/lines-around-comment.js b/tools/node_modules/eslint/lib/rules/lines-around-comment.js index 62bef94831d281..0f9851f7241180 100644 --- a/tools/node_modules/eslint/lib/rules/lines-around-comment.js +++ b/tools/node_modules/eslint/lib/rules/lines-around-comment.js @@ -68,22 +68,28 @@ module.exports = { type: "object", properties: { beforeBlockComment: { - type: "boolean" + type: "boolean", + default: true }, afterBlockComment: { - type: "boolean" + type: "boolean", + default: false }, beforeLineComment: { - type: "boolean" + type: "boolean", + default: false }, afterLineComment: { - type: "boolean" + type: "boolean", + default: false }, allowBlockStart: { - type: "boolean" + type: "boolean", + default: false }, allowBlockEnd: { - type: "boolean" + type: "boolean", + default: false }, allowClassStart: { type: "boolean" @@ -121,19 +127,13 @@ module.exports = { create(context) { - const options = context.options[0] ? Object.assign({}, context.options[0]) : {}; + const options = Object.assign({}, context.options[0]); const ignorePattern = options.ignorePattern; const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; const customIgnoreRegExp = new RegExp(ignorePattern); const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; - - options.beforeLineComment = options.beforeLineComment || false; - options.afterLineComment = options.afterLineComment || false; options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; - options.afterBlockComment = options.afterBlockComment || false; - options.allowBlockStart = options.allowBlockStart || false; - options.allowBlockEnd = options.allowBlockEnd || false; const sourceCode = context.getSourceCode(); diff --git a/tools/node_modules/eslint/lib/rules/lines-between-class-members.js b/tools/node_modules/eslint/lib/rules/lines-between-class-members.js index 2937d24f81f1bc..19ae8a6a292c27 100644 --- a/tools/node_modules/eslint/lib/rules/lines-between-class-members.js +++ b/tools/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -31,7 +31,8 @@ module.exports = { type: "object", properties: { exceptAfterSingleLine: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/max-depth.js b/tools/node_modules/eslint/lib/rules/max-depth.js index 500e9318817d41..3b997e21bc6384 100644 --- a/tools/node_modules/eslint/lib/rules/max-depth.js +++ b/tools/node_modules/eslint/lib/rules/max-depth.js @@ -32,11 +32,13 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0 + minimum: 0, + default: 4 }, max: { type: "integer", - minimum: 0 + minimum: 0, + default: 4 } }, additionalProperties: false @@ -59,11 +61,8 @@ module.exports = { option = context.options[0]; let maxDepth = 4; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") { - maxDepth = option.maximum; - } - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { - maxDepth = option.max; + if (typeof option === "object") { + maxDepth = option.maximum || option.max; } if (typeof option === "number") { maxDepth = option; diff --git a/tools/node_modules/eslint/lib/rules/max-len.js b/tools/node_modules/eslint/lib/rules/max-len.js index d74373e9ea85e3..f6f0b6d3ac093d 100644 --- a/tools/node_modules/eslint/lib/rules/max-len.js +++ b/tools/node_modules/eslint/lib/rules/max-len.js @@ -14,7 +14,8 @@ const OPTIONS_SCHEMA = { properties: { code: { type: "integer", - minimum: 0 + minimum: 0, + default: 80 }, comments: { type: "integer", @@ -22,28 +23,35 @@ const OPTIONS_SCHEMA = { }, tabWidth: { type: "integer", - minimum: 0 + minimum: 0, + default: 4 }, ignorePattern: { type: "string" }, ignoreComments: { - type: "boolean" + type: "boolean", + default: false }, ignoreStrings: { - type: "boolean" + type: "boolean", + default: false }, ignoreUrls: { - type: "boolean" + type: "boolean", + default: false }, ignoreTemplateLiterals: { - type: "boolean" + type: "boolean", + default: false }, ignoreRegExpLiterals: { - type: "boolean" + type: "boolean", + default: false }, ignoreTrailingComments: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -121,8 +129,7 @@ module.exports = { } // The options object must be the last option specified… - const lastOption = context.options[context.options.length - 1]; - const options = typeof lastOption === "object" ? Object.create(lastOption) : {}; + const options = Object.assign({}, context.options[context.options.length - 1]); // …but max code length… if (typeof context.options[0] === "number") { diff --git a/tools/node_modules/eslint/lib/rules/max-lines-per-function.js b/tools/node_modules/eslint/lib/rules/max-lines-per-function.js index d1e4597a2218b1..2a0e1a645a375b 100644 --- a/tools/node_modules/eslint/lib/rules/max-lines-per-function.js +++ b/tools/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -19,16 +19,20 @@ const OPTIONS_SCHEMA = { properties: { max: { type: "integer", - minimum: 0 + minimum: 0, + default: 50 }, skipComments: { - type: "boolean" + type: "boolean", + default: false }, skipBlankLines: { - type: "boolean" + type: "boolean", + default: false }, IIFEs: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -97,18 +101,10 @@ module.exports = { let IIFEs = false; if (typeof option === "object") { - if (typeof option.max === "number") { - maxLines = option.max; - } - if (typeof option.skipComments === "boolean") { - skipComments = option.skipComments; - } - if (typeof option.skipBlankLines === "boolean") { - skipBlankLines = option.skipBlankLines; - } - if (typeof option.IIFEs === "boolean") { - IIFEs = option.IIFEs; - } + maxLines = option.max; + skipComments = option.skipComments; + skipBlankLines = option.skipBlankLines; + IIFEs = option.IIFEs; } else if (typeof option === "number") { maxLines = option; } diff --git a/tools/node_modules/eslint/lib/rules/max-lines.js b/tools/node_modules/eslint/lib/rules/max-lines.js index da7ddd8a88fca0..0fae4ec2fa13fa 100644 --- a/tools/node_modules/eslint/lib/rules/max-lines.js +++ b/tools/node_modules/eslint/lib/rules/max-lines.js @@ -38,13 +38,16 @@ module.exports = { properties: { max: { type: "integer", - minimum: 0 + minimum: 0, + default: 300 }, skipComments: { - type: "boolean" + type: "boolean", + default: false }, skipBlankLines: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -61,11 +64,9 @@ module.exports = { const option = context.options[0]; let max = 300; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { + if (typeof option === "object") { max = option.max; - } - - if (typeof option === "number") { + } else if (typeof option === "number") { max = option; } @@ -86,7 +87,7 @@ module.exports = { /** * Returns the line numbers of a comment that don't have any code on the same line * @param {Node} comment The comment node to check - * @returns {int[]} The line numbers + * @returns {number[]} The line numbers */ function getLinesWithoutCode(comment) { let start = comment.loc.start.line; diff --git a/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js b/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js index 754fa168d39ab2..cbbb0ed6c70d9a 100644 --- a/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js +++ b/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -32,11 +32,13 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0 + minimum: 0, + default: 10 }, max: { type: "integer", - minimum: 0 + minimum: 0, + default: 10 } }, additionalProperties: false @@ -57,13 +59,9 @@ module.exports = { const option = context.options[0]; let THRESHOLD = 10; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") { - THRESHOLD = option.maximum; - } - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { - THRESHOLD = option.max; - } - if (typeof option === "number") { + if (typeof option === "object") { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { THRESHOLD = option; } diff --git a/tools/node_modules/eslint/lib/rules/max-params.js b/tools/node_modules/eslint/lib/rules/max-params.js index e082ec8e980cec..5e1e558ab53e0b 100644 --- a/tools/node_modules/eslint/lib/rules/max-params.js +++ b/tools/node_modules/eslint/lib/rules/max-params.js @@ -40,11 +40,13 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0 + minimum: 0, + default: 3 }, max: { type: "integer", - minimum: 0 + minimum: 0, + default: 3 } }, additionalProperties: false @@ -62,11 +64,8 @@ module.exports = { const option = context.options[0]; let numParams = 3; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") { - numParams = option.maximum; - } - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { - numParams = option.max; + if (typeof option === "object") { + numParams = option.maximum || option.max; } if (typeof option === "number") { numParams = option; diff --git a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js index b834cedc03f318..444bdfa21aa1b0 100644 --- a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js +++ b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -31,7 +31,8 @@ module.exports = { properties: { max: { type: "integer", - minimum: 1 + minimum: 1, + default: 1 } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/max-statements.js b/tools/node_modules/eslint/lib/rules/max-statements.js index b33ca429824e45..cd0e50ae399910 100644 --- a/tools/node_modules/eslint/lib/rules/max-statements.js +++ b/tools/node_modules/eslint/lib/rules/max-statements.js @@ -40,11 +40,13 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0 + minimum: 0, + default: 10 }, max: { type: "integer", - minimum: 0 + minimum: 0, + default: 10 } }, additionalProperties: false @@ -78,13 +80,9 @@ module.exports = { topLevelFunctions = []; let maxStatements = 10; - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") { - maxStatements = option.maximum; - } - if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") { - maxStatements = option.max; - } - if (typeof option === "number") { + if (typeof option === "object") { + maxStatements = option.maximum || option.max; + } else if (typeof option === "number") { maxStatements = option; } diff --git a/tools/node_modules/eslint/lib/rules/new-cap.js b/tools/node_modules/eslint/lib/rules/new-cap.js index 4a01dcfa7f385b..ab70fcfadd5e13 100644 --- a/tools/node_modules/eslint/lib/rules/new-cap.js +++ b/tools/node_modules/eslint/lib/rules/new-cap.js @@ -88,10 +88,12 @@ module.exports = { type: "object", properties: { newIsCap: { - type: "boolean" + type: "boolean", + default: true }, capIsNew: { - type: "boolean" + type: "boolean", + default: true }, newIsCapExceptions: { type: "array", @@ -112,7 +114,8 @@ module.exports = { type: "string" }, properties: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -126,7 +129,7 @@ module.exports = { create(context) { - const config = context.options[0] ? Object.assign({}, context.options[0]) : {}; + const config = Object.assign({}, context.options[0]); config.newIsCap = config.newIsCap !== false; config.capIsNew = config.capIsNew !== false; diff --git a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js index 0bf2365de5aa11..90b540c484d495 100644 --- a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js +++ b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -31,7 +31,8 @@ module.exports = { ignoreChainWithDepth: { type: "integer", minimum: 1, - maximum: 10 + maximum: 10, + default: 2 } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-bitwise.js b/tools/node_modules/eslint/lib/rules/no-bitwise.js index df492937c0b5bb..a9c3360a7c5b42 100644 --- a/tools/node_modules/eslint/lib/rules/no-bitwise.js +++ b/tools/node_modules/eslint/lib/rules/no-bitwise.js @@ -43,7 +43,8 @@ module.exports = { uniqueItems: true }, int32Hint: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js index f18ec194530c19..79df9a5138759a 100644 --- a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js +++ b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -41,7 +41,7 @@ module.exports = { schema: [{ type: "object", properties: { - allowParens: { type: "boolean" } + allowParens: { type: "boolean", default: false } }, additionalProperties: false }], diff --git a/tools/node_modules/eslint/lib/rules/no-constant-condition.js b/tools/node_modules/eslint/lib/rules/no-constant-condition.js index fb36207ebbb741..d6d04174298cff 100644 --- a/tools/node_modules/eslint/lib/rules/no-constant-condition.js +++ b/tools/node_modules/eslint/lib/rules/no-constant-condition.js @@ -32,7 +32,8 @@ module.exports = { type: "object", properties: { checkLoops: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js index 7d35b41b4d49ad..03b5e2c12393ae 100644 --- a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -113,7 +113,8 @@ module.exports = { type: "object", properties: { includeExports: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-else-return.js b/tools/node_modules/eslint/lib/rules/no-else-return.js index 5ba02de29136f8..5c21fb1b3fc21e 100644 --- a/tools/node_modules/eslint/lib/rules/no-else-return.js +++ b/tools/node_modules/eslint/lib/rules/no-else-return.js @@ -31,7 +31,8 @@ module.exports = { type: "object", properties: { allowElseIf: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-empty.js b/tools/node_modules/eslint/lib/rules/no-empty.js index 9d72969e67eb6f..2d55dee66596a3 100644 --- a/tools/node_modules/eslint/lib/rules/no-empty.js +++ b/tools/node_modules/eslint/lib/rules/no-empty.js @@ -30,7 +30,8 @@ module.exports = { type: "object", properties: { allowEmptyCatch: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-eval.js b/tools/node_modules/eslint/lib/rules/no-eval.js index 39d91e776e9c79..d4b79468f194a4 100644 --- a/tools/node_modules/eslint/lib/rules/no-eval.js +++ b/tools/node_modules/eslint/lib/rules/no-eval.js @@ -89,7 +89,7 @@ module.exports = { { type: "object", properties: { - allowIndirect: { type: "boolean" } + allowIndirect: { type: "boolean", default: false } }, additionalProperties: false } 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 3a21b69580b820..9f16e0e6ccc622 100644 --- a/tools/node_modules/eslint/lib/rules/no-extra-parens.js +++ b/tools/node_modules/eslint/lib/rules/no-extra-parens.js @@ -44,11 +44,11 @@ module.exports = { { type: "object", properties: { - conditionalAssign: { type: "boolean" }, - nestedBinaryExpressions: { type: "boolean" }, - returnAssign: { type: "boolean" }, + conditionalAssign: { type: "boolean", default: true }, + nestedBinaryExpressions: { type: "boolean", default: true }, + returnAssign: { type: "boolean", default: true }, ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, - enforceForArrowConditionals: { type: "boolean" } + enforceForArrowConditionals: { type: "boolean", default: true } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/no-fallthrough.js b/tools/node_modules/eslint/lib/rules/no-fallthrough.js index 79cbe81c0bbc8e..dfd9d8541587b2 100644 --- a/tools/node_modules/eslint/lib/rules/no-fallthrough.js +++ b/tools/node_modules/eslint/lib/rules/no-fallthrough.js @@ -69,7 +69,8 @@ module.exports = { type: "object", properties: { commentPattern: { - type: "string" + type: "string", + default: "" } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js index 826d9398cab56e..d54c578646d555 100644 --- a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js +++ b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -21,9 +21,9 @@ const ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; */ function parseOptions(options) { return { - boolean: "boolean" in options ? Boolean(options.boolean) : true, - number: "number" in options ? Boolean(options.number) : true, - string: "string" in options ? Boolean(options.string) : true, + boolean: "boolean" in options ? options.boolean : true, + number: "number" in options ? options.number : true, + string: "string" in options ? options.string : true, allow: options.allow || [] }; } @@ -167,13 +167,16 @@ module.exports = { type: "object", properties: { boolean: { - type: "boolean" + type: "boolean", + default: true }, number: { - type: "boolean" + type: "boolean", + default: true }, string: { - type: "boolean" + type: "boolean", + default: true }, allow: { type: "array", diff --git a/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js index 90d1a79a1c349a..ddbfd1c91cc88d 100644 --- a/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js +++ b/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -41,16 +41,20 @@ module.exports = { type: "object", properties: { skipComments: { - type: "boolean" + type: "boolean", + default: false }, skipStrings: { - type: "boolean" + type: "boolean", + default: true }, skipTemplates: { - type: "boolean" + type: "boolean", + default: false }, skipRegExps: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-labels.js b/tools/node_modules/eslint/lib/rules/no-labels.js index 34db20725b0af3..29580bd236bbd8 100644 --- a/tools/node_modules/eslint/lib/rules/no-labels.js +++ b/tools/node_modules/eslint/lib/rules/no-labels.js @@ -30,10 +30,12 @@ module.exports = { type: "object", properties: { allowLoop: { - type: "boolean" + type: "boolean", + default: false }, allowSwitch: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -43,8 +45,8 @@ module.exports = { create(context) { const options = context.options[0]; - const allowLoop = Boolean(options && options.allowLoop); - const allowSwitch = Boolean(options && options.allowSwitch); + const allowLoop = options && options.allowLoop; + const allowSwitch = options && options.allowSwitch; let scopeInfo = null; /** diff --git a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js index 84c08dfb08e717..2c6ea61e283315 100644 --- a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js +++ b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -24,10 +24,12 @@ module.exports = { type: "object", properties: { detectObjects: { - type: "boolean" + type: "boolean", + default: false }, enforceConst: { - type: "boolean" + type: "boolean", + default: false }, ignore: { type: "array", @@ -37,7 +39,8 @@ module.exports = { uniqueItems: true }, ignoreArrayIndexes: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false 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 22ed65f5b1f0fd..2b603a86df5571 100644 --- a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js +++ b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -42,10 +42,10 @@ const TARGET_NODE_TYPE = /^(?:Binary|Logical)Expression$/; * @param {Object|undefined} options - A options object to normalize. * @returns {Object} Normalized option object. */ -function normalizeOptions(options) { - const hasGroups = (options && options.groups && options.groups.length > 0); +function normalizeOptions(options = {}) { + const hasGroups = options.groups && options.groups.length > 0; const groups = hasGroups ? options.groups : DEFAULT_GROUPS; - const allowSamePrecedence = (options && options.allowSamePrecedence) !== false; + const allowSamePrecedence = options.allowSamePrecedence !== false; return { groups, @@ -95,7 +95,8 @@ module.exports = { uniqueItems: true }, allowSamePrecedence: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js index 438ac668a805af..5b07a5f2938753 100644 --- a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js +++ b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -30,10 +30,12 @@ module.exports = { type: "object", properties: { grouping: { - type: "boolean" + type: "boolean", + default: false }, allowCall: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-multi-spaces.js b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js index f1792c31ed7e7e..c5fb07403421af 100644 --- a/tools/node_modules/eslint/lib/rules/no-multi-spaces.js +++ b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -38,7 +38,8 @@ module.exports = { additionalProperties: false }, ignoreEOLComments: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-param-reassign.js b/tools/node_modules/eslint/lib/rules/no-param-reassign.js index 349345c148a76b..83760edb8c2fec 100644 --- a/tools/node_modules/eslint/lib/rules/no-param-reassign.js +++ b/tools/node_modules/eslint/lib/rules/no-param-reassign.js @@ -55,7 +55,7 @@ module.exports = { }, create(context) { - const props = context.options[0] && Boolean(context.options[0].props); + const props = context.options[0] && context.options[0].props; const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; /** diff --git a/tools/node_modules/eslint/lib/rules/no-plusplus.js b/tools/node_modules/eslint/lib/rules/no-plusplus.js index 4c854de1a06ff7..1d122dcd31f086 100644 --- a/tools/node_modules/eslint/lib/rules/no-plusplus.js +++ b/tools/node_modules/eslint/lib/rules/no-plusplus.js @@ -26,7 +26,8 @@ module.exports = { type: "object", properties: { allowForLoopAfterthoughts: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-redeclare.js b/tools/node_modules/eslint/lib/rules/no-redeclare.js index e88436d7c57b73..4d689cc6138716 100644 --- a/tools/node_modules/eslint/lib/rules/no-redeclare.js +++ b/tools/node_modules/eslint/lib/rules/no-redeclare.js @@ -24,7 +24,7 @@ module.exports = { { type: "object", properties: { - builtinGlobals: { type: "boolean" } + builtinGlobals: { type: "boolean", default: false } }, additionalProperties: false } @@ -33,7 +33,7 @@ module.exports = { create(context) { const options = { - builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals) + builtinGlobals: context.options[0] && context.options[0].builtinGlobals }; /** diff --git a/tools/node_modules/eslint/lib/rules/no-self-assign.js b/tools/node_modules/eslint/lib/rules/no-self-assign.js index d493855efe9c68..8bc7afbe38e9b8 100644 --- a/tools/node_modules/eslint/lib/rules/no-self-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-self-assign.js @@ -179,7 +179,8 @@ module.exports = { type: "object", properties: { props: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js index 9bdd50868042c3..f09f3767da4257 100644 --- a/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +++ b/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -4,6 +4,19 @@ */ "use strict"; +/** + * Determines if a variable safely shadows undefined. + * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value + * as the global). + * @param {eslintScope.Variable} variable The variable to check + * @returns {boolean} true if this variable safely shadows `undefined` + */ +function safelyShadowsUndefined(variable) { + return variable.name === "undefined" && + variable.references.every(ref => !ref.isWrite()) && + variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -24,12 +37,13 @@ module.exports = { create(context) { - const RESTRICTED = ["undefined", "NaN", "Infinity", "arguments", "eval"]; + + const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); return { "VariableDeclaration, :function, CatchClause"(node) { for (const variable of context.getDeclaredVariables(node)) { - if (variable.defs.length > 0 && RESTRICTED.includes(variable.name)) { + if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { context.report({ node: variable.defs[0].name, message: "Shadowing of global property '{{idName}}'.", diff --git a/tools/node_modules/eslint/lib/rules/no-shadow.js b/tools/node_modules/eslint/lib/rules/no-shadow.js index f910230d6a27f3..5f617e52a74ba0 100644 --- a/tools/node_modules/eslint/lib/rules/no-shadow.js +++ b/tools/node_modules/eslint/lib/rules/no-shadow.js @@ -30,8 +30,8 @@ module.exports = { { type: "object", properties: { - builtinGlobals: { type: "boolean" }, - hoist: { enum: ["all", "functions", "never"] }, + builtinGlobals: { type: "boolean", default: false }, + hoist: { enum: ["all", "functions", "never"], default: "functions" }, allow: { type: "array", items: { @@ -47,7 +47,7 @@ module.exports = { create(context) { const options = { - builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals), + builtinGlobals: context.options[0] && context.options[0].builtinGlobals, hoist: (context.options[0] && context.options[0].hoist) || "functions", allow: (context.options[0] && context.options[0].allow) || [] }; diff --git a/tools/node_modules/eslint/lib/rules/no-sync.js b/tools/node_modules/eslint/lib/rules/no-sync.js index a0096e3d04313f..578bac96d3d061 100644 --- a/tools/node_modules/eslint/lib/rules/no-sync.js +++ b/tools/node_modules/eslint/lib/rules/no-sync.js @@ -27,7 +27,8 @@ module.exports = { type: "object", properties: { allowAtRootLevel: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-tabs.js b/tools/node_modules/eslint/lib/rules/no-tabs.js index 0002f5592900c1..91fb000796f369 100644 --- a/tools/node_modules/eslint/lib/rules/no-tabs.js +++ b/tools/node_modules/eslint/lib/rules/no-tabs.js @@ -30,7 +30,8 @@ module.exports = { type: "object", properties: { allowIndentationTabs: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js index 18f0340ef011c7..1f0b53aca2abad 100644 --- a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js +++ b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -32,10 +32,12 @@ module.exports = { type: "object", properties: { skipBlankLines: { - type: "boolean" + type: "boolean", + default: false }, ignoreComments: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -52,7 +54,7 @@ module.exports = { const options = context.options[0] || {}, skipBlankLines = options.skipBlankLines || false, - ignoreComments = typeof options.ignoreComments === "boolean" && options.ignoreComments; + ignoreComments = options.ignoreComments || false; /** * Report the error message diff --git a/tools/node_modules/eslint/lib/rules/no-undef.js b/tools/node_modules/eslint/lib/rules/no-undef.js index e6cd152761fca7..6b5140819bbd30 100644 --- a/tools/node_modules/eslint/lib/rules/no-undef.js +++ b/tools/node_modules/eslint/lib/rules/no-undef.js @@ -39,7 +39,8 @@ module.exports = { type: "object", properties: { typeof: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js b/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js index 926803b992d98a..3f59815b575f84 100644 --- a/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js +++ b/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -31,13 +31,16 @@ module.exports = { } }, allowAfterThis: { - type: "boolean" + type: "boolean", + default: false }, allowAfterSuper: { - type: "boolean" + type: "boolean", + default: false }, enforceInMethodNames: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js index 3a7dd5fad7db19..e75a36430fe8aa 100644 --- a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js +++ b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -38,7 +38,8 @@ module.exports = { type: "object", properties: { defaultAssignment: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js index 854298b411978b..25c21775b0de05 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -24,13 +24,16 @@ module.exports = { type: "object", properties: { allowShortCircuit: { - type: "boolean" + type: "boolean", + default: false }, allowTernary: { - type: "boolean" + type: "boolean", + default: false }, allowTaggedTemplates: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false 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 e76e3251038c00..e56ba221bbc841 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js @@ -37,22 +37,26 @@ module.exports = { type: "object", properties: { vars: { - enum: ["all", "local"] + enum: ["all", "local"], + default: "all" }, varsIgnorePattern: { type: "string" }, args: { - enum: ["all", "after-used", "none"] + enum: ["all", "after-used", "none"], + default: "after-used" }, ignoreRestSiblings: { - type: "boolean" + type: "boolean", + default: false }, argsIgnorePattern: { type: "string" }, caughtErrors: { - enum: ["all", "none"] + enum: ["all", "none"], + default: "none" }, caughtErrorsIgnorePattern: { type: "string" diff --git a/tools/node_modules/eslint/lib/rules/no-use-before-define.js b/tools/node_modules/eslint/lib/rules/no-use-before-define.js index 500cd3a4103672..e0b2d23a7e6c94 100644 --- a/tools/node_modules/eslint/lib/rules/no-use-before-define.js +++ b/tools/node_modules/eslint/lib/rules/no-use-before-define.js @@ -154,9 +154,9 @@ module.exports = { { type: "object", properties: { - functions: { type: "boolean" }, - classes: { type: "boolean" }, - variables: { type: "boolean" } + functions: { type: "boolean", default: true }, + classes: { type: "boolean", default: true }, + variables: { type: "boolean", default: true } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/no-useless-rename.js b/tools/node_modules/eslint/lib/rules/no-useless-rename.js index 337f875b4564d8..c1860645ea698e 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-rename.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-rename.js @@ -26,9 +26,9 @@ module.exports = { { type: "object", properties: { - ignoreDestructuring: { type: "boolean" }, - ignoreImport: { type: "boolean" }, - ignoreExport: { type: "boolean" } + ignoreDestructuring: { type: "boolean", default: false }, + ignoreImport: { type: "boolean", default: false }, + ignoreExport: { type: "boolean", default: false } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/object-curly-newline.js b/tools/node_modules/eslint/lib/rules/object-curly-newline.js index d1a6bc20f6361e..d45620d53c568f 100644 --- a/tools/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/tools/node_modules/eslint/lib/rules/object-curly-newline.js @@ -26,14 +26,16 @@ const OPTION_VALUE = { type: "object", properties: { multiline: { - type: "boolean" + type: "boolean", + default: false }, minProperties: { type: "integer", minimum: 0 }, consistent: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false, @@ -59,9 +61,9 @@ function normalizeOptionValue(value) { } else if (value === "never") { minProperties = Number.POSITIVE_INFINITY; } else { - multiline = Boolean(value.multiline); + multiline = value.multiline; minProperties = value.minProperties || Number.POSITIVE_INFINITY; - consistent = Boolean(value.consistent); + consistent = value.consistent; } } else { consistent = true; diff --git a/tools/node_modules/eslint/lib/rules/object-property-newline.js b/tools/node_modules/eslint/lib/rules/object-property-newline.js index 3e2c0171577594..bf777b5ff65ba2 100644 --- a/tools/node_modules/eslint/lib/rules/object-property-newline.js +++ b/tools/node_modules/eslint/lib/rules/object-property-newline.js @@ -25,10 +25,12 @@ module.exports = { type: "object", properties: { allowAllPropertiesOnSameLine: { - type: "boolean" + type: "boolean", + default: false }, allowMultiplePropertiesPerLine: { // Deprecated - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -40,7 +42,7 @@ module.exports = { create(context) { const allowSameLine = context.options[0] && ( - (Boolean(context.options[0].allowAllPropertiesOnSameLine) || Boolean(context.options[0].allowMultiplePropertiesPerLine)) // Deprecated + (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */) ); const errorMessage = allowSameLine ? "Object properties must go on a new line if they aren't all on the same line." diff --git a/tools/node_modules/eslint/lib/rules/object-shorthand.js b/tools/node_modules/eslint/lib/rules/object-shorthand.js index 31010f0e7386db..98917fb6ee20ce 100644 --- a/tools/node_modules/eslint/lib/rules/object-shorthand.js +++ b/tools/node_modules/eslint/lib/rules/object-shorthand.js @@ -57,7 +57,8 @@ module.exports = { type: "object", properties: { avoidQuotes: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -76,13 +77,16 @@ module.exports = { type: "object", properties: { ignoreConstructors: { - type: "boolean" + type: "boolean", + default: false }, avoidQuotes: { - type: "boolean" + type: "boolean", + default: false }, avoidExplicitReturnArrows: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/one-var.js b/tools/node_modules/eslint/lib/rules/one-var.js index 0e9dff416588f7..5a5c71b1874e01 100644 --- a/tools/node_modules/eslint/lib/rules/one-var.js +++ b/tools/node_modules/eslint/lib/rules/one-var.js @@ -32,16 +32,20 @@ module.exports = { type: "object", properties: { separateRequires: { - type: "boolean" + type: "boolean", + default: false }, var: { - enum: ["always", "never", "consecutive"] + enum: ["always", "never", "consecutive"], + default: "always" }, let: { - enum: ["always", "never", "consecutive"] + enum: ["always", "never", "consecutive"], + default: "always" }, const: { - enum: ["always", "never", "consecutive"] + enum: ["always", "never", "consecutive"], + default: "always" } }, additionalProperties: false @@ -76,42 +80,16 @@ module.exports = { options.let = { uninitialized: mode, initialized: mode }; options.const = { uninitialized: mode, initialized: mode }; } else if (typeof mode === "object") { // options configuration is an object - if (Object.prototype.hasOwnProperty.call(mode, "separateRequires")) { - options.separateRequires = !!mode.separateRequires; - } - if (Object.prototype.hasOwnProperty.call(mode, "var")) { - options.var = { uninitialized: mode.var, initialized: mode.var }; - } - if (Object.prototype.hasOwnProperty.call(mode, "let")) { - options.let = { uninitialized: mode.let, initialized: mode.let }; - } - if (Object.prototype.hasOwnProperty.call(mode, "const")) { - options.const = { uninitialized: mode.const, initialized: mode.const }; - } + options.separateRequires = mode.separateRequires; + options.var = { uninitialized: mode.var, initialized: mode.var }; + options.let = { uninitialized: mode.let, initialized: mode.let }; + options.const = { uninitialized: mode.const, initialized: mode.const }; if (Object.prototype.hasOwnProperty.call(mode, "uninitialized")) { - if (!options.var) { - options.var = {}; - } - if (!options.let) { - options.let = {}; - } - if (!options.const) { - options.const = {}; - } options.var.uninitialized = mode.uninitialized; options.let.uninitialized = mode.uninitialized; options.const.uninitialized = mode.uninitialized; } if (Object.prototype.hasOwnProperty.call(mode, "initialized")) { - if (!options.var) { - options.var = {}; - } - if (!options.let) { - options.let = {}; - } - if (!options.const) { - options.const = {}; - } options.var.initialized = mode.initialized; options.let.initialized = mode.initialized; options.const.initialized = mode.initialized; @@ -257,7 +235,9 @@ module.exports = { if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { if (currentScope.uninitialized || currentScope.initialized) { - return false; + if (!hasRequires) { + return false; + } } } @@ -268,7 +248,9 @@ module.exports = { } if (declarationCounts.initialized > 0) { if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { - return false; + if (!hasRequires) { + return false; + } } } if (currentScope.required && hasRequires) { @@ -340,7 +322,11 @@ module.exports = { * y` * ^ afterComma */ - if (afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || afterComma.type === "Line" || afterComma.type === "Block") { + if ( + afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || + afterComma.type === "Line" || + afterComma.type === "Block" + ) { let lastComment = afterComma; while (lastComment.type === "Line" || lastComment.type === "Block") { @@ -349,7 +335,7 @@ module.exports = { return fixer.replaceTextRange( [tokenAfterDeclarator.range[0], lastComment.range[0]], - `;\n${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}\n${declaration.kind} ` + `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} ` ); } diff --git a/tools/node_modules/eslint/lib/rules/padded-blocks.js b/tools/node_modules/eslint/lib/rules/padded-blocks.js index 7c0b56ba7f8553..e4dd37f4cdb42e 100644 --- a/tools/node_modules/eslint/lib/rules/padded-blocks.js +++ b/tools/node_modules/eslint/lib/rules/padded-blocks.js @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("../util/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -45,32 +51,45 @@ module.exports = { minProperties: 1 } ] + }, + { + type: "object", + properties: { + allowSingleLineBlocks: { + type: "boolean" + } + } } ] }, create(context) { const options = {}; - const config = context.options[0] || "always"; + const typeOptions = context.options[0] || "always"; + const exceptOptions = context.options[1] || {}; - if (typeof config === "string") { - const shouldHavePadding = config === "always"; + if (typeof typeOptions === "string") { + const shouldHavePadding = typeOptions === "always"; options.blocks = shouldHavePadding; options.switches = shouldHavePadding; options.classes = shouldHavePadding; } else { - if (Object.prototype.hasOwnProperty.call(config, "blocks")) { - options.blocks = config.blocks === "always"; + if (Object.prototype.hasOwnProperty.call(typeOptions, "blocks")) { + options.blocks = typeOptions.blocks === "always"; } - if (Object.prototype.hasOwnProperty.call(config, "switches")) { - options.switches = config.switches === "always"; + if (Object.prototype.hasOwnProperty.call(typeOptions, "switches")) { + options.switches = typeOptions.switches === "always"; } - if (Object.prototype.hasOwnProperty.call(config, "classes")) { - options.classes = config.classes === "always"; + if (Object.prototype.hasOwnProperty.call(typeOptions, "classes")) { + options.classes = typeOptions.classes === "always"; } } + if (Object.prototype.hasOwnProperty.call(exceptOptions, "allowSingleLineBlocks")) { + options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; + } + const ALWAYS_MESSAGE = "Block must be padded by blank lines.", NEVER_MESSAGE = "Block must not be padded by blank lines."; @@ -177,6 +196,10 @@ module.exports = { blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken), blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast); + if (options.allowSingleLineBlocks && astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)) { + return; + } + if (requirePaddingFor(node)) { if (!blockHasTopPadding) { context.report({ diff --git a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js index b4bbf33f296ab8..a0957399ea5ad1 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js +++ b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -146,10 +146,12 @@ module.exports = { type: "object", properties: { allowNamedFunctions: { - type: "boolean" + type: "boolean", + default: false }, allowUnboundThis: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/prefer-const.js b/tools/node_modules/eslint/lib/rules/prefer-const.js index 5f75376c95c343..023f69cbd32a30 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-const.js +++ b/tools/node_modules/eslint/lib/rules/prefer-const.js @@ -345,8 +345,8 @@ module.exports = { { type: "object", properties: { - destructuring: { enum: ["any", "all"] }, - ignoreReadBeforeAssign: { type: "boolean" } + destructuring: { enum: ["any", "all"], default: "any" }, + ignoreReadBeforeAssign: { type: "boolean", default: false } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js index 119fae560895e7..c30c9170cd9cd2 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -19,6 +19,8 @@ module.exports = { url: "https://eslint.org/docs/rules/prefer-destructuring" }, + fixable: "code", + schema: [ { @@ -34,10 +36,12 @@ module.exports = { type: "object", properties: { array: { - type: "boolean" + type: "boolean", + default: true }, object: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -46,10 +50,12 @@ module.exports = { type: "object", properties: { array: { - type: "boolean" + type: "boolean", + default: true }, object: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -61,10 +67,12 @@ module.exports = { type: "object", properties: { array: { - type: "boolean" + type: "boolean", + default: true }, object: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -75,7 +83,8 @@ module.exports = { type: "object", properties: { enforceForRenamedProperties: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -130,10 +139,55 @@ module.exports = { * * @param {ASTNode} reportNode the node to report * @param {string} type the type of destructuring that should have been done + * @param {Function|null} fix the fix function or null to pass to context.report * @returns {void} */ - function report(reportNode, type) { - context.report({ node: reportNode, message: "Use {{type}} destructuring.", data: { type } }); + function report(reportNode, type, fix) { + context.report({ + node: reportNode, + message: "Use {{type}} destructuring.", + data: { type }, + fix + }); + } + + /** + * Determines if a node should be fixed into object destructuring + * + * The fixer only fixes the simplest case of object destructuring, + * like: `let x = a.x`; + * + * Assignment expression is not fixed. + * Array destructuring is not fixed. + * Renamed property is not fixed. + * + * @param {ASTNode} node the the node to evaluate + * @returns {boolean} whether or not the node should be fixed + */ + function shouldFix(node) { + return node.type === "VariableDeclarator" && + node.id.type === "Identifier" && + node.init.type === "MemberExpression" && + node.id.name === node.init.property.name; + } + + /** + * Fix a node into object destructuring. + * This function only handles the simplest case of object destructuring, + * see {@link shouldFix}. + * + * @param {SourceCodeFixer} fixer the fixer object + * @param {ASTNode} node the node to be fixed. + * @returns {Object} a fix for the node + */ + function fixIntoObjectDestructuring(fixer, node) { + const rightNode = node.init; + const sourceCode = context.getSourceCode(); + + return fixer.replaceText( + node, + `{${rightNode.property.name}} = ${sourceCode.getText(rightNode.object)}` + ); } /** @@ -155,13 +209,17 @@ module.exports = { if (isArrayIndexAccess(rightNode)) { if (shouldCheck(reportNode.type, "array")) { - report(reportNode, "array"); + report(reportNode, "array", null); } return; } + const fix = shouldFix(reportNode) + ? fixer => fixIntoObjectDestructuring(fixer, reportNode) + : null; + if (shouldCheck(reportNode.type, "object") && enforceForRenamedProperties) { - report(reportNode, "object"); + report(reportNode, "object", fix); return; } @@ -172,7 +230,7 @@ module.exports = { (property.type === "Literal" && leftNode.name === property.value) || (property.type === "Identifier" && leftNode.name === property.name && !rightNode.computed) ) { - report(reportNode, "object"); + report(reportNode, "object", fix); } } } diff --git a/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js index 0db5ae874cfd9f..275e705f6d5ca7 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +++ b/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -27,7 +27,7 @@ module.exports = { { type: "object", properties: { - allowEmptyReject: { type: "boolean" } + allowEmptyReject: { type: "boolean", default: false } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/prefer-spread.js b/tools/node_modules/eslint/lib/rules/prefer-spread.js index 790fd3b82aab41..5f3a477329b700 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-spread.js +++ b/tools/node_modules/eslint/lib/rules/prefer-spread.js @@ -59,7 +59,7 @@ module.exports = { }, schema: [], - fixable: "code" + fixable: null }, create(context) { @@ -78,18 +78,7 @@ module.exports = { if (isValidThisArg(expectedThis, thisArg, sourceCode)) { context.report({ node, - message: "Use the spread operator instead of '.apply()'.", - fix(fixer) { - if (expectedThis && expectedThis.type !== "Identifier") { - - // Don't fix cases where the `this` value could be a computed expression. - return null; - } - - const propertyDot = sourceCode.getFirstTokenBetween(applied, node.callee.property, token => token.value === "."); - - return fixer.replaceTextRange([propertyDot.range[0], node.range[1]], `(...${sourceCode.getText(node.arguments[1])})`); - } + message: "Use the spread operator instead of '.apply()'." }); } } diff --git a/tools/node_modules/eslint/lib/rules/quote-props.js b/tools/node_modules/eslint/lib/rules/quote-props.js index 7184bd34d35fd1..f4582dd1f4a87c 100644 --- a/tools/node_modules/eslint/lib/rules/quote-props.js +++ b/tools/node_modules/eslint/lib/rules/quote-props.js @@ -32,7 +32,8 @@ module.exports = { type: "array", items: [ { - enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + enum: ["always", "as-needed", "consistent", "consistent-as-needed"], + default: "always" } ], minItems: 0, @@ -42,19 +43,23 @@ module.exports = { type: "array", items: [ { - enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + enum: ["always", "as-needed", "consistent", "consistent-as-needed"], + default: "always" }, { type: "object", properties: { keywords: { - type: "boolean" + type: "boolean", + default: false }, unnecessary: { - type: "boolean" + type: "boolean", + default: true }, numbers: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/quotes.js b/tools/node_modules/eslint/lib/rules/quotes.js index c3c077822462b8..e0797f9e8be3bb 100644 --- a/tools/node_modules/eslint/lib/rules/quotes.js +++ b/tools/node_modules/eslint/lib/rules/quotes.js @@ -100,10 +100,12 @@ module.exports = { type: "object", properties: { avoidEscape: { - type: "boolean" + type: "boolean", + default: false }, allowTemplateLiterals: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/require-jsdoc.js b/tools/node_modules/eslint/lib/rules/require-jsdoc.js index 389bfb692bbae8..416a22ce6c4375 100644 --- a/tools/node_modules/eslint/lib/rules/require-jsdoc.js +++ b/tools/node_modules/eslint/lib/rules/require-jsdoc.js @@ -23,22 +23,28 @@ module.exports = { type: "object", properties: { ClassDeclaration: { - type: "boolean" + type: "boolean", + default: false }, MethodDefinition: { - type: "boolean" + type: "boolean", + default: false }, FunctionDeclaration: { - type: "boolean" + type: "boolean", + default: true }, ArrowFunctionExpression: { - type: "boolean" + type: "boolean", + default: false }, FunctionExpression: { - type: "boolean" + type: "boolean", + default: false } }, - additionalProperties: false + additionalProperties: false, + default: {} } }, additionalProperties: false @@ -58,7 +64,7 @@ module.exports = { ArrowFunctionExpression: false, FunctionExpression: false }; - const options = Object.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require || {}); + const options = Object.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require); /** * Report the error message diff --git a/tools/node_modules/eslint/lib/rules/semi-spacing.js b/tools/node_modules/eslint/lib/rules/semi-spacing.js index 56ae687d8560a0..3a6d8a052a343b 100644 --- a/tools/node_modules/eslint/lib/rules/semi-spacing.js +++ b/tools/node_modules/eslint/lib/rules/semi-spacing.js @@ -29,10 +29,12 @@ module.exports = { type: "object", properties: { before: { - type: "boolean" + type: "boolean", + default: false }, after: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false @@ -48,12 +50,8 @@ module.exports = { requireSpaceAfter = true; if (typeof config === "object") { - if (Object.prototype.hasOwnProperty.call(config, "before")) { - requireSpaceBefore = config.before; - } - if (Object.prototype.hasOwnProperty.call(config, "after")) { - requireSpaceAfter = config.after; - } + requireSpaceBefore = config.before; + requireSpaceAfter = config.after; } /** diff --git a/tools/node_modules/eslint/lib/rules/semi.js b/tools/node_modules/eslint/lib/rules/semi.js index e8f4c959d4c7df..f7bc0f5fd66198 100644 --- a/tools/node_modules/eslint/lib/rules/semi.js +++ b/tools/node_modules/eslint/lib/rules/semi.js @@ -40,7 +40,8 @@ module.exports = { type: "object", properties: { beforeStatementContinuationChars: { - enum: ["always", "any", "never"] + enum: ["always", "any", "never"], + default: "any" } }, additionalProperties: false @@ -58,7 +59,7 @@ module.exports = { { type: "object", properties: { - omitLastInOneLineBlock: { type: "boolean" } + omitLastInOneLineBlock: { type: "boolean", default: false } }, additionalProperties: false } @@ -75,8 +76,8 @@ module.exports = { const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` const options = context.options[1]; const never = context.options[0] === "never"; - const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); - const beforeStatementContinuationChars = (options && options.beforeStatementContinuationChars) || "any"; + const exceptOneLine = options && options.omitLastInOneLineBlock; + const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars; const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- diff --git a/tools/node_modules/eslint/lib/rules/sort-imports.js b/tools/node_modules/eslint/lib/rules/sort-imports.js index 1c0d134046d9f4..05e643ca0611d5 100644 --- a/tools/node_modules/eslint/lib/rules/sort-imports.js +++ b/tools/node_modules/eslint/lib/rules/sort-imports.js @@ -25,7 +25,8 @@ module.exports = { type: "object", properties: { ignoreCase: { - type: "boolean" + type: "boolean", + default: false }, memberSyntaxSortOrder: { type: "array", @@ -37,10 +38,12 @@ module.exports = { maxItems: 4 }, ignoreDeclarationSort: { - type: "boolean" + type: "boolean", + default: false }, ignoreMemberSort: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/sort-keys.js b/tools/node_modules/eslint/lib/rules/sort-keys.js index 0668e617d3c785..fd5dd8a13bce84 100644 --- a/tools/node_modules/eslint/lib/rules/sort-keys.js +++ b/tools/node_modules/eslint/lib/rules/sort-keys.js @@ -90,10 +90,12 @@ module.exports = { type: "object", properties: { caseSensitive: { - type: "boolean" + type: "boolean", + default: true }, natural: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -106,8 +108,8 @@ module.exports = { // Parse options. const order = context.options[0] || "asc"; const options = context.options[1]; - const insensitive = (options && options.caseSensitive) === false; - const natual = Boolean(options && options.natural); + const insensitive = options && options.caseSensitive === false; + const natual = options && options.natural; const isValidOrder = isValidOrders[ order + (insensitive ? "I" : "") + (natual ? "N" : "") ]; @@ -127,8 +129,14 @@ module.exports = { stack = stack.upper; }, + SpreadElement(node) { + if (node.parent.type === "ObjectExpression") { + stack.prevName = null; + } + }, + Property(node) { - if (node.parent.type === "ObjectPattern" || node.parent.properties.some(n => n.type === "SpreadElement")) { + if (node.parent.type === "ObjectPattern") { return; } diff --git a/tools/node_modules/eslint/lib/rules/sort-vars.js b/tools/node_modules/eslint/lib/rules/sort-vars.js index b6a2c86779c095..e85c6534e3a189 100644 --- a/tools/node_modules/eslint/lib/rules/sort-vars.js +++ b/tools/node_modules/eslint/lib/rules/sort-vars.js @@ -25,7 +25,8 @@ module.exports = { type: "object", properties: { ignoreCase: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/space-before-function-paren.js b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js index 64ba72bf9ead29..c0d8e509fddd63 100644 --- a/tools/node_modules/eslint/lib/rules/space-before-function-paren.js +++ b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -37,13 +37,16 @@ module.exports = { type: "object", properties: { anonymous: { - enum: ["always", "never", "ignore"] + enum: ["always", "never", "ignore"], + default: "always" }, named: { - enum: ["always", "never", "ignore"] + enum: ["always", "never", "ignore"], + default: "always" }, asyncArrow: { - enum: ["always", "never", "ignore"] + enum: ["always", "never", "ignore"], + default: "always" } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/space-infix-ops.js b/tools/node_modules/eslint/lib/rules/space-infix-ops.js index 254616d998d40d..8d1d172c6697b6 100644 --- a/tools/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-infix-ops.js @@ -26,7 +26,8 @@ module.exports = { type: "object", properties: { int32Hint: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/space-unary-ops.js b/tools/node_modules/eslint/lib/rules/space-unary-ops.js index 046be22bec8644..779697b5b39b08 100644 --- a/tools/node_modules/eslint/lib/rules/space-unary-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-unary-ops.js @@ -32,10 +32,12 @@ module.exports = { type: "object", properties: { words: { - type: "boolean" + type: "boolean", + default: true }, nonwords: { - type: "boolean" + type: "boolean", + default: false }, overrides: { type: "object", @@ -58,7 +60,7 @@ module.exports = { }, create(context) { - const options = context.options && Array.isArray(context.options) && context.options[0] || { words: true, nonwords: false }; + const options = context.options[0] || { words: true, nonwords: false }; const sourceCode = context.getSourceCode(); diff --git a/tools/node_modules/eslint/lib/rules/spaced-comment.js b/tools/node_modules/eslint/lib/rules/spaced-comment.js index d4c86d27cf8fc7..63177eb1c7f4f4 100644 --- a/tools/node_modules/eslint/lib/rules/spaced-comment.js +++ b/tools/node_modules/eslint/lib/rules/spaced-comment.js @@ -215,7 +215,8 @@ module.exports = { } }, balanced: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js b/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js index 9c7c0d589e0552..40154862d19215 100644 --- a/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js +++ b/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -30,8 +30,8 @@ module.exports = { { type: "object", properties: { - before: { type: "boolean" }, - after: { type: "boolean" } + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js index 515ba78b1d4fcf..46eb02211a4872 100644 --- a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js +++ b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -42,22 +42,27 @@ module.exports = { } }, requireReturn: { - type: "boolean" + type: "boolean", + default: true }, requireParamDescription: { - type: "boolean" + type: "boolean", + default: true }, requireReturnDescription: { - type: "boolean" + type: "boolean", + default: true }, matchDescription: { type: "string" }, requireReturnType: { - type: "boolean" + type: "boolean", + default: true }, requireParamType: { - type: "boolean" + type: "boolean", + default: true } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/valid-typeof.js b/tools/node_modules/eslint/lib/rules/valid-typeof.js index 7fa2b89bd051a5..16b2a47d371ca6 100644 --- a/tools/node_modules/eslint/lib/rules/valid-typeof.js +++ b/tools/node_modules/eslint/lib/rules/valid-typeof.js @@ -24,7 +24,8 @@ module.exports = { type: "object", properties: { requireStringLiterals: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/rules/wrap-iife.js b/tools/node_modules/eslint/lib/rules/wrap-iife.js index 628ebf532e0254..0e54157f102f7d 100644 --- a/tools/node_modules/eslint/lib/rules/wrap-iife.js +++ b/tools/node_modules/eslint/lib/rules/wrap-iife.js @@ -34,7 +34,8 @@ module.exports = { type: "object", properties: { functionPrototypeMethods: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false @@ -52,7 +53,7 @@ module.exports = { create(context) { const style = context.options[0] || "outside"; - const includeFunctionPrototypeMethods = (context.options[1] && context.options[1].functionPrototypeMethods) || false; + const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; const sourceCode = context.getSourceCode(); diff --git a/tools/node_modules/eslint/lib/rules/yield-star-spacing.js b/tools/node_modules/eslint/lib/rules/yield-star-spacing.js index 20b8e9ea91eb2e..17124dd6ec7c7d 100644 --- a/tools/node_modules/eslint/lib/rules/yield-star-spacing.js +++ b/tools/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -31,8 +31,8 @@ module.exports = { { type: "object", properties: { - before: { type: "boolean" }, - after: { type: "boolean" } + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } }, additionalProperties: false } diff --git a/tools/node_modules/eslint/lib/rules/yoda.js b/tools/node_modules/eslint/lib/rules/yoda.js index 83c435a4f74c3a..825634a79f6899 100644 --- a/tools/node_modules/eslint/lib/rules/yoda.js +++ b/tools/node_modules/eslint/lib/rules/yoda.js @@ -169,10 +169,12 @@ module.exports = { type: "object", properties: { exceptRange: { - type: "boolean" + type: "boolean", + default: false }, onlyEquality: { - type: "boolean" + type: "boolean", + default: false } }, additionalProperties: false diff --git a/tools/node_modules/eslint/lib/util/ajv.js b/tools/node_modules/eslint/lib/util/ajv.js index 285176da87dc42..ecf0ebd172cd51 100644 --- a/tools/node_modules/eslint/lib/util/ajv.js +++ b/tools/node_modules/eslint/lib/util/ajv.js @@ -17,6 +17,7 @@ const Ajv = require("ajv"), const ajv = new Ajv({ meta: false, + useDefaults: true, validateSchema: false, missingRefs: "ignore", verbose: true, diff --git a/tools/node_modules/eslint/node_modules/acorn/README.md b/tools/node_modules/eslint/node_modules/acorn/README.md index e66dac31de22b2..3e5f58d95dea95 100644 --- a/tools/node_modules/eslint/node_modules/acorn/README.md +++ b/tools/node_modules/eslint/node_modules/acorn/README.md @@ -5,7 +5,7 @@ A tiny, fast JavaScript parser written in JavaScript. ## Community Acorn is open source software released under an -[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE). +[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). You are welcome to [report bugs](https://github.com/acornjs/acorn/issues) or create pull 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 e4a0fe3a3bc3b3..0f5bce21806b4d 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js @@ -254,7 +254,7 @@ function isNewLine(code, ecma2019String) { return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) } -var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; +var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; @@ -272,6 +272,10 @@ var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" ); }); +function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") +} + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. @@ -460,24 +464,20 @@ var BIND_FUNCTION = 3; var BIND_SIMPLE_CATCH = 4; var BIND_OUTSIDE = 5; // Special case for function names as bound inside the function -function keywordRegexp(words) { - return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") -} - var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); var reserved = ""; if (!options.allowReserved) { for (var v = options.ecmaVersion;; v--) { if (reserved = reservedWords[v]) { break } } if (options.sourceType === "module") { reserved += " await"; } } - this.reservedWords = keywordRegexp(reserved); + this.reservedWords = wordsRegexp(reserved); var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; - this.reservedWordsStrict = keywordRegexp(reservedStrict); - this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind); + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); this.input = String(input); // Used to signal to callers of `readWord1` whether the word @@ -526,9 +526,11 @@ var Parser = function Parser(options, input, startPos) { this.potentialArrowAt = -1; // Positions to delayed-check that yield/await does not exist in default parameters. - this.yieldPos = this.awaitPos = 0; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; // Labels in scope. this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") @@ -605,7 +607,7 @@ pp.strictDirective = function(start) { // Skip semicolon, if any. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this$1.input)[0].length; - if (this$1.input[start] === ';') + if (this$1.input[start] === ";") { start++; } } }; @@ -747,6 +749,13 @@ pp$1.parseTopLevel = function(node) { var stmt = this$1.parseStatement(null, true, exports); node.body.push(stmt); } + if (this.inModule) + { for (var i = 0, list = Object.keys(this$1.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this$1.raiseRecoverable(this$1.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } this.adaptDirectivePrologue(node.body); this.next(); if (this.options.ecmaVersion >= 6) { @@ -1238,8 +1247,9 @@ var FUNC_HANGING_STATEMENT = 2; var FUNC_NULLABLE_ID = 4; // Parse a function declaration or literal (depending on the -// `isStatement` parameter). +// `statement & FUNC_STATEMENT`). +// Remove `allowExpressionBody` for 7.0.0, as it is only called with false pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { @@ -1260,19 +1270,21 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; + this.awaitIdentPos = 0; this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) { node.id = this.type === types.name ? this.parseIdent() : null; } this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); + this.parseFunctionBody(node, allowExpressionBody, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; @@ -1381,7 +1393,7 @@ pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper pp$1.parseClassId = function(node, isStatement) { if (this.type === types.name) { node.id = this.parseIdent(); - if (isStatement === true) + if (isStatement) { this.checkLVal(node.id, BIND_LEXICAL, false); } } else { if (isStatement === true) @@ -1415,7 +1427,7 @@ pp$1.parseExport = function(node, exports) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } - node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync, true); + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === types._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); @@ -1441,11 +1453,13 @@ pp$1.parseExport = function(node, exports) { if (this.type !== types.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { - // check for keywords used as local names for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names var spec = list[i]; this$1.checkUnreserved(spec.local); + // check if export is defined + this$1.checkLocalExport(spec.local); } node.source = null; @@ -1624,7 +1638,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { switch (node.type) { case "Identifier": if (this.inAsync && node.name === "await") - { this.raise(node.start, "Can not use 'await' as identifier inside an async function"); } + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } break case "ObjectPattern": @@ -2125,42 +2139,53 @@ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; - for (var computed = (void 0);;) { - if ((computed = this$1.eat(types.bracketL)) || this$1.eat(types.dot)) { - var node = this$1.startNodeAt(startPos, startLoc); - node.object = base; - node.property = computed ? this$1.parseExpression() : this$1.parseIdent(true); - node.computed = !!computed; - if (computed) { this$1.expect(types.bracketR); } - base = this$1.finishNode(node, "MemberExpression"); - } else if (!noCalls && this$1.eat(types.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos; - this$1.yieldPos = 0; - this$1.awaitPos = 0; - var exprList = this$1.parseExprList(types.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(types.arrow)) { - this$1.checkPatternErrors(refDestructuringErrors, false); - this$1.checkYieldAwaitInDefaultParams(); - this$1.yieldPos = oldYieldPos; - this$1.awaitPos = oldAwaitPos; - return this$1.parseArrowExpression(this$1.startNodeAt(startPos, startLoc), exprList, true) - } - this$1.checkExpressionErrors(refDestructuringErrors, true); - this$1.yieldPos = oldYieldPos || this$1.yieldPos; - this$1.awaitPos = oldAwaitPos || this$1.awaitPos; - var node$1 = this$1.startNodeAt(startPos, startLoc); - node$1.callee = base; - node$1.arguments = exprList; - base = this$1.finishNode(node$1, "CallExpression"); - } else if (this$1.type === types.backQuote) { - var node$2 = this$1.startNodeAt(startPos, startLoc); - node$2.tag = base; - node$2.quasi = this$1.parseTemplate({isTagged: true}); - base = this$1.finishNode(node$2, "TaggedTemplateExpression"); - } else { - return base + while (true) { + var element = this$1.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); + if (element === base || element.type === "ArrowFunctionExpression") { return element } + base = element; + } +}; + +pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { + var computed = this.eat(types.bracketL); + if (computed || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(true); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + 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(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); } + return base }; // Parse an atomic expression — either a single token that is an @@ -2199,14 +2224,14 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { case types.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - var id = this.parseIdent(this.type !== types.name); + var id = this.parseIdent(false); if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } if (canBeArrow && !this.canInsertSemicolon()) { if (this.eat(types.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { - id = this.parseIdent(); + id = this.parseIdent(false); if (this.canInsertSemicolon() || !this.eat(types.arrow)) { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) @@ -2295,6 +2320,7 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; this.yieldPos = 0; this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters while (this.type !== types.parenR) { first ? first = false : this$1.expect(types.comma); if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { @@ -2538,7 +2564,10 @@ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } } } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); @@ -2578,7 +2607,7 @@ pp$3.initFunction = function(node) { // Parse object or class method. pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); if (this.options.ecmaVersion >= 6) @@ -2588,22 +2617,24 @@ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { this.yieldPos = 0; this.awaitPos = 0; + this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false); + this.parseFunctionBody(node, false, true); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "FunctionExpression") }; // Parse arrow function expression with given parameters. pp$3.parseArrowExpression = function(node, params, isAsync) { - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos; + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node); @@ -2611,18 +2642,20 @@ pp$3.parseArrowExpression = function(node, params, isAsync) { this.yieldPos = 0; this.awaitPos = 0; + this.awaitIdentPos = 0; node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true); + this.parseFunctionBody(node, true, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "ArrowFunctionExpression") }; // Parse function body and check parameters. -pp$3.parseFunctionBody = function(node, isArrowFunction) { +pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { var isExpression = isArrowFunction && this.type !== types.braceL; var oldStrict = this.strict, useStrict = false; @@ -2648,7 +2681,7 @@ pp$3.parseFunctionBody = function(node, isArrowFunction) { // Add the params to varDeclaredNames to ensure that an error is thrown // if a let/const declaration in the function clashes with one of the params. - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params)); + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); node.body = this.parseBlock(false); node.expression = false; this.adaptDirectivePrologue(node.body.body); @@ -2723,9 +2756,9 @@ pp$3.checkUnreserved = function(ref) { var name = ref.name; if (this.inGenerator && name === "yield") - { this.raiseRecoverable(start, "Can not use 'yield' as identifier inside a generator"); } + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } if (this.inAsync && name === "await") - { this.raiseRecoverable(start, "Can not use 'await' as identifier inside an async function"); } + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && @@ -2733,7 +2766,7 @@ pp$3.checkUnreserved = function(ref) { var re = this.strict ? this.reservedWordsStrict : this.reservedWords; if (re.test(name)) { if (!this.inAsync && name === "await") - { this.raiseRecoverable(start, "Can not use keyword 'await' outside an async function"); } + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); } }; @@ -2763,7 +2796,11 @@ pp$3.parseIdent = function(liberal, isBinding) { } this.next(); this.finishNode(node, "Identifier"); - if (!liberal) { this.checkUnreserved(node); } + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } return node }; @@ -2843,7 +2880,7 @@ pp$5.exitScope = function() { // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. pp$5.treatFunctionsAsVarInScope = function(scope) { - return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP); + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; pp$5.declareName = function(name, bindingType, pos) { @@ -2854,6 +2891,8 @@ pp$5.declareName = function(name, bindingType, pos) { var scope = this.currentScope(); redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } } else if (bindingType === BIND_SIMPLE_CATCH) { var scope$1 = this.currentScope(); scope$1.lexical.push(name); @@ -2867,18 +2906,28 @@ pp$5.declareName = function(name, bindingType, pos) { } else { for (var i = this.scopeStack.length - 1; i >= 0; --i) { var scope$3 = this$1.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name || + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || !this$1.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { redeclared = true; break } scope$3.var.push(name); + if (this$1.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this$1.undefinedExports[name]; } if (scope$3.flags & SCOPE_VAR) { break } } } if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; +pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } +}; + pp$5.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; @@ -3094,473 +3143,51 @@ types.name.updateContext = function(prevType) { this.exprAllowed = allowed; }; -var data = { - "$LONE": [ - "ASCII", - "ASCII_Hex_Digit", - "AHex", - "Alphabetic", - "Alpha", - "Any", - "Assigned", - "Bidi_Control", - "Bidi_C", - "Bidi_Mirrored", - "Bidi_M", - "Case_Ignorable", - "CI", - "Cased", - "Changes_When_Casefolded", - "CWCF", - "Changes_When_Casemapped", - "CWCM", - "Changes_When_Lowercased", - "CWL", - "Changes_When_NFKC_Casefolded", - "CWKCF", - "Changes_When_Titlecased", - "CWT", - "Changes_When_Uppercased", - "CWU", - "Dash", - "Default_Ignorable_Code_Point", - "DI", - "Deprecated", - "Dep", - "Diacritic", - "Dia", - "Emoji", - "Emoji_Component", - "Emoji_Modifier", - "Emoji_Modifier_Base", - "Emoji_Presentation", - "Extender", - "Ext", - "Grapheme_Base", - "Gr_Base", - "Grapheme_Extend", - "Gr_Ext", - "Hex_Digit", - "Hex", - "IDS_Binary_Operator", - "IDSB", - "IDS_Trinary_Operator", - "IDST", - "ID_Continue", - "IDC", - "ID_Start", - "IDS", - "Ideographic", - "Ideo", - "Join_Control", - "Join_C", - "Logical_Order_Exception", - "LOE", - "Lowercase", - "Lower", - "Math", - "Noncharacter_Code_Point", - "NChar", - "Pattern_Syntax", - "Pat_Syn", - "Pattern_White_Space", - "Pat_WS", - "Quotation_Mark", - "QMark", - "Radical", - "Regional_Indicator", - "RI", - "Sentence_Terminal", - "STerm", - "Soft_Dotted", - "SD", - "Terminal_Punctuation", - "Term", - "Unified_Ideograph", - "UIdeo", - "Uppercase", - "Upper", - "Variation_Selector", - "VS", - "White_Space", - "space", - "XID_Continue", - "XIDC", - "XID_Start", - "XIDS" - ], - "General_Category": [ - "Cased_Letter", - "LC", - "Close_Punctuation", - "Pe", - "Connector_Punctuation", - "Pc", - "Control", - "Cc", - "cntrl", - "Currency_Symbol", - "Sc", - "Dash_Punctuation", - "Pd", - "Decimal_Number", - "Nd", - "digit", - "Enclosing_Mark", - "Me", - "Final_Punctuation", - "Pf", - "Format", - "Cf", - "Initial_Punctuation", - "Pi", - "Letter", - "L", - "Letter_Number", - "Nl", - "Line_Separator", - "Zl", - "Lowercase_Letter", - "Ll", - "Mark", - "M", - "Combining_Mark", - "Math_Symbol", - "Sm", - "Modifier_Letter", - "Lm", - "Modifier_Symbol", - "Sk", - "Nonspacing_Mark", - "Mn", - "Number", - "N", - "Open_Punctuation", - "Ps", - "Other", - "C", - "Other_Letter", - "Lo", - "Other_Number", - "No", - "Other_Punctuation", - "Po", - "Other_Symbol", - "So", - "Paragraph_Separator", - "Zp", - "Private_Use", - "Co", - "Punctuation", - "P", - "punct", - "Separator", - "Z", - "Space_Separator", - "Zs", - "Spacing_Mark", - "Mc", - "Surrogate", - "Cs", - "Symbol", - "S", - "Titlecase_Letter", - "Lt", - "Unassigned", - "Cn", - "Uppercase_Letter", - "Lu" - ], - "Script": [ - "Adlam", - "Adlm", - "Ahom", - "Anatolian_Hieroglyphs", - "Hluw", - "Arabic", - "Arab", - "Armenian", - "Armn", - "Avestan", - "Avst", - "Balinese", - "Bali", - "Bamum", - "Bamu", - "Bassa_Vah", - "Bass", - "Batak", - "Batk", - "Bengali", - "Beng", - "Bhaiksuki", - "Bhks", - "Bopomofo", - "Bopo", - "Brahmi", - "Brah", - "Braille", - "Brai", - "Buginese", - "Bugi", - "Buhid", - "Buhd", - "Canadian_Aboriginal", - "Cans", - "Carian", - "Cari", - "Caucasian_Albanian", - "Aghb", - "Chakma", - "Cakm", - "Cham", - "Cherokee", - "Cher", - "Common", - "Zyyy", - "Coptic", - "Copt", - "Qaac", - "Cuneiform", - "Xsux", - "Cypriot", - "Cprt", - "Cyrillic", - "Cyrl", - "Deseret", - "Dsrt", - "Devanagari", - "Deva", - "Duployan", - "Dupl", - "Egyptian_Hieroglyphs", - "Egyp", - "Elbasan", - "Elba", - "Ethiopic", - "Ethi", - "Georgian", - "Geor", - "Glagolitic", - "Glag", - "Gothic", - "Goth", - "Grantha", - "Gran", - "Greek", - "Grek", - "Gujarati", - "Gujr", - "Gurmukhi", - "Guru", - "Han", - "Hani", - "Hangul", - "Hang", - "Hanunoo", - "Hano", - "Hatran", - "Hatr", - "Hebrew", - "Hebr", - "Hiragana", - "Hira", - "Imperial_Aramaic", - "Armi", - "Inherited", - "Zinh", - "Qaai", - "Inscriptional_Pahlavi", - "Phli", - "Inscriptional_Parthian", - "Prti", - "Javanese", - "Java", - "Kaithi", - "Kthi", - "Kannada", - "Knda", - "Katakana", - "Kana", - "Kayah_Li", - "Kali", - "Kharoshthi", - "Khar", - "Khmer", - "Khmr", - "Khojki", - "Khoj", - "Khudawadi", - "Sind", - "Lao", - "Laoo", - "Latin", - "Latn", - "Lepcha", - "Lepc", - "Limbu", - "Limb", - "Linear_A", - "Lina", - "Linear_B", - "Linb", - "Lisu", - "Lycian", - "Lyci", - "Lydian", - "Lydi", - "Mahajani", - "Mahj", - "Malayalam", - "Mlym", - "Mandaic", - "Mand", - "Manichaean", - "Mani", - "Marchen", - "Marc", - "Masaram_Gondi", - "Gonm", - "Meetei_Mayek", - "Mtei", - "Mende_Kikakui", - "Mend", - "Meroitic_Cursive", - "Merc", - "Meroitic_Hieroglyphs", - "Mero", - "Miao", - "Plrd", - "Modi", - "Mongolian", - "Mong", - "Mro", - "Mroo", - "Multani", - "Mult", - "Myanmar", - "Mymr", - "Nabataean", - "Nbat", - "New_Tai_Lue", - "Talu", - "Newa", - "Nko", - "Nkoo", - "Nushu", - "Nshu", - "Ogham", - "Ogam", - "Ol_Chiki", - "Olck", - "Old_Hungarian", - "Hung", - "Old_Italic", - "Ital", - "Old_North_Arabian", - "Narb", - "Old_Permic", - "Perm", - "Old_Persian", - "Xpeo", - "Old_South_Arabian", - "Sarb", - "Old_Turkic", - "Orkh", - "Oriya", - "Orya", - "Osage", - "Osge", - "Osmanya", - "Osma", - "Pahawh_Hmong", - "Hmng", - "Palmyrene", - "Palm", - "Pau_Cin_Hau", - "Pauc", - "Phags_Pa", - "Phag", - "Phoenician", - "Phnx", - "Psalter_Pahlavi", - "Phlp", - "Rejang", - "Rjng", - "Runic", - "Runr", - "Samaritan", - "Samr", - "Saurashtra", - "Saur", - "Sharada", - "Shrd", - "Shavian", - "Shaw", - "Siddham", - "Sidd", - "SignWriting", - "Sgnw", - "Sinhala", - "Sinh", - "Sora_Sompeng", - "Sora", - "Soyombo", - "Soyo", - "Sundanese", - "Sund", - "Syloti_Nagri", - "Sylo", - "Syriac", - "Syrc", - "Tagalog", - "Tglg", - "Tagbanwa", - "Tagb", - "Tai_Le", - "Tale", - "Tai_Tham", - "Lana", - "Tai_Viet", - "Tavt", - "Takri", - "Takr", - "Tamil", - "Taml", - "Tangut", - "Tang", - "Telugu", - "Telu", - "Thaana", - "Thaa", - "Thai", - "Tibetan", - "Tibt", - "Tifinagh", - "Tfng", - "Tirhuta", - "Tirh", - "Ugaritic", - "Ugar", - "Vai", - "Vaii", - "Warang_Citi", - "Wara", - "Yi", - "Yiii", - "Zanabazar_Square", - "Zanb" - ] -}; -Array.prototype.push.apply(data.$LONE, data.General_Category); -data.gc = data.General_Category; -data.sc = data.Script_Extensions = data.scx = data.Script; +// This file contains Unicode properties extracted from the ECMAScript +// specification. The lists are extracted like so: +// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + +// #table-binary-unicode-properties +var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; +var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma9BinaryProperties + " Extended_Pictographic" +}; + +// #table-unicode-general-category-values +var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + +// #table-unicode-script-values +var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; +var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd" +}; + +var data = {}; +function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; +} +buildUnicodeData(9); +buildUnicodeData(10); var pp$9 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 10 ? 10 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -4344,14 +3971,14 @@ pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { return false }; pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!data.hasOwnProperty(name) || data[name].indexOf(value) === -1) { - state.raise("Invalid property name"); - } + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } }; pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { - if (data.$LONE.indexOf(nameOrValue) === -1) { - state.raise("Invalid property name"); - } + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } }; // UnicodePropertyName :: @@ -5334,7 +4961,7 @@ pp$8.readWord = function() { // // [walk]: util/walk.js -var version = "6.0.6"; +var version = "6.1.1"; // 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.js.map b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map index 63bbd1d8fb4fc7..7b366e95b27a02 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map @@ -1 +1 @@ -{"version":3,"file":"acorn.js","sources":["../src/identifier.js","../src/tokentype.js","../src/whitespace.js","../src/util.js","../src/locutil.js","../src/options.js","../src/scopeflags.js","../src/state.js","../src/parseutil.js","../src/statement.js","../src/lval.js","../src/expression.js","../src/location.js","../src/scope.js","../src/node.js","../src/tokencontext.js","../src/unicode-property-data.js","../src/regexp.js","../src/tokenize.js","../src/index.js"],"sourcesContent":["// Reserved word lists for various dialects of the language\n\nexport const reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n}\n\n// And the keywords\n\nconst ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\"\n\nexport const keywords = {\n 5: ecma5AndLessKeywords,\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n}\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\n// Generated by `bin/generate-identifier-regex.js`.\n\nlet nonASCIIidentifierStartChars = \"\\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\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\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\\u0860-\\u086a\\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\\u09fc\\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-\\u1878\\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\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\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-\\u312f\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fef\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7b9\\ua7f7-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\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\"\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf2-\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\"\n\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\")\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\")\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null\n\n// These are a run-length and offset encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by bin/generate-identifier-regex.js\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]\n\n// eslint-disable-next-line comma-spacing\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n let pos = 0x10000\n for (let i = 0; i < set.length; i += 2) {\n pos += set[i]\n if (pos > code) return false\n pos += set[i + 1]\n if (pos >= code) return true\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code, astral) {\n if (code < 65) return code === 36\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n","// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nexport class TokenType {\n constructor(label, conf = {}) {\n this.label = label\n this.keyword = conf.keyword\n this.beforeExpr = !!conf.beforeExpr\n this.startsExpr = !!conf.startsExpr\n this.isLoop = !!conf.isLoop\n this.isAssign = !!conf.isAssign\n this.prefix = !!conf.prefix\n this.postfix = !!conf.postfix\n this.binop = conf.binop || null\n this.updateContext = null\n }\n}\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nconst beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}\n\n// Map keyword names to token types.\n\nexport const keywords = {}\n\n// Succinct definitions of keyword token types\nfunction kw(name, options = {}) {\n options.keyword = name\n return keywords[name] = new TokenType(name, options)\n}\n\nexport const types = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\"),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n}\n","// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nexport const lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\")\n\nexport function isNewLine(code, ecma2019String) {\n return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))\n}\n\nexport const nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g\n","const {hasOwnProperty, toString} = Object.prototype\n\n// Checks if an object has a property.\n\nexport function has(obj, propName) {\n return hasOwnProperty.call(obj, propName)\n}\n\nexport const isArray = Array.isArray || ((obj) => (\n toString.call(obj) === \"[object Array]\"\n))\n","import {lineBreakG} from \"./whitespace\"\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n constructor(line, col) {\n this.line = line\n this.column = col\n }\n\n offset(n) {\n return new Position(this.line, this.column + n)\n }\n}\n\nexport class SourceLocation {\n constructor(p, start, end) {\n this.start = start\n this.end = end\n if (p.sourceFile !== null) this.source = p.sourceFile\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input, offset) {\n for (let line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n let match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}\n","import {has, isArray} from \"./util\"\nimport {SourceLocation} from \"./locutil\"\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport const defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10\n // (2019). This influences support for strict mode, the set of\n // reserved words, and support for new syntax features. The default\n // is 9.\n ecmaVersion: 9,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: false,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n}\n\n// Interpret and default an options object\n\nexport function getOptions(opts) {\n let options = {}\n\n for (let opt in defaultOptions)\n options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]\n\n if (options.ecmaVersion >= 2015)\n options.ecmaVersion -= 2009\n\n if (options.allowReserved == null)\n options.allowReserved = options.ecmaVersion < 5\n\n if (isArray(options.onToken)) {\n let tokens = options.onToken\n options.onToken = (token) => tokens.push(token)\n }\n if (isArray(options.onComment))\n options.onComment = pushComment(options, options.onComment)\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n let comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n }\n if (options.locations)\n comment.loc = new SourceLocation(this, startLoc, endLoc)\n if (options.ranges)\n comment.range = [start, end]\n array.push(comment)\n }\n}\n","// Each scope gets a bitset that may contain these flags\nexport const\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128\n\nexport function functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal and declareName to determine the type of a binding\nexport const\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5 // Special case for function names as bound inside the function\n","import {reservedWords, keywords} from \"./identifier\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\nimport {getOptions} from \"./options\"\nimport {SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_SUPER, SCOPE_DIRECT_SUPER} from \"./scopeflags\"\n\nfunction keywordRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n\nexport class Parser {\n constructor(options, input, startPos) {\n this.options = options = getOptions(options)\n this.sourceFile = options.sourceFile\n this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5])\n let reserved = \"\"\n if (!options.allowReserved) {\n for (let v = options.ecmaVersion;; v--)\n if (reserved = reservedWords[v]) break\n if (options.sourceType === \"module\") reserved += \" await\"\n }\n this.reservedWords = keywordRegexp(reserved)\n let reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict\n this.reservedWordsStrict = keywordRegexp(reservedStrict)\n this.reservedWordsStrictBind = keywordRegexp(reservedStrict + \" \" + reservedWords.strictBind)\n this.input = String(input)\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length\n } else {\n this.pos = this.lineStart = 0\n this.curLine = 1\n }\n\n // Properties of the current token:\n // Its type\n this.type = tt.eof\n // For tokens that include more information than their type, the value\n this.value = null\n // Its start and end offset\n this.start = this.end = this.pos\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition()\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null\n this.lastTokStart = this.lastTokEnd = this.pos\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext()\n this.exprAllowed = true\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\"\n this.strict = this.inModule || this.strictDirective(this.pos)\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = 0\n // Labels in scope.\n this.labels = []\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n this.skipLineComment(2)\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = []\n this.enterScope(SCOPE_TOP)\n\n // For RegExp validation\n this.regexpState = null\n }\n\n parse() {\n let node = this.options.program || this.startNode()\n this.nextToken()\n return this.parseTopLevel(node)\n }\n\n get inFunction() { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }\n get inGenerator() { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }\n get inAsync() { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }\n get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }\n get allowDirectSuper() { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }\n get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()) }\n\n // Switch to a getter for 7.0.0.\n inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }\n\n static extend(...plugins) {\n let cls = this\n for (let i = 0; i < plugins.length; i++) cls = plugins[i](cls)\n return cls\n }\n\n static parse(input, options) {\n return new this(options, input).parse()\n }\n\n static parseExpressionAt(input, pos, options) {\n let parser = new this(options, input, pos)\n parser.nextToken()\n return parser.parseExpression()\n }\n\n static tokenizer(input, options) {\n return new this(options, input)\n }\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\n\nconst pp = Parser.prototype\n\n// ## Parser utilities\n\nconst literal = /^(?:'((?:\\\\.|[^'])*?)'|\"((?:\\\\.|[^\"])*?)\")/\npp.strictDirective = function(start) {\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n let match = literal.exec(this.input.slice(start))\n if (!match) return false\n if ((match[1] || match[2]) === \"use strict\") return true\n start += match[0].length\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start\n start += skipWhiteSpace.exec(this.input)[0].length\n if (this.input[start] === ';')\n start++\n }\n}\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp.eat = function(type) {\n if (this.type === type) {\n this.next()\n return true\n } else {\n return false\n }\n}\n\n// Tests whether parsed token is a contextual keyword.\n\npp.isContextual = function(name) {\n return this.type === tt.name && this.value === name && !this.containsEsc\n}\n\n// Consumes contextual keyword if possible.\n\npp.eatContextual = function(name) {\n if (!this.isContextual(name)) return false\n this.next()\n return true\n}\n\n// Asserts that following token is given contextual keyword.\n\npp.expectContextual = function(name) {\n if (!this.eatContextual(name)) this.unexpected()\n}\n\n// Test whether a semicolon can be inserted at the current position.\n\npp.canInsertSemicolon = function() {\n return this.type === tt.eof ||\n this.type === tt.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\npp.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc)\n return true\n }\n}\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp.semicolon = function() {\n if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected()\n}\n\npp.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc)\n if (!notNext)\n this.next()\n return true\n }\n}\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp.expect = function(type) {\n this.eat(type) || this.unexpected()\n}\n\n// Raise an unexpected token error.\n\npp.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\")\n}\n\nexport function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1\n}\n\npp.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) return\n if (refDestructuringErrors.trailingComma > -1)\n this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\")\n let parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind\n if (parens > -1) this.raiseRecoverable(parens, \"Parenthesized pattern\")\n}\n\npp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) return false\n let {shorthandAssign, doubleProto} = refDestructuringErrors\n if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0\n if (shorthandAssign >= 0)\n this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\")\n if (doubleProto >= 0)\n this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\")\n}\n\npp.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n this.raise(this.yieldPos, \"Yield expression cannot be a default value\")\n if (this.awaitPos)\n this.raise(this.awaitPos, \"Await expression cannot be a default value\")\n}\n\npp.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n return this.isSimpleAssignTarget(expr.expression)\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {lineBreak, skipWhiteSpace} from \"./whitespace\"\nimport {isIdentifierStart, isIdentifierChar, keywordRelationalOperator} from \"./identifier\"\nimport {has} from \"./util\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {functionFlags, SCOPE_SIMPLE_CATCH, BIND_SIMPLE_CATCH, BIND_LEXICAL, BIND_VAR, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp.parseTopLevel = function(node) {\n let exports = {}\n if (!node.body) node.body = []\n while (this.type !== tt.eof) {\n let stmt = this.parseStatement(null, true, exports)\n node.body.push(stmt)\n }\n this.adaptDirectivePrologue(node.body)\n this.next()\n if (this.options.ecmaVersion >= 6) {\n node.sourceType = this.options.sourceType\n }\n return this.finishNode(node, \"Program\")\n}\n\nconst loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"}\n\npp.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) return false\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91) return true // '['\n if (context) return false\n\n if (nextCh === 123) return true // '{'\n if (isIdentifierStart(nextCh, true)) {\n let pos = next + 1\n while (isIdentifierChar(this.input.charCodeAt(pos), true)) ++pos\n let ident = this.input.slice(next, pos)\n if (!keywordRelationalOperator.test(ident)) return true\n }\n return false\n}\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n return false\n\n skipWhiteSpace.lastIndex = this.pos\n let skip = skipWhiteSpace.exec(this.input)\n let next = this.pos + skip[0].length\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))\n}\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp.parseStatement = function(context, topLevel, exports) {\n let starttype = this.type, node = this.startNode(), kind\n\n if (this.isLet(context)) {\n starttype = tt._var\n kind = \"let\"\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case tt._debugger: return this.parseDebuggerStatement(node)\n case tt._do: return this.parseDoStatement(node)\n case tt._for: return this.parseForStatement(node)\n case tt._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) this.unexpected()\n return this.parseFunctionStatement(node, false, !context)\n case tt._class:\n if (context) this.unexpected()\n return this.parseClass(node, true)\n case tt._if: return this.parseIfStatement(node)\n case tt._return: return this.parseReturnStatement(node)\n case tt._switch: return this.parseSwitchStatement(node)\n case tt._throw: return this.parseThrowStatement(node)\n case tt._try: return this.parseTryStatement(node)\n case tt._const: case tt._var:\n kind = kind || this.value\n if (context && kind !== \"var\") this.unexpected()\n return this.parseVarStatement(node, kind)\n case tt._while: return this.parseWhileStatement(node)\n case tt._with: return this.parseWithStatement(node)\n case tt.braceL: return this.parseBlock(true, node)\n case tt.semi: return this.parseEmptyStatement(node)\n case tt._export:\n case tt._import:\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n this.raise(this.start, \"'import' and 'export' may only appear at the top level\")\n if (!this.inModule)\n this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\")\n }\n return starttype === tt._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) this.unexpected()\n this.next()\n return this.parseFunctionStatement(node, true, !context)\n }\n\n let maybeName = this.value, expr = this.parseExpression()\n if (starttype === tt.name && expr.type === \"Identifier\" && this.eat(tt.colon))\n return this.parseLabeledStatement(node, maybeName, expr, context)\n else return this.parseExpressionStatement(node, expr)\n }\n}\n\npp.parseBreakContinueStatement = function(node, keyword) {\n let isBreak = keyword === \"break\"\n this.next()\n if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null\n else if (this.type !== tt.name) this.unexpected()\n else {\n node.label = this.parseIdent()\n this.semicolon()\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n let i = 0\n for (; i < this.labels.length; ++i) {\n let lab = this.labels[i]\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break\n if (node.label && isBreak) break\n }\n }\n if (i === this.labels.length) this.raise(node.start, \"Unsyntactic \" + keyword)\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n}\n\npp.parseDebuggerStatement = function(node) {\n this.next()\n this.semicolon()\n return this.finishNode(node, \"DebuggerStatement\")\n}\n\npp.parseDoStatement = function(node) {\n this.next()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"do\")\n this.labels.pop()\n this.expect(tt._while)\n node.test = this.parseParenExpression()\n if (this.options.ecmaVersion >= 6)\n this.eat(tt.semi)\n else\n this.semicolon()\n return this.finishNode(node, \"DoWhileStatement\")\n}\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp.parseForStatement = function(node) {\n this.next()\n let awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual(\"await\")) ? this.lastTokStart : -1\n this.labels.push(loopLabel)\n this.enterScope(0)\n this.expect(tt.parenL)\n if (this.type === tt.semi) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, null)\n }\n let isLet = this.isLet()\n if (this.type === tt._var || this.type === tt._const || isLet) {\n let init = this.startNode(), kind = isLet ? \"let\" : this.value\n this.next()\n this.parseVar(init, true, kind)\n this.finishNode(init, \"VariableDeclaration\")\n if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init.declarations.length === 1 &&\n !(kind !== \"var\" && init.declarations[0].init)) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n return this.parseForIn(node, init)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n }\n let refDestructuringErrors = new DestructuringErrors\n let init = this.parseExpression(true, refDestructuringErrors)\n if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === tt._in) {\n if (awaitAt > -1) this.unexpected(awaitAt)\n } else node.await = awaitAt > -1\n }\n this.toAssignable(init, false, refDestructuringErrors)\n this.checkLVal(init)\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (awaitAt > -1) this.unexpected(awaitAt)\n return this.parseFor(node, init)\n}\n\npp.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next()\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n}\n\npp.parseIfStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\")\n node.alternate = this.eat(tt._else) ? this.parseStatement(\"if\") : null\n return this.finishNode(node, \"IfStatement\")\n}\n\npp.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n this.raise(this.start, \"'return' outside of function\")\n this.next()\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null\n else { node.argument = this.parseExpression(); this.semicolon() }\n return this.finishNode(node, \"ReturnStatement\")\n}\n\npp.parseSwitchStatement = function(node) {\n this.next()\n node.discriminant = this.parseParenExpression()\n node.cases = []\n this.expect(tt.braceL)\n this.labels.push(switchLabel)\n this.enterScope(0)\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur\n for (let sawDefault = false; this.type !== tt.braceR;) {\n if (this.type === tt._case || this.type === tt._default) {\n let isCase = this.type === tt._case\n if (cur) this.finishNode(cur, \"SwitchCase\")\n node.cases.push(cur = this.startNode())\n cur.consequent = []\n this.next()\n if (isCase) {\n cur.test = this.parseExpression()\n } else {\n if (sawDefault) this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\")\n sawDefault = true\n cur.test = null\n }\n this.expect(tt.colon)\n } else {\n if (!cur) this.unexpected()\n cur.consequent.push(this.parseStatement(null))\n }\n }\n this.exitScope()\n if (cur) this.finishNode(cur, \"SwitchCase\")\n this.next() // Closing brace\n this.labels.pop()\n return this.finishNode(node, \"SwitchStatement\")\n}\n\npp.parseThrowStatement = function(node) {\n this.next()\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n this.raise(this.lastTokEnd, \"Illegal newline after throw\")\n node.argument = this.parseExpression()\n this.semicolon()\n return this.finishNode(node, \"ThrowStatement\")\n}\n\n// Reused empty array added for node fields that are always empty.\n\nconst empty = []\n\npp.parseTryStatement = function(node) {\n this.next()\n node.block = this.parseBlock()\n node.handler = null\n if (this.type === tt._catch) {\n let clause = this.startNode()\n this.next()\n if (this.eat(tt.parenL)) {\n clause.param = this.parseBindingAtom()\n let simple = clause.param.type === \"Identifier\"\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0)\n this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL)\n this.expect(tt.parenR)\n } else {\n if (this.options.ecmaVersion < 10) this.unexpected()\n clause.param = null\n this.enterScope(0)\n }\n clause.body = this.parseBlock(false)\n this.exitScope()\n node.handler = this.finishNode(clause, \"CatchClause\")\n }\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null\n if (!node.handler && !node.finalizer)\n this.raise(node.start, \"Missing catch or finally clause\")\n return this.finishNode(node, \"TryStatement\")\n}\n\npp.parseVarStatement = function(node, kind) {\n this.next()\n this.parseVar(node, false, kind)\n this.semicolon()\n return this.finishNode(node, \"VariableDeclaration\")\n}\n\npp.parseWhileStatement = function(node) {\n this.next()\n node.test = this.parseParenExpression()\n this.labels.push(loopLabel)\n node.body = this.parseStatement(\"while\")\n this.labels.pop()\n return this.finishNode(node, \"WhileStatement\")\n}\n\npp.parseWithStatement = function(node) {\n if (this.strict) this.raise(this.start, \"'with' in strict mode\")\n this.next()\n node.object = this.parseParenExpression()\n node.body = this.parseStatement(\"with\")\n return this.finishNode(node, \"WithStatement\")\n}\n\npp.parseEmptyStatement = function(node) {\n this.next()\n return this.finishNode(node, \"EmptyStatement\")\n}\n\npp.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (let label of this.labels)\n if (label.name === maybeName)\n this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\")\n let kind = this.type.isLoop ? \"loop\" : this.type === tt._switch ? \"switch\" : null\n for (let i = this.labels.length - 1; i >= 0; i--) {\n let label = this.labels[i]\n if (label.statementStart === node.start) {\n // Update information about previous labels on this node\n label.statementStart = this.start\n label.kind = kind\n } else break\n }\n this.labels.push({name: maybeName, kind, statementStart: this.start})\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\")\n this.labels.pop()\n node.label = expr\n return this.finishNode(node, \"LabeledStatement\")\n}\n\npp.parseExpressionStatement = function(node, expr) {\n node.expression = expr\n this.semicolon()\n return this.finishNode(node, \"ExpressionStatement\")\n}\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp.parseBlock = function(createNewLexicalScope = true, node = this.startNode()) {\n node.body = []\n this.expect(tt.braceL)\n if (createNewLexicalScope) this.enterScope(0)\n while (!this.eat(tt.braceR)) {\n let stmt = this.parseStatement(null)\n node.body.push(stmt)\n }\n if (createNewLexicalScope) this.exitScope()\n return this.finishNode(node, \"BlockStatement\")\n}\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp.parseFor = function(node, init) {\n node.init = init\n this.expect(tt.semi)\n node.test = this.type === tt.semi ? null : this.parseExpression()\n this.expect(tt.semi)\n node.update = this.type === tt.parenR ? null : this.parseExpression()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, \"ForStatement\")\n}\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp.parseForIn = function(node, init) {\n let type = this.type === tt._in ? \"ForInStatement\" : \"ForOfStatement\"\n this.next()\n if (type === \"ForInStatement\") {\n if (init.type === \"AssignmentPattern\" ||\n (init.type === \"VariableDeclaration\" && init.declarations[0].init != null &&\n (this.strict || init.declarations[0].id.type !== \"Identifier\")))\n this.raise(init.start, \"Invalid assignment in for-in loop head\")\n }\n node.left = init\n node.right = type === \"ForInStatement\" ? this.parseExpression() : this.parseMaybeAssign()\n this.expect(tt.parenR)\n node.body = this.parseStatement(\"for\")\n this.exitScope()\n this.labels.pop()\n return this.finishNode(node, type)\n}\n\n// Parse a list of variable declarations.\n\npp.parseVar = function(node, isFor, kind) {\n node.declarations = []\n node.kind = kind\n for (;;) {\n let decl = this.startNode()\n this.parseVarId(decl, kind)\n if (this.eat(tt.eq)) {\n decl.init = this.parseMaybeAssign(isFor)\n } else if (kind === \"const\" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected()\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === tt._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\")\n } else {\n decl.init = null\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"))\n if (!this.eat(tt.comma)) break\n }\n return node\n}\n\npp.parseVarId = function(decl, kind) {\n if ((kind === \"const\" || kind === \"let\") && this.isContextual(\"let\")) {\n this.raiseRecoverable(this.start, \"let is disallowed as a lexically bound name\");\n }\n decl.id = this.parseBindingAtom()\n this.checkLVal(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false)\n}\n\nconst FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4\n\n// Parse a function declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseFunction = function(node, statement, allowExpressionBody, isAsync) {\n this.initFunction(node)\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === tt.star && (statement & FUNC_HANGING_STATEMENT))\n this.unexpected()\n node.generator = this.eat(tt.star)\n }\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== tt.name ? null : this.parseIdent()\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);\n }\n\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n this.yieldPos = 0\n this.awaitPos = 0\n this.enterScope(functionFlags(node.async, node.generator))\n\n if (!(statement & FUNC_STATEMENT))\n node.id = this.type === tt.name ? this.parseIdent() : null\n\n this.parseFunctionParams(node)\n this.parseFunctionBody(node, allowExpressionBody)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n}\n\npp.parseFunctionParams = function(node) {\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n}\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp.parseClass = function(node, isStatement) {\n this.next()\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n const oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement)\n this.parseClassSuper(node)\n let classBody = this.startNode()\n let hadConstructor = false\n classBody.body = []\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n const element = this.parseClassElement(node.superClass !== null)\n if (element) {\n classBody.body.push(element)\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) this.raise(element.start, \"Duplicate constructor in the same class\")\n hadConstructor = true\n }\n }\n }\n node.body = this.finishNode(classBody, \"ClassBody\")\n this.strict = oldStrict;\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n}\n\npp.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(tt.semi)) return null\n\n let method = this.startNode()\n const tryContextual = (k, noLineBreak = false) => {\n const start = this.start, startLoc = this.startLoc\n if (!this.eatContextual(k)) return false\n if (this.type !== tt.parenL && (!noLineBreak || !this.canInsertSemicolon())) return true\n if (method.key) this.unexpected()\n method.computed = false\n method.key = this.startNodeAt(start, startLoc)\n method.key.name = k\n this.finishNode(method.key, \"Identifier\")\n return false\n }\n\n method.kind = \"method\"\n method.static = tryContextual(\"static\")\n let isGenerator = this.eat(tt.star)\n let isAsync = false\n if (!isGenerator) {\n if (this.options.ecmaVersion >= 8 && tryContextual(\"async\", true)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n } else if (tryContextual(\"get\")) {\n method.kind = \"get\"\n } else if (tryContextual(\"set\")) {\n method.kind = \"set\"\n }\n }\n if (!method.key) this.parsePropertyName(method)\n let {key} = method\n let allowsDirectSuper = false\n if (!method.computed && !method.static && (key.type === \"Identifier\" && key.name === \"constructor\" ||\n key.type === \"Literal\" && key.value === \"constructor\")) {\n if (method.kind !== \"method\") this.raise(key.start, \"Constructor can't have get/set modifier\")\n if (isGenerator) this.raise(key.start, \"Constructor can't be a generator\")\n if (isAsync) this.raise(key.start, \"Constructor can't be an async method\")\n method.kind = \"constructor\"\n allowsDirectSuper = constructorAllowsSuper\n } else if (method.static && key.type === \"Identifier\" && key.name === \"prototype\") {\n this.raise(key.start, \"Classes may not have a static property named prototype\")\n }\n this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper)\n if (method.kind === \"get\" && method.value.params.length !== 0)\n this.raiseRecoverable(method.value.start, \"getter should have no params\")\n if (method.kind === \"set\" && method.value.params.length !== 1)\n this.raiseRecoverable(method.value.start, \"setter should have exactly one param\")\n if (method.kind === \"set\" && method.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(method.value.params[0].start, \"Setter cannot use rest params\")\n return method\n}\n\npp.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper)\n return this.finishNode(method, \"MethodDefinition\")\n}\n\npp.parseClassId = function(node, isStatement) {\n if (this.type === tt.name) {\n node.id = this.parseIdent();\n if (isStatement === true)\n this.checkLVal(node.id, BIND_LEXICAL, false)\n } else {\n if (isStatement === true)\n this.unexpected();\n node.id = null;\n }\n}\n\npp.parseClassSuper = function(node) {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null\n}\n\n// Parses module export declaration.\n\npp.parseExport = function(node, exports) {\n this.next()\n // export * from '...'\n if (this.eat(tt.star)) {\n this.expectContextual(\"from\")\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n this.semicolon()\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(tt._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart)\n let isAsync\n if (this.type === tt._function || (isAsync = this.isAsyncFunction())) {\n let fNode = this.startNode()\n this.next()\n if (isAsync) this.next()\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync, true)\n } else if (this.type === tt._class) {\n let cNode = this.startNode()\n node.declaration = this.parseClass(cNode, \"nullableID\")\n } else {\n node.declaration = this.parseMaybeAssign()\n this.semicolon()\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null)\n if (node.declaration.type === \"VariableDeclaration\")\n this.checkVariableExport(exports, node.declaration.declarations)\n else\n this.checkExport(exports, node.declaration.id.name, node.declaration.id.start)\n node.specifiers = []\n node.source = null\n } else { // export { x, y as z } [from '...']\n node.declaration = null\n node.specifiers = this.parseExportSpecifiers(exports)\n if (this.eatContextual(\"from\")) {\n if (this.type !== tt.string) this.unexpected()\n node.source = this.parseExprAtom()\n } else {\n // check for keywords used as local names\n for (let spec of node.specifiers) {\n this.checkUnreserved(spec.local)\n }\n\n node.source = null\n }\n this.semicolon()\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n}\n\npp.checkExport = function(exports, name, pos) {\n if (!exports) return\n if (has(exports, name))\n this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\")\n exports[name] = true\n}\n\npp.checkPatternExport = function(exports, pat) {\n let type = pat.type\n if (type === \"Identifier\")\n this.checkExport(exports, pat.name, pat.start)\n else if (type === \"ObjectPattern\")\n for (let prop of pat.properties)\n this.checkPatternExport(exports, prop)\n else if (type === \"ArrayPattern\")\n for (let elt of pat.elements) {\n if (elt) this.checkPatternExport(exports, elt)\n }\n else if (type === \"Property\")\n this.checkPatternExport(exports, pat.value)\n else if (type === \"AssignmentPattern\")\n this.checkPatternExport(exports, pat.left)\n else if (type === \"RestElement\")\n this.checkPatternExport(exports, pat.argument)\n else if (type === \"ParenthesizedExpression\")\n this.checkPatternExport(exports, pat.expression)\n}\n\npp.checkVariableExport = function(exports, decls) {\n if (!exports) return\n for (let decl of decls)\n this.checkPatternExport(exports, decl.id)\n}\n\npp.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n}\n\n// Parses a comma-separated list of module exports.\n\npp.parseExportSpecifiers = function(exports) {\n let nodes = [], first = true\n // export { x, y as z } [from '...']\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.local = this.parseIdent(true)\n node.exported = this.eatContextual(\"as\") ? this.parseIdent(true) : node.local\n this.checkExport(exports, node.exported.name, node.exported.start)\n nodes.push(this.finishNode(node, \"ExportSpecifier\"))\n }\n return nodes\n}\n\n// Parses import declaration.\n\npp.parseImport = function(node) {\n this.next()\n // import '...'\n if (this.type === tt.string) {\n node.specifiers = empty\n node.source = this.parseExprAtom()\n } else {\n node.specifiers = this.parseImportSpecifiers()\n this.expectContextual(\"from\")\n node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()\n }\n this.semicolon()\n return this.finishNode(node, \"ImportDeclaration\")\n}\n\n// Parses a comma-separated list of module imports.\n\npp.parseImportSpecifiers = function() {\n let nodes = [], first = true\n if (this.type === tt.name) {\n // import defaultObj, { x, y as z } from '...'\n let node = this.startNode()\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"))\n if (!this.eat(tt.comma)) return nodes\n }\n if (this.type === tt.star) {\n let node = this.startNode()\n this.next()\n this.expectContextual(\"as\")\n node.local = this.parseIdent()\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportNamespaceSpecifier\"))\n return nodes\n }\n this.expect(tt.braceL)\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n let node = this.startNode()\n node.imported = this.parseIdent(true)\n if (this.eatContextual(\"as\")) {\n node.local = this.parseIdent()\n } else {\n this.checkUnreserved(node.imported)\n node.local = node.imported\n }\n this.checkLVal(node.local, BIND_LEXICAL)\n nodes.push(this.finishNode(node, \"ImportSpecifier\"))\n }\n return nodes\n}\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp.adaptDirectivePrologue = function(statements) {\n for (let i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1)\n }\n}\npp.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n}\n","import {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {has} from \"./util\"\nimport {BIND_NONE, BIND_OUTSIDE} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n this.raise(node.start, \"Can not use 'await' as identifier inside an async function\")\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n for (let prop of node.properties) {\n this.toAssignable(prop, isBinding)\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\")\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") this.raise(node.key.start, \"Object pattern can't contain getter or setter\")\n this.toAssignable(node.value, isBinding)\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\"\n if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n this.toAssignableList(node.elements, isBinding)\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\"\n this.toAssignable(node.argument, isBinding)\n if (node.argument.type === \"AssignmentPattern\")\n this.raise(node.argument.start, \"Rest elements cannot have a default value\")\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\")\n node.type = \"AssignmentPattern\"\n delete node.operator\n this.toAssignable(node.left, isBinding)\n // falls through to AssignmentPattern\n\n case \"AssignmentPattern\":\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors)\n break\n\n case \"MemberExpression\":\n if (!isBinding) break\n\n default:\n this.raise(node.start, \"Assigning to rvalue\")\n }\n } else if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true)\n return node\n}\n\n// Convert list of expression atoms to binding list.\n\npp.toAssignableList = function(exprList, isBinding) {\n let end = exprList.length\n for (let i = 0; i < end; i++) {\n let elt = exprList[i]\n if (elt) this.toAssignable(elt, isBinding)\n }\n if (end) {\n let last = exprList[end - 1]\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n this.unexpected(last.argument.start)\n }\n return exprList\n}\n\n// Parses spread element.\n\npp.parseSpread = function(refDestructuringErrors) {\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n return this.finishNode(node, \"SpreadElement\")\n}\n\npp.parseRestBinding = function() {\n let node = this.startNode()\n this.next()\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== tt.name)\n this.unexpected()\n\n node.argument = this.parseBindingAtom()\n\n return this.finishNode(node, \"RestElement\")\n}\n\n// Parses lvalue (assignable) atom.\n\npp.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case tt.bracketL:\n let node = this.startNode()\n this.next()\n node.elements = this.parseBindingList(tt.bracketR, true, true)\n return this.finishNode(node, \"ArrayPattern\")\n\n case tt.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n}\n\npp.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (first) first = false\n else this.expect(tt.comma)\n if (allowEmpty && this.type === tt.comma) {\n elts.push(null)\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === tt.ellipsis) {\n let rest = this.parseRestBinding()\n this.parseBindingListItem(rest)\n elts.push(rest)\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n this.expect(close)\n break\n } else {\n let elem = this.parseMaybeDefault(this.start, this.startLoc)\n this.parseBindingListItem(elem)\n elts.push(elem)\n }\n }\n return elts\n}\n\npp.parseBindingListItem = function(param) {\n return param\n}\n\n// Parses assignment pattern around given atom if possible.\n\npp.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom()\n if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.right = this.parseMaybeAssign()\n return this.finishNode(node, \"AssignmentPattern\")\n}\n\n// Verify that a node is an lval — something that can be assigned\n// to.\n// bindingType can be either:\n// 'var' indicating that the lval creates a 'var' binding\n// 'let' indicating that the lval creates a lexical ('let' or 'const') binding\n// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references\n\npp.checkLVal = function(expr, bindingType = BIND_NONE, checkClashes) {\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n this.raiseRecoverable(expr.start, (bindingType ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\")\n if (checkClashes) {\n if (has(checkClashes, expr.name))\n this.raiseRecoverable(expr.start, \"Argument name clash\")\n checkClashes[expr.name] = true\n }\n if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) this.declareName(expr.name, bindingType, expr.start)\n break\n\n case \"MemberExpression\":\n if (bindingType) this.raiseRecoverable(expr.start, \"Binding member expression\")\n break\n\n case \"ObjectPattern\":\n for (let prop of expr.properties)\n this.checkLVal(prop, bindingType, checkClashes)\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLVal(expr.value, bindingType, checkClashes)\n break\n\n case \"ArrayPattern\":\n for (let elem of expr.elements) {\n if (elem) this.checkLVal(elem, bindingType, checkClashes)\n }\n break\n\n case \"AssignmentPattern\":\n this.checkLVal(expr.left, bindingType, checkClashes)\n break\n\n case \"RestElement\":\n this.checkLVal(expr.argument, bindingType, checkClashes)\n break\n\n case \"ParenthesizedExpression\":\n this.checkLVal(expr.expression, bindingType, checkClashes)\n break\n\n default:\n this.raise(expr.start, (bindingType ? \"Binding\" : \"Assigning to\") + \" rvalue\")\n }\n}\n","// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {types as tt} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {DestructuringErrors} from \"./parseutil\"\nimport {lineBreak} from \"./whitespace\"\nimport {functionFlags, SCOPE_ARROW, SCOPE_SUPER, SCOPE_DIRECT_SUPER, BIND_OUTSIDE, BIND_VAR} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n return\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n return\n let {key} = prop, name\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n let {kind} = prop\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) refDestructuringErrors.doubleProto = key.start\n // Backwards-compat kludge. Can be removed in version 6.0\n else this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\")\n }\n propHash.proto = true\n }\n return\n }\n name = \"$\" + name\n let other = propHash[name]\n if (other) {\n let redefinition\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set\n } else {\n redefinition = other.init || other[kind]\n }\n if (redefinition)\n this.raiseRecoverable(key.start, \"Redefinition of property\")\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n }\n }\n other[kind] = true\n}\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp.parseExpression = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeAssign(noIn, refDestructuringErrors)\n if (this.type === tt.comma) {\n let node = this.startNodeAt(startPos, startLoc)\n node.expressions = [expr]\n while (this.eat(tt.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors))\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n}\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) return this.parseYield(noIn)\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else this.exprAllowed = false\n }\n\n let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign\n oldTrailingComma = refDestructuringErrors.trailingComma\n oldShorthandAssign = refDestructuringErrors.shorthandAssign\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1\n } else {\n refDestructuringErrors = new DestructuringErrors\n ownDestructuringErrors = true\n }\n\n let startPos = this.start, startLoc = this.startLoc\n if (this.type === tt.parenL || this.type === tt.name)\n this.potentialArrowAt = this.start\n let left = this.parseMaybeConditional(noIn, refDestructuringErrors)\n if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc)\n if (this.type.isAssign) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.left = this.type === tt.eq ? this.toAssignable(left, false, refDestructuringErrors) : left\n if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors)\n refDestructuringErrors.shorthandAssign = -1 // reset because shorthand default was used correctly\n this.checkLVal(left)\n this.next()\n node.right = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true)\n }\n if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign\n if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma\n if (oldShorthandAssign > -1) refDestructuringErrors.shorthandAssign = oldShorthandAssign\n return left\n}\n\n// Parse a ternary conditional (`?:`) operator.\n\npp.parseMaybeConditional = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprOps(noIn, refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n if (this.eat(tt.question)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.test = expr\n node.consequent = this.parseMaybeAssign()\n this.expect(tt.colon)\n node.alternate = this.parseMaybeAssign(noIn)\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n}\n\n// Start the precedence parser.\n\npp.parseExprOps = function(noIn, refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseMaybeUnary(refDestructuringErrors, false)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)\n}\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {\n let prec = this.type.binop\n if (prec != null && (!noIn || this.type !== tt._in)) {\n if (prec > minPrec) {\n let logical = this.type === tt.logicalOR || this.type === tt.logicalAND\n let op = this.value\n this.next()\n let startPos = this.start, startLoc = this.startLoc\n let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn)\n let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical)\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)\n }\n }\n return left\n}\n\npp.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n let node = this.startNodeAt(startPos, startLoc)\n node.left = left\n node.operator = op\n node.right = right\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n}\n\n// Parse unary operators, both prefix and postfix.\n\npp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {\n let startPos = this.start, startLoc = this.startLoc, expr\n if (this.isContextual(\"await\") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {\n expr = this.parseAwait()\n sawUnary = true\n } else if (this.type.prefix) {\n let node = this.startNode(), update = this.type === tt.incDec\n node.operator = this.value\n node.prefix = true\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n this.checkExpressionErrors(refDestructuringErrors, true)\n if (update) this.checkLVal(node.argument)\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\")\n else sawUnary = true\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\")\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors)\n if (this.checkExpressionErrors(refDestructuringErrors)) return expr\n while (this.type.postfix && !this.canInsertSemicolon()) {\n let node = this.startNodeAt(startPos, startLoc)\n node.operator = this.value\n node.prefix = false\n node.argument = expr\n this.checkLVal(expr)\n this.next()\n expr = this.finishNode(node, \"UpdateExpression\")\n }\n }\n\n if (!sawUnary && this.eat(tt.starstar))\n return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), \"**\", false)\n else\n return expr\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp.parseExprSubscripts = function(refDestructuringErrors) {\n let startPos = this.start, startLoc = this.startLoc\n let expr = this.parseExprAtom(refDestructuringErrors)\n let skipArrowSubscripts = expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\"\n if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr\n let result = this.parseSubscripts(expr, startPos, startLoc)\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) refDestructuringErrors.parenthesizedAssign = -1\n if (refDestructuringErrors.parenthesizedBind >= result.start) refDestructuringErrors.parenthesizedBind = -1\n }\n return result\n}\n\npp.parseSubscripts = function(base, startPos, startLoc, noCalls) {\n let maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === \"async\"\n for (let computed;;) {\n if ((computed = this.eat(tt.bracketL)) || this.eat(tt.dot)) {\n let node = this.startNodeAt(startPos, startLoc)\n node.object = base\n node.property = computed ? this.parseExpression() : this.parseIdent(true)\n node.computed = !!computed\n if (computed) this.expect(tt.bracketR)\n base = this.finishNode(node, \"MemberExpression\")\n } else if (!noCalls && this.eat(tt.parenL)) {\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n this.yieldPos = 0\n this.awaitPos = 0\n let exprList = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors)\n if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)\n }\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n let node = this.startNodeAt(startPos, startLoc)\n node.callee = base\n node.arguments = exprList\n base = this.finishNode(node, \"CallExpression\")\n } else if (this.type === tt.backQuote) {\n let node = this.startNodeAt(startPos, startLoc)\n node.tag = base\n node.quasi = this.parseTemplate({isTagged: true})\n base = this.finishNode(node, \"TaggedTemplateExpression\")\n } else {\n return base\n }\n }\n}\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp.parseExprAtom = function(refDestructuringErrors) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === tt.slash) this.readRegexp()\n\n let node, canBeArrow = this.potentialArrowAt === this.start\n switch (this.type) {\n case tt._super:\n if (!this.allowSuper)\n this.raise(this.start, \"'super' keyword outside a method\")\n node = this.startNode()\n this.next()\n if (this.type === tt.parenL && !this.allowDirectSuper)\n this.raise(node.start, \"super() call outside constructor of a subclass\")\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super Arguments\n if (this.type !== tt.dot && this.type !== tt.bracketL && this.type !== tt.parenL)\n this.unexpected()\n return this.finishNode(node, \"Super\")\n\n case tt._this:\n node = this.startNode()\n this.next()\n return this.finishNode(node, \"ThisExpression\")\n\n case tt.name:\n let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc\n let id = this.parseIdent(this.type !== tt.name)\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(tt._function))\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true)\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(tt.arrow))\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false)\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === tt.name && !containsEsc) {\n id = this.parseIdent()\n if (this.canInsertSemicolon() || !this.eat(tt.arrow))\n this.unexpected()\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)\n }\n }\n return id\n\n case tt.regexp:\n let value = this.value\n node = this.parseLiteral(value.value)\n node.regex = {pattern: value.pattern, flags: value.flags}\n return node\n\n case tt.num: case tt.string:\n return this.parseLiteral(this.value)\n\n case tt._null: case tt._true: case tt._false:\n node = this.startNode()\n node.value = this.type === tt._null ? null : this.type === tt._true\n node.raw = this.type.keyword\n this.next()\n return this.finishNode(node, \"Literal\")\n\n case tt.parenL:\n let start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow)\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n refDestructuringErrors.parenthesizedAssign = start\n if (refDestructuringErrors.parenthesizedBind < 0)\n refDestructuringErrors.parenthesizedBind = start\n }\n return expr\n\n case tt.bracketL:\n node = this.startNode()\n this.next()\n node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors)\n return this.finishNode(node, \"ArrayExpression\")\n\n case tt.braceL:\n return this.parseObj(false, refDestructuringErrors)\n\n case tt._function:\n node = this.startNode()\n this.next()\n return this.parseFunction(node, 0)\n\n case tt._class:\n return this.parseClass(this.startNode(), false)\n\n case tt._new:\n return this.parseNew()\n\n case tt.backQuote:\n return this.parseTemplate()\n\n default:\n this.unexpected()\n }\n}\n\npp.parseLiteral = function(value) {\n let node = this.startNode()\n node.value = value\n node.raw = this.input.slice(this.start, this.end)\n this.next()\n return this.finishNode(node, \"Literal\")\n}\n\npp.parseParenExpression = function() {\n this.expect(tt.parenL)\n let val = this.parseExpression()\n this.expect(tt.parenR)\n return val\n}\n\npp.parseParenAndDistinguishExpression = function(canBeArrow) {\n let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8\n if (this.options.ecmaVersion >= 6) {\n this.next()\n\n let innerStartPos = this.start, innerStartLoc = this.startLoc\n let exprList = [], first = true, lastIsComma = false\n let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart\n this.yieldPos = 0\n this.awaitPos = 0\n while (this.type !== tt.parenR) {\n first ? first = false : this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) {\n lastIsComma = true\n break\n } else if (this.type === tt.ellipsis) {\n spreadStart = this.start\n exprList.push(this.parseParenItem(this.parseRestBinding()))\n if (this.type === tt.comma) this.raise(this.start, \"Comma is not permitted after the rest element\")\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem))\n }\n }\n let innerEndPos = this.start, innerEndLoc = this.startLoc\n this.expect(tt.parenR)\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false)\n this.checkYieldAwaitInDefaultParams()\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.parseParenArrowList(startPos, startLoc, exprList)\n }\n\n if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart)\n if (spreadStart) this.unexpected(spreadStart)\n this.checkExpressionErrors(refDestructuringErrors, true)\n this.yieldPos = oldYieldPos || this.yieldPos\n this.awaitPos = oldAwaitPos || this.awaitPos\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc)\n val.expressions = exprList\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc)\n } else {\n val = exprList[0]\n }\n } else {\n val = this.parseParenExpression()\n }\n\n if (this.options.preserveParens) {\n let par = this.startNodeAt(startPos, startLoc)\n par.expression = val\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n}\n\npp.parseParenItem = function(item) {\n return item\n}\n\npp.parseParenArrowList = function(startPos, startLoc, exprList) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)\n}\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nconst empty = []\n\npp.parseNew = function() {\n let node = this.startNode()\n let meta = this.parseIdent(true)\n if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) {\n node.meta = meta\n let containsEsc = this.containsEsc\n node.property = this.parseIdent(true)\n if (node.property.name !== \"target\" || containsEsc)\n this.raiseRecoverable(node.property.start, \"The only valid meta property for new is new.target\")\n if (!this.inNonArrowFunction())\n this.raiseRecoverable(node.start, \"new.target can only be used in functions\")\n return this.finishNode(node, \"MetaProperty\")\n }\n let startPos = this.start, startLoc = this.startLoc\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true)\n if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false)\n else node.arguments = empty\n return this.finishNode(node, \"NewExpression\")\n}\n\n// Parse template expression.\n\npp.parseTemplateElement = function({isTagged}) {\n let elem = this.startNode()\n if (this.type === tt.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\")\n }\n elem.value = {\n raw: this.value,\n cooked: null\n }\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n }\n }\n this.next()\n elem.tail = this.type === tt.backQuote\n return this.finishNode(elem, \"TemplateElement\")\n}\n\npp.parseTemplate = function({isTagged = false} = {}) {\n let node = this.startNode()\n this.next()\n node.expressions = []\n let curElt = this.parseTemplateElement({isTagged})\n node.quasis = [curElt]\n while (!curElt.tail) {\n if (this.type === tt.eof) this.raise(this.pos, \"Unterminated template literal\")\n this.expect(tt.dollarBraceL)\n node.expressions.push(this.parseExpression())\n this.expect(tt.braceR)\n node.quasis.push(curElt = this.parseTemplateElement({isTagged}))\n }\n this.next()\n return this.finishNode(node, \"TemplateLiteral\")\n}\n\npp.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === tt.name || this.type === tt.num || this.type === tt.string || this.type === tt.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === tt.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n}\n\n// Parse an object literal or binding pattern.\n\npp.parseObj = function(isPattern, refDestructuringErrors) {\n let node = this.startNode(), first = true, propHash = {}\n node.properties = []\n this.next()\n while (!this.eat(tt.braceR)) {\n if (!first) {\n this.expect(tt.comma)\n if (this.afterTrailingComma(tt.braceR)) break\n } else first = false\n\n const prop = this.parseProperty(isPattern, refDestructuringErrors)\n if (!isPattern) this.checkPropClash(prop, propHash, refDestructuringErrors)\n node.properties.push(prop)\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n}\n\npp.parseProperty = function(isPattern, refDestructuringErrors) {\n let prop = this.startNode(), isGenerator, isAsync, startPos, startLoc\n if (this.options.ecmaVersion >= 9 && this.eat(tt.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false)\n if (this.type === tt.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\")\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === tt.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors)\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === tt.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false\n prop.shorthand = false\n if (isPattern || refDestructuringErrors) {\n startPos = this.start\n startLoc = this.startLoc\n }\n if (!isPattern)\n isGenerator = this.eat(tt.star)\n }\n let containsEsc = this.containsEsc\n this.parsePropertyName(prop)\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star)\n this.parsePropertyName(prop, refDestructuringErrors)\n } else {\n isAsync = false\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc)\n return this.finishNode(prop, \"Property\")\n}\n\npp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === tt.colon)\n this.unexpected()\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors)\n prop.kind = \"init\"\n } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) {\n if (isPattern) this.unexpected()\n prop.kind = \"init\"\n prop.method = true\n prop.value = this.parseMethod(isGenerator, isAsync)\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== tt.comma && this.type !== tt.braceR)) {\n if (isGenerator || isAsync) this.unexpected()\n prop.kind = prop.key.name\n this.parsePropertyName(prop)\n prop.value = this.parseMethod(false)\n let paramCount = prop.kind === \"get\" ? 0 : 1\n if (prop.value.params.length !== paramCount) {\n let start = prop.value.start\n if (prop.kind === \"get\")\n this.raiseRecoverable(start, \"getter should have no params\")\n else\n this.raiseRecoverable(start, \"setter should have exactly one param\")\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\")\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n this.checkUnreserved(prop.key)\n prop.kind = \"init\"\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else if (this.type === tt.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n refDestructuringErrors.shorthandAssign = this.start\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)\n } else {\n prop.value = prop.key\n }\n prop.shorthand = true\n } else this.unexpected()\n}\n\npp.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(tt.bracketL)) {\n prop.computed = true\n prop.key = this.parseMaybeAssign()\n this.expect(tt.bracketR)\n return prop.key\n } else {\n prop.computed = false\n }\n }\n return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true)\n}\n\n// Initialize empty function node.\n\npp.initFunction = function(node) {\n node.id = null\n if (this.options.ecmaVersion >= 6) node.generator = node.expression = false\n if (this.options.ecmaVersion >= 8) node.async = false\n}\n\n// Parse object or class method.\n\npp.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n\n this.initFunction(node)\n if (this.options.ecmaVersion >= 6)\n node.generator = isGenerator\n if (this.options.ecmaVersion >= 8)\n node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0))\n\n this.expect(tt.parenL)\n node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8)\n this.checkYieldAwaitInDefaultParams()\n this.parseFunctionBody(node, false)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, \"FunctionExpression\")\n}\n\n// Parse arrow function expression with given parameters.\n\npp.parseArrowExpression = function(node, params, isAsync) {\n let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW)\n this.initFunction(node)\n if (this.options.ecmaVersion >= 8) node.async = !!isAsync\n\n this.yieldPos = 0\n this.awaitPos = 0\n\n node.params = this.toAssignableList(params, true)\n this.parseFunctionBody(node, true)\n\n this.yieldPos = oldYieldPos\n this.awaitPos = oldAwaitPos\n return this.finishNode(node, \"ArrowFunctionExpression\")\n}\n\n// Parse function body and check parameters.\n\npp.parseFunctionBody = function(node, isArrowFunction) {\n let isExpression = isArrowFunction && this.type !== tt.braceL\n let oldStrict = this.strict, useStrict = false\n\n if (isExpression) {\n node.body = this.parseMaybeAssign()\n node.expression = true\n this.checkParams(node, false)\n } else {\n let nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end)\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\")\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n let oldLabels = this.labels\n this.labels = []\n if (useStrict) this.strict = true\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params))\n node.body = this.parseBlock(false)\n node.expression = false\n this.adaptDirectivePrologue(node.body.body)\n this.labels = oldLabels\n }\n this.exitScope()\n\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) this.checkLVal(node.id, BIND_OUTSIDE)\n this.strict = oldStrict\n}\n\npp.isSimpleParamList = function(params) {\n for (let param of params)\n if (param.type !== \"Identifier\") return false\n return true\n}\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp.checkParams = function(node, allowDuplicates) {\n let nameHash = {}\n for (let param of node.params)\n this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash)\n}\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n let elts = [], first = true\n while (!this.eat(close)) {\n if (!first) {\n this.expect(tt.comma)\n if (allowTrailingComma && this.afterTrailingComma(close)) break\n } else first = false\n\n let elt\n if (allowEmpty && this.type === tt.comma)\n elt = null\n else if (this.type === tt.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors)\n if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0)\n refDestructuringErrors.trailingComma = this.start\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors)\n }\n elts.push(elt)\n }\n return elts\n}\n\npp.checkUnreserved = function({start, end, name}) {\n if (this.inGenerator && name === \"yield\")\n this.raiseRecoverable(start, \"Can not use 'yield' as identifier inside a generator\")\n if (this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Can not use 'await' as identifier inside an async function\")\n if (this.keywords.test(name))\n this.raise(start, `Unexpected keyword '${name}'`)\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) return\n const re = this.strict ? this.reservedWordsStrict : this.reservedWords\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n this.raiseRecoverable(start, \"Can not use keyword 'await' outside an async function\")\n this.raiseRecoverable(start, `The keyword '${name}' is reserved`)\n }\n}\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp.parseIdent = function(liberal, isBinding) {\n let node = this.startNode()\n if (liberal && this.options.allowReserved === \"never\") liberal = false\n if (this.type === tt.name) {\n node.name = this.value\n } else if (this.type.keyword) {\n node.name = this.type.keyword\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop()\n }\n } else {\n this.unexpected()\n }\n this.next()\n this.finishNode(node, \"Identifier\")\n if (!liberal) this.checkUnreserved(node)\n return node\n}\n\n// Parses yield expression inside generator.\n\npp.parseYield = function(noIn) {\n if (!this.yieldPos) this.yieldPos = this.start\n\n let node = this.startNode()\n this.next()\n if (this.type === tt.semi || this.canInsertSemicolon() || (this.type !== tt.star && !this.type.startsExpr)) {\n node.delegate = false\n node.argument = null\n } else {\n node.delegate = this.eat(tt.star)\n node.argument = this.parseMaybeAssign(noIn)\n }\n return this.finishNode(node, \"YieldExpression\")\n}\n\npp.parseAwait = function() {\n if (!this.awaitPos) this.awaitPos = this.start\n\n let node = this.startNode()\n this.next()\n node.argument = this.parseMaybeUnary(null, true)\n return this.finishNode(node, \"AwaitExpression\")\n}\n","import {Parser} from \"./state\"\nimport {Position, getLineInfo} from \"./locutil\"\n\nconst pp = Parser.prototype\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp.raise = function(pos, message) {\n let loc = getLineInfo(this.input, pos)\n message += \" (\" + loc.line + \":\" + loc.column + \")\"\n let err = new SyntaxError(message)\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos\n throw err\n}\n\npp.raiseRecoverable = pp.raise\n\npp.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n}\n","import {Parser} from \"./state\"\nimport {SCOPE_VAR, SCOPE_FUNCTION, SCOPE_TOP, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, BIND_LEXICAL, BIND_SIMPLE_CATCH, BIND_FUNCTION} from \"./scopeflags\"\n\nconst pp = Parser.prototype\n\nclass Scope {\n constructor(flags) {\n this.flags = flags\n // A list of var-declared names in the current lexical scope\n this.var = []\n // A list of lexically-declared names in the current lexical scope\n this.lexical = []\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = []\n }\n}\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags))\n}\n\npp.exitScope = function() {\n this.scopeStack.pop()\n}\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP);\n}\n\npp.declareName = function(name, bindingType, pos) {\n let redeclared = false\n if (bindingType === BIND_LEXICAL) {\n const scope = this.currentScope()\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.lexical.push(name)\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n const scope = this.currentScope()\n scope.lexical.push(name)\n } else if (bindingType === BIND_FUNCTION) {\n const scope = this.currentScope()\n if (this.treatFunctionsAsVar)\n redeclared = scope.lexical.indexOf(name) > -1;\n else\n redeclared = scope.lexical.indexOf(name) > -1 || scope.var.indexOf(name) > -1\n scope.functions.push(name)\n } else {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n const scope = this.scopeStack[i]\n if (scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH) && scope.lexical[0] === name ||\n !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1) {\n redeclared = true\n break\n }\n scope.var.push(name)\n if (scope.flags & SCOPE_VAR) break\n }\n }\n if (redeclared) this.raiseRecoverable(pos, `Identifier '${name}' has already been declared`)\n}\n\npp.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n}\n\npp.currentVarScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR) return scope\n }\n}\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp.currentThisScope = function() {\n for (let i = this.scopeStack.length - 1;; i--) {\n let scope = this.scopeStack[i]\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) return scope\n }\n}\n","import {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\n\nexport class Node {\n constructor(parser, pos, loc) {\n this.type = \"\"\n this.start = pos\n this.end = 0\n if (parser.options.locations)\n this.loc = new SourceLocation(parser, loc)\n if (parser.options.directSourceFile)\n this.sourceFile = parser.options.directSourceFile\n if (parser.options.ranges)\n this.range = [pos, 0]\n }\n}\n\n// Start an AST node, attaching a start offset.\n\nconst pp = Parser.prototype\n\npp.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n}\n\npp.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n}\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type\n node.end = pos\n if (this.options.locations)\n node.loc.end = loc\n if (this.options.ranges)\n node.range[1] = pos\n return node\n}\n\npp.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n}\n\n// Finish node at given position\n\npp.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n}\n","// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport {Parser} from \"./state\"\nimport {types as tt} from \"./tokentype\"\nimport {lineBreak} from \"./whitespace\"\n\nexport class TokContext {\n constructor(token, isExpr, preserveSpace, override, generator) {\n this.token = token\n this.isExpr = !!isExpr\n this.preserveSpace = !!preserveSpace\n this.override = override\n this.generator = !!generator\n }\n}\n\nexport const types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, p => p.tryReadTemplateToken()),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n}\n\nconst pp = Parser.prototype\n\npp.initialContext = function() {\n return [types.b_stat]\n}\n\npp.braceIsBlock = function(prevType) {\n let parent = this.curContext()\n if (parent === types.f_expr || parent === types.f_stat)\n return true\n if (prevType === tt.colon && (parent === types.b_stat || parent === types.b_expr))\n return !parent.isExpr\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === tt._return || prevType === tt.name && this.exprAllowed)\n return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR || prevType === tt.arrow)\n return true\n if (prevType === tt.braceL)\n return parent === types.b_stat\n if (prevType === tt._var || prevType === tt._const || prevType === tt.name)\n return false\n return !this.exprAllowed\n}\n\npp.inGeneratorContext = function() {\n for (let i = this.context.length - 1; i >= 1; i--) {\n let context = this.context[i]\n if (context.token === \"function\")\n return context.generator\n }\n return false\n}\n\npp.updateContext = function(prevType) {\n let update, type = this.type\n if (type.keyword && prevType === tt.dot)\n this.exprAllowed = false\n else if (update = type.updateContext)\n update.call(this, prevType)\n else\n this.exprAllowed = type.beforeExpr\n}\n\n// Token-specific context update code\n\ntt.parenR.updateContext = tt.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true\n return\n }\n let out = this.context.pop()\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop()\n }\n this.exprAllowed = !out.isExpr\n}\n\ntt.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr)\n this.exprAllowed = true\n}\n\ntt.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl)\n this.exprAllowed = true\n}\n\ntt.parenL.updateContext = function(prevType) {\n let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while\n this.context.push(statementParens ? types.p_stat : types.p_expr)\n this.exprAllowed = true\n}\n\ntt.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n}\n\ntt._function.updateContext = tt._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else &&\n !(prevType === tt._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat))\n this.context.push(types.f_expr)\n else\n this.context.push(types.f_stat)\n this.exprAllowed = false\n}\n\ntt.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n this.context.pop()\n else\n this.context.push(types.q_tmpl)\n this.exprAllowed = false\n}\n\ntt.star.updateContext = function(prevType) {\n if (prevType === tt._function) {\n let index = this.context.length - 1\n if (this.context[index] === types.f_expr)\n this.context[index] = types.f_expr_gen\n else\n this.context[index] = types.f_gen\n }\n this.exprAllowed = true\n}\n\ntt.name.updateContext = function(prevType) {\n let allowed = false\n if (this.options.ecmaVersion >= 6 && prevType !== tt.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n allowed = true\n }\n this.exprAllowed = allowed\n}\n","const data = {\n \"$LONE\": [\n \"ASCII\",\n \"ASCII_Hex_Digit\",\n \"AHex\",\n \"Alphabetic\",\n \"Alpha\",\n \"Any\",\n \"Assigned\",\n \"Bidi_Control\",\n \"Bidi_C\",\n \"Bidi_Mirrored\",\n \"Bidi_M\",\n \"Case_Ignorable\",\n \"CI\",\n \"Cased\",\n \"Changes_When_Casefolded\",\n \"CWCF\",\n \"Changes_When_Casemapped\",\n \"CWCM\",\n \"Changes_When_Lowercased\",\n \"CWL\",\n \"Changes_When_NFKC_Casefolded\",\n \"CWKCF\",\n \"Changes_When_Titlecased\",\n \"CWT\",\n \"Changes_When_Uppercased\",\n \"CWU\",\n \"Dash\",\n \"Default_Ignorable_Code_Point\",\n \"DI\",\n \"Deprecated\",\n \"Dep\",\n \"Diacritic\",\n \"Dia\",\n \"Emoji\",\n \"Emoji_Component\",\n \"Emoji_Modifier\",\n \"Emoji_Modifier_Base\",\n \"Emoji_Presentation\",\n \"Extender\",\n \"Ext\",\n \"Grapheme_Base\",\n \"Gr_Base\",\n \"Grapheme_Extend\",\n \"Gr_Ext\",\n \"Hex_Digit\",\n \"Hex\",\n \"IDS_Binary_Operator\",\n \"IDSB\",\n \"IDS_Trinary_Operator\",\n \"IDST\",\n \"ID_Continue\",\n \"IDC\",\n \"ID_Start\",\n \"IDS\",\n \"Ideographic\",\n \"Ideo\",\n \"Join_Control\",\n \"Join_C\",\n \"Logical_Order_Exception\",\n \"LOE\",\n \"Lowercase\",\n \"Lower\",\n \"Math\",\n \"Noncharacter_Code_Point\",\n \"NChar\",\n \"Pattern_Syntax\",\n \"Pat_Syn\",\n \"Pattern_White_Space\",\n \"Pat_WS\",\n \"Quotation_Mark\",\n \"QMark\",\n \"Radical\",\n \"Regional_Indicator\",\n \"RI\",\n \"Sentence_Terminal\",\n \"STerm\",\n \"Soft_Dotted\",\n \"SD\",\n \"Terminal_Punctuation\",\n \"Term\",\n \"Unified_Ideograph\",\n \"UIdeo\",\n \"Uppercase\",\n \"Upper\",\n \"Variation_Selector\",\n \"VS\",\n \"White_Space\",\n \"space\",\n \"XID_Continue\",\n \"XIDC\",\n \"XID_Start\",\n \"XIDS\"\n ],\n \"General_Category\": [\n \"Cased_Letter\",\n \"LC\",\n \"Close_Punctuation\",\n \"Pe\",\n \"Connector_Punctuation\",\n \"Pc\",\n \"Control\",\n \"Cc\",\n \"cntrl\",\n \"Currency_Symbol\",\n \"Sc\",\n \"Dash_Punctuation\",\n \"Pd\",\n \"Decimal_Number\",\n \"Nd\",\n \"digit\",\n \"Enclosing_Mark\",\n \"Me\",\n \"Final_Punctuation\",\n \"Pf\",\n \"Format\",\n \"Cf\",\n \"Initial_Punctuation\",\n \"Pi\",\n \"Letter\",\n \"L\",\n \"Letter_Number\",\n \"Nl\",\n \"Line_Separator\",\n \"Zl\",\n \"Lowercase_Letter\",\n \"Ll\",\n \"Mark\",\n \"M\",\n \"Combining_Mark\",\n \"Math_Symbol\",\n \"Sm\",\n \"Modifier_Letter\",\n \"Lm\",\n \"Modifier_Symbol\",\n \"Sk\",\n \"Nonspacing_Mark\",\n \"Mn\",\n \"Number\",\n \"N\",\n \"Open_Punctuation\",\n \"Ps\",\n \"Other\",\n \"C\",\n \"Other_Letter\",\n \"Lo\",\n \"Other_Number\",\n \"No\",\n \"Other_Punctuation\",\n \"Po\",\n \"Other_Symbol\",\n \"So\",\n \"Paragraph_Separator\",\n \"Zp\",\n \"Private_Use\",\n \"Co\",\n \"Punctuation\",\n \"P\",\n \"punct\",\n \"Separator\",\n \"Z\",\n \"Space_Separator\",\n \"Zs\",\n \"Spacing_Mark\",\n \"Mc\",\n \"Surrogate\",\n \"Cs\",\n \"Symbol\",\n \"S\",\n \"Titlecase_Letter\",\n \"Lt\",\n \"Unassigned\",\n \"Cn\",\n \"Uppercase_Letter\",\n \"Lu\"\n ],\n \"Script\": [\n \"Adlam\",\n \"Adlm\",\n \"Ahom\",\n \"Anatolian_Hieroglyphs\",\n \"Hluw\",\n \"Arabic\",\n \"Arab\",\n \"Armenian\",\n \"Armn\",\n \"Avestan\",\n \"Avst\",\n \"Balinese\",\n \"Bali\",\n \"Bamum\",\n \"Bamu\",\n \"Bassa_Vah\",\n \"Bass\",\n \"Batak\",\n \"Batk\",\n \"Bengali\",\n \"Beng\",\n \"Bhaiksuki\",\n \"Bhks\",\n \"Bopomofo\",\n \"Bopo\",\n \"Brahmi\",\n \"Brah\",\n \"Braille\",\n \"Brai\",\n \"Buginese\",\n \"Bugi\",\n \"Buhid\",\n \"Buhd\",\n \"Canadian_Aboriginal\",\n \"Cans\",\n \"Carian\",\n \"Cari\",\n \"Caucasian_Albanian\",\n \"Aghb\",\n \"Chakma\",\n \"Cakm\",\n \"Cham\",\n \"Cherokee\",\n \"Cher\",\n \"Common\",\n \"Zyyy\",\n \"Coptic\",\n \"Copt\",\n \"Qaac\",\n \"Cuneiform\",\n \"Xsux\",\n \"Cypriot\",\n \"Cprt\",\n \"Cyrillic\",\n \"Cyrl\",\n \"Deseret\",\n \"Dsrt\",\n \"Devanagari\",\n \"Deva\",\n \"Duployan\",\n \"Dupl\",\n \"Egyptian_Hieroglyphs\",\n \"Egyp\",\n \"Elbasan\",\n \"Elba\",\n \"Ethiopic\",\n \"Ethi\",\n \"Georgian\",\n \"Geor\",\n \"Glagolitic\",\n \"Glag\",\n \"Gothic\",\n \"Goth\",\n \"Grantha\",\n \"Gran\",\n \"Greek\",\n \"Grek\",\n \"Gujarati\",\n \"Gujr\",\n \"Gurmukhi\",\n \"Guru\",\n \"Han\",\n \"Hani\",\n \"Hangul\",\n \"Hang\",\n \"Hanunoo\",\n \"Hano\",\n \"Hatran\",\n \"Hatr\",\n \"Hebrew\",\n \"Hebr\",\n \"Hiragana\",\n \"Hira\",\n \"Imperial_Aramaic\",\n \"Armi\",\n \"Inherited\",\n \"Zinh\",\n \"Qaai\",\n \"Inscriptional_Pahlavi\",\n \"Phli\",\n \"Inscriptional_Parthian\",\n \"Prti\",\n \"Javanese\",\n \"Java\",\n \"Kaithi\",\n \"Kthi\",\n \"Kannada\",\n \"Knda\",\n \"Katakana\",\n \"Kana\",\n \"Kayah_Li\",\n \"Kali\",\n \"Kharoshthi\",\n \"Khar\",\n \"Khmer\",\n \"Khmr\",\n \"Khojki\",\n \"Khoj\",\n \"Khudawadi\",\n \"Sind\",\n \"Lao\",\n \"Laoo\",\n \"Latin\",\n \"Latn\",\n \"Lepcha\",\n \"Lepc\",\n \"Limbu\",\n \"Limb\",\n \"Linear_A\",\n \"Lina\",\n \"Linear_B\",\n \"Linb\",\n \"Lisu\",\n \"Lycian\",\n \"Lyci\",\n \"Lydian\",\n \"Lydi\",\n \"Mahajani\",\n \"Mahj\",\n \"Malayalam\",\n \"Mlym\",\n \"Mandaic\",\n \"Mand\",\n \"Manichaean\",\n \"Mani\",\n \"Marchen\",\n \"Marc\",\n \"Masaram_Gondi\",\n \"Gonm\",\n \"Meetei_Mayek\",\n \"Mtei\",\n \"Mende_Kikakui\",\n \"Mend\",\n \"Meroitic_Cursive\",\n \"Merc\",\n \"Meroitic_Hieroglyphs\",\n \"Mero\",\n \"Miao\",\n \"Plrd\",\n \"Modi\",\n \"Mongolian\",\n \"Mong\",\n \"Mro\",\n \"Mroo\",\n \"Multani\",\n \"Mult\",\n \"Myanmar\",\n \"Mymr\",\n \"Nabataean\",\n \"Nbat\",\n \"New_Tai_Lue\",\n \"Talu\",\n \"Newa\",\n \"Nko\",\n \"Nkoo\",\n \"Nushu\",\n \"Nshu\",\n \"Ogham\",\n \"Ogam\",\n \"Ol_Chiki\",\n \"Olck\",\n \"Old_Hungarian\",\n \"Hung\",\n \"Old_Italic\",\n \"Ital\",\n \"Old_North_Arabian\",\n \"Narb\",\n \"Old_Permic\",\n \"Perm\",\n \"Old_Persian\",\n \"Xpeo\",\n \"Old_South_Arabian\",\n \"Sarb\",\n \"Old_Turkic\",\n \"Orkh\",\n \"Oriya\",\n \"Orya\",\n \"Osage\",\n \"Osge\",\n \"Osmanya\",\n \"Osma\",\n \"Pahawh_Hmong\",\n \"Hmng\",\n \"Palmyrene\",\n \"Palm\",\n \"Pau_Cin_Hau\",\n \"Pauc\",\n \"Phags_Pa\",\n \"Phag\",\n \"Phoenician\",\n \"Phnx\",\n \"Psalter_Pahlavi\",\n \"Phlp\",\n \"Rejang\",\n \"Rjng\",\n \"Runic\",\n \"Runr\",\n \"Samaritan\",\n \"Samr\",\n \"Saurashtra\",\n \"Saur\",\n \"Sharada\",\n \"Shrd\",\n \"Shavian\",\n \"Shaw\",\n \"Siddham\",\n \"Sidd\",\n \"SignWriting\",\n \"Sgnw\",\n \"Sinhala\",\n \"Sinh\",\n \"Sora_Sompeng\",\n \"Sora\",\n \"Soyombo\",\n \"Soyo\",\n \"Sundanese\",\n \"Sund\",\n \"Syloti_Nagri\",\n \"Sylo\",\n \"Syriac\",\n \"Syrc\",\n \"Tagalog\",\n \"Tglg\",\n \"Tagbanwa\",\n \"Tagb\",\n \"Tai_Le\",\n \"Tale\",\n \"Tai_Tham\",\n \"Lana\",\n \"Tai_Viet\",\n \"Tavt\",\n \"Takri\",\n \"Takr\",\n \"Tamil\",\n \"Taml\",\n \"Tangut\",\n \"Tang\",\n \"Telugu\",\n \"Telu\",\n \"Thaana\",\n \"Thaa\",\n \"Thai\",\n \"Tibetan\",\n \"Tibt\",\n \"Tifinagh\",\n \"Tfng\",\n \"Tirhuta\",\n \"Tirh\",\n \"Ugaritic\",\n \"Ugar\",\n \"Vai\",\n \"Vaii\",\n \"Warang_Citi\",\n \"Wara\",\n \"Yi\",\n \"Yiii\",\n \"Zanabazar_Square\",\n \"Zanb\"\n ]\n}\nArray.prototype.push.apply(data.$LONE, data.General_Category)\ndata.gc = data.General_Category\ndata.sc = data.Script_Extensions = data.scx = data.Script\n\nexport default data\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier.js\"\nimport {Parser} from \"./state.js\"\nimport UNICODE_PROPERTY_VALUES from \"./unicode-property-data.js\"\n\nconst pp = Parser.prototype\n\nexport class RegExpValidationState {\n constructor(parser) {\n this.parser = parser\n this.validFlags = `gim${parser.options.ecmaVersion >= 6 ? \"uy\" : \"\"}${parser.options.ecmaVersion >= 9 ? \"s\" : \"\"}`\n this.source = \"\"\n this.flags = \"\"\n this.start = 0\n this.switchU = false\n this.switchN = false\n this.pos = 0\n this.lastIntValue = 0\n this.lastStringValue = \"\"\n this.lastAssertionIsQuantifiable = false\n this.numCapturingParens = 0\n this.maxBackReference = 0\n this.groupNames = []\n this.backReferenceNames = []\n }\n\n reset(start, pattern, flags) {\n const unicode = flags.indexOf(\"u\") !== -1\n this.start = start | 0\n this.source = pattern + \"\"\n this.flags = flags\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9\n }\n\n raise(message) {\n this.parser.raiseRecoverable(this.start, `Invalid regular expression: /${this.source}/: ${message}`)\n }\n\n // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n at(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return -1\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00\n }\n\n nextIndex(i) {\n const s = this.source\n const l = s.length\n if (i >= l) {\n return l\n }\n const c = s.charCodeAt(i)\n if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return i + 1\n }\n return i + 2\n }\n\n current() {\n return this.at(this.pos)\n }\n\n lookahead() {\n return this.at(this.nextIndex(this.pos))\n }\n\n advance() {\n this.pos = this.nextIndex(this.pos)\n }\n\n eat(ch) {\n if (this.current() === ch) {\n this.advance()\n return true\n }\n return false\n }\n}\n\nfunction codePointToString(ch) {\n if (ch <= 0xFFFF) return String.fromCharCode(ch)\n ch -= 0x10000\n return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)\n}\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpFlags = function(state) {\n const validFlags = state.validFlags\n const flags = state.flags\n\n for (let i = 0; i < flags.length; i++) {\n const flag = flags.charAt(i)\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\")\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\")\n }\n }\n}\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp.validateRegExpPattern = function(state) {\n this.regexp_pattern(state)\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true\n this.regexp_pattern(state)\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp.regexp_pattern = function(state) {\n state.pos = 0\n state.lastIntValue = 0\n state.lastStringValue = \"\"\n state.lastAssertionIsQuantifiable = false\n state.numCapturingParens = 0\n state.maxBackReference = 0\n state.groupNames.length = 0\n state.backReferenceNames.length = 0\n\n this.regexp_disjunction(state)\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\")\n }\n if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\")\n }\n for (const name of state.backReferenceNames) {\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\")\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp.regexp_disjunction = function(state) {\n this.regexp_alternative(state)\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state)\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\")\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n ;\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\")\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state)\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp.regexp_eatAssertion = function(state) {\n const start = state.pos\n state.lastAssertionIsQuantifiable = false\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n let lookbehind = false\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */)\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state)\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\")\n }\n state.lastAssertionIsQuantifiable = !lookbehind\n return true\n }\n }\n\n state.pos = start\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp.regexp_eatQuantifier = function(state, noError = false) {\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n}\npp.regexp_eatBracedQuantifier = function(state, noError) {\n const start = state.pos\n if (state.eat(0x7B /* { */)) {\n let min = 0, max = -1\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\")\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n}\npp.regexp_eatReverseSolidusAtomEscape = function(state) {\n const start = state.pos\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatUncapturingGroup = function(state) {\n const start = state.pos\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\")\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state)\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\")\n }\n this.regexp_disjunction(state)\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1\n return true\n }\n state.raise(\"Unterminated group\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp.regexp_eatSyntaxCharacter = function(state) {\n const ch = state.current()\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n return false\n}\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp.regexp_eatPatternCharacters = function(state) {\n const start = state.pos\n let ch = 0\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance()\n }\n return state.pos !== start\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp.regexp_eatExtendedPatternCharacter = function(state) {\n const ch = state.current()\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance()\n return true\n }\n return false\n}\n\n// GroupSpecifier[U] ::\n// [empty]\n// `?` GroupName[?U]\npp.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\")\n }\n state.groupNames.push(state.lastStringValue)\n return\n }\n state.raise(\"Invalid group\")\n }\n}\n\n// GroupName[U] ::\n// `<` RegExpIdentifierName[?U] `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\"\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\")\n }\n return false\n}\n\n// RegExpIdentifierName[U] ::\n// RegExpIdentifierStart[?U]\n// RegExpIdentifierName[?U] RegExpIdentifierPart[?U]\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\"\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue)\n }\n return true\n }\n return false\n}\n\n// RegExpIdentifierStart[U] ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\npp.regexp_eatRegExpIdentifierStart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart[U] ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[?U]\n// \n// \npp.regexp_eatRegExpIdentifierPart = function(state) {\n const start = state.pos\n let ch = state.current()\n state.advance()\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) {\n ch = state.lastIntValue\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch\n return true\n }\n\n state.pos = start\n return false\n}\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\")\n }\n state.raise(\"Invalid escape\")\n }\n return false\n}\npp.regexp_eatBackReference = function(state) {\n const start = state.pos\n if (this.regexp_eatDecimalEscape(state)) {\n const n = state.lastIntValue\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue)\n return true\n }\n state.raise(\"Invalid named reference\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n}\npp.regexp_eatCControlLetter = function(state) {\n const start = state.pos\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n return false\n}\npp.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp.regexp_eatControlEscape = function(state) {\n const ch = state.current()\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09 /* \\t */\n state.advance()\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A /* \\n */\n state.advance()\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B /* \\v */\n state.advance()\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C /* \\f */\n state.advance()\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D /* \\r */\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp.regexp_eatControlLetter = function(state) {\n const ch = state.current()\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp.regexp_eatRegExpUnicodeEscapeSequence = function(state) {\n const start = state.pos\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n const lead = state.lastIntValue\n if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n const leadSurrogateEnd = state.pos\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n const trail = state.lastIntValue\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000\n return true\n }\n }\n state.pos = leadSurrogateEnd\n state.lastIntValue = lead\n }\n return true\n }\n if (\n state.switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid unicode escape\")\n }\n state.pos = start\n }\n\n return false\n}\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F /* / */\n return true\n }\n return false\n }\n\n const ch = state.current()\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0\n let ch = state.current()\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp.regexp_eatCharacterClassEscape = function(state) {\n const ch = state.current()\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1\n state.advance()\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1\n state.advance()\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\")\n }\n\n return false\n}\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp.regexp_eatUnicodePropertyValueExpression = function(state) {\n const start = state.pos\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n const name = state.lastStringValue\n if (this.regexp_eatUnicodePropertyValue(state)) {\n const value = state.lastStringValue\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value)\n return true\n }\n }\n state.pos = start\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n const nameOrValue = state.lastStringValue\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)\n return true\n }\n return false\n}\npp.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!UNICODE_PROPERTY_VALUES.hasOwnProperty(name) || UNICODE_PROPERTY_VALUES[name].indexOf(value) === -1) {\n state.raise(\"Invalid property name\")\n }\n}\npp.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (UNICODE_PROPERTY_VALUES.$LONE.indexOf(nameOrValue) === -1) {\n state.raise(\"Invalid property name\")\n }\n}\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp.regexp_eatUnicodePropertyName = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatUnicodePropertyValue = function(state) {\n let ch = 0\n state.lastStringValue = \"\"\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch)\n state.advance()\n }\n return state.lastStringValue !== \"\"\n}\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */)\n this.regexp_classRanges(state)\n if (state.eat(0x5D /* [ */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\")\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n const left = state.lastIntValue\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n const right = state.lastIntValue\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\")\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\")\n }\n }\n }\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp.regexp_eatClassAtom = function(state) {\n const start = state.pos\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n const ch = state.current()\n if (ch === 0x63 /* c */ || isOctalDigit(ch)) {\n state.raise(\"Invalid class escape\")\n }\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n\n const ch = state.current()\n if (ch !== 0x5D /* [ */) {\n state.lastIntValue = ch\n state.advance()\n return true\n }\n\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp.regexp_eatClassEscape = function(state) {\n const start = state.pos\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08 /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp.regexp_eatClassControlLetter = function(state) {\n const ch = state.current()\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20\n state.advance()\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatHexEscapeSequence = function(state) {\n const start = state.pos\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\")\n }\n state.pos = start\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp.regexp_eatDecimalDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp.regexp_eatHexDigits = function(state) {\n const start = state.pos\n let ch = 0\n state.lastIntValue = 0\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return state.pos !== start\n}\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n const n1 = state.lastIntValue\n if (this.regexp_eatOctalDigit(state)) {\n const n2 = state.lastIntValue\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue\n } else {\n state.lastIntValue = n1 * 8 + n2\n }\n } else {\n state.lastIntValue = n1\n }\n return true\n }\n return false\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp.regexp_eatOctalDigit = function(state) {\n const ch = state.current()\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30 /* 0 */\n state.advance()\n return true\n }\n state.lastIntValue = 0\n return false\n}\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp.regexp_eatFixedHexDigits = function(state, length) {\n const start = state.pos\n state.lastIntValue = 0\n for (let i = 0; i < length; ++i) {\n const ch = state.current()\n if (!isHexDigit(ch)) {\n state.pos = start\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch)\n state.advance()\n }\n return true\n}\n","import {isIdentifierStart, isIdentifierChar} from \"./identifier\"\nimport {types as tt, keywords as keywordTypes} from \"./tokentype\"\nimport {Parser} from \"./state\"\nimport {SourceLocation} from \"./locutil\"\nimport {RegExpValidationState} from \"./regexp\"\nimport {lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace} from \"./whitespace\"\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(p) {\n this.type = p.type\n this.value = p.value\n this.start = p.start\n this.end = p.end\n if (p.options.locations)\n this.loc = new SourceLocation(p, p.startLoc, p.endLoc)\n if (p.options.ranges)\n this.range = [p.start, p.end]\n }\n}\n\n// ## Tokenizer\n\nconst pp = Parser.prototype\n\n// Move to the next token\n\npp.next = function() {\n if (this.options.onToken)\n this.options.onToken(new Token(this))\n\n this.lastTokEnd = this.end\n this.lastTokStart = this.start\n this.lastTokEndLoc = this.endLoc\n this.lastTokStartLoc = this.startLoc\n this.nextToken()\n}\n\npp.getToken = function() {\n this.next()\n return new Token(this)\n}\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n pp[Symbol.iterator] = function() {\n return {\n next: () => {\n let token = this.getToken()\n return {\n done: token.type === tt.eof,\n value: token\n }\n }\n }\n }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\npp.curContext = function() {\n return this.context[this.context.length - 1]\n}\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n let curContext = this.curContext()\n if (!curContext || !curContext.preserveSpace) this.skipSpace()\n\n this.start = this.pos\n if (this.options.locations) this.startLoc = this.curPosition()\n if (this.pos >= this.input.length) return this.finishToken(tt.eof)\n\n if (curContext.override) return curContext.override(this)\n else this.readToken(this.fullCharCodeAtPos())\n}\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n return this.readWord()\n\n return this.getTokenFromCode(code)\n}\n\npp.fullCharCodeAtPos = function() {\n let code = this.input.charCodeAt(this.pos)\n if (code <= 0xd7ff || code >= 0xe000) return code\n let next = this.input.charCodeAt(this.pos + 1)\n return (code << 10) + next - 0x35fdc00\n}\n\npp.skipBlockComment = function() {\n let startLoc = this.options.onComment && this.curPosition()\n let start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2)\n if (end === -1) this.raise(this.pos - 2, \"Unterminated comment\")\n this.pos = end + 2\n if (this.options.locations) {\n lineBreakG.lastIndex = start\n let match\n while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {\n ++this.curLine\n this.lineStart = match.index + match[0].length\n }\n }\n if (this.options.onComment)\n this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition())\n}\n\npp.skipLineComment = function(startSkip) {\n let start = this.pos\n let startLoc = this.options.onComment && this.curPosition()\n let ch = this.input.charCodeAt(this.pos += startSkip)\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos)\n }\n if (this.options.onComment)\n this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition())\n}\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n let ch = this.input.charCodeAt(this.pos)\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos\n }\n case 10: case 8232: case 8233:\n ++this.pos\n if (this.options.locations) {\n ++this.curLine\n this.lineStart = this.pos\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment()\n break\n case 47:\n this.skipLineComment(2)\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos\n } else {\n break loop\n }\n }\n }\n}\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos\n if (this.options.locations) this.endLoc = this.curPosition()\n let prevType = this.type\n this.type = type\n this.value = val\n\n this.updateContext(prevType)\n}\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n let next = this.input.charCodeAt(this.pos + 1)\n if (next >= 48 && next <= 57) return this.readNumber(true)\n let next2 = this.input.charCodeAt(this.pos + 2)\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3\n return this.finishToken(tt.ellipsis)\n } else {\n ++this.pos\n return this.finishToken(tt.dot)\n }\n}\n\npp.readToken_slash = function() { // '/'\n let next = this.input.charCodeAt(this.pos + 1)\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.slash, 1)\n}\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n let tokentype = code === 42 ? tt.star : tt.modulo\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size\n tokentype = tt.starstar\n next = this.input.charCodeAt(this.pos + 2)\n }\n\n if (next === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tokentype, size)\n}\n\npp.readToken_pipe_amp = function(code) { // '|&'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1)\n}\n\npp.readToken_caret = function() { // '^'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.bitwiseXOR, 1)\n}\n\npp.readToken_plus_min = function(code) { // '+-'\n let next = this.input.charCodeAt(this.pos + 1)\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` \ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/write/index.js b/tools/node_modules/eslint/node_modules/write/index.js index f952638d0d4520..b2b4b4380a359c 100644 --- a/tools/node_modules/eslint/node_modules/write/index.js +++ b/tools/node_modules/eslint/node_modules/write/index.js @@ -1,93 +1,160 @@ /*! * write * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. */ 'use strict'; var fs = require('fs'); var path = require('path'); -var mkdir = require('mkdirp'); +var mkdirp = require('mkdirp'); /** - * Asynchronously write a file to disk. Creates any intermediate - * directories if they don't already exist. + * Asynchronously writes data to a file, replacing the file if it already + * exists and creating any intermediate directories if they don't already + * exist. Data can be a string or a buffer. Returns a promise if a callback + * function is not passed. * * ```js * var writeFile = require('write'); - * writeFile('foo.txt', 'This is content to write.', function(err) { + * writeFile('foo.txt', 'This is content...', function(err) { * if (err) console.log(err); * }); + * + * // promise + * writeFile('foo.txt', 'This is content...') + * .then(function() { + * // do stuff + * }); * ``` + * @name writeFile + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `data` String to write to disk. + * @param {object} `options` Options to pass to [fs.writeFile][fs]{#fs_fs_writefile_file_data_options_callback} and/or [mkdirp][] + * @param {Function} `callback` (optional) If no callback is provided, a promise is returned. + * @api public + */ + +function writeFile(filepath, data, options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + + if (typeof cb !== 'function') { + return writeFile.promise.apply(null, arguments); + } + + if (typeof filepath !== 'string') { + cb(new TypeError('expected filepath to be a string')); + return; + } + + mkdirp(path.dirname(filepath), options, function(err) { + if (err) { + cb(err); + return; + } + fs.writeFile(filepath, data, options, cb); + }); +}; + +/** + * The promise version of [writeFile](#writefile). Returns a promise. * - * @name writeFile - * @param {String} `dest` Destination file path - * @param {String} `str` String to write to disk. - * @param {Function} `callback` + * ```js + * var writeFile = require('write'); + * writeFile.promise('foo.txt', 'This is content...') + * .then(function() { + * // do stuff + * }); + * ``` + * @name .promise + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `val` String or buffer to write to disk. + * @param {object} `options` Options to pass to [fs.writeFile][fs]{#fs_fs_writefile_file_data_options_callback} and/or [mkdirp][] + * @return {Promise} * @api public */ -module.exports = function writeFile(dest, str, cb) { - var dir = path.dirname(dest); - fs.exists(dir, function (exists) { - if (exists) { - fs.writeFile(dest, str, cb); - } else { - mkdir(dir, function (err) { +writeFile.promise = function(filepath, val, options) { + if (typeof filepath !== 'string') { + return Promise.reject(new TypeError('expected filepath to be a string')); + } + + return new Promise(function(resolve, reject) { + mkdirp(path.dirname(filepath), options, function(err) { + if (err) { + reject(err); + return; + } + + fs.writeFile(filepath, val, options, function(err) { if (err) { - return cb(err); - } else { - fs.writeFile(dest, str, cb); + reject(err); + return; } + resolve(val); }); - } + }); }); }; /** - * Synchronously write files to disk. Creates any intermediate - * directories if they don't already exist. + * The synchronous version of [writeFile](#writefile). Returns undefined. * * ```js * var writeFile = require('write'); - * writeFile.sync('foo.txt', 'This is content to write.'); + * writeFile.sync('foo.txt', 'This is content...'); * ``` - * - * @name writeFile.sync - * @param {String} `dest` Destination file path - * @param {String} `str` String to write to disk. + * @name .sync + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {string|Buffer|Uint8Array} `data` String or buffer to write to disk. + * @param {object} `options` Options to pass to [fs.writeFileSync][fs]{#fs_fs_writefilesync_file_data_options} and/or [mkdirp][] + * @return {undefined} * @api public */ -module.exports.sync = function writeFileSync(dest, str) { - var dir = path.dirname(dest); - if (!fs.existsSync(dir)) { - mkdir.sync(dir); +writeFile.sync = function(filepath, data, options) { + if (typeof filepath !== 'string') { + throw new TypeError('expected filepath to be a string'); } - fs.writeFileSync(dest, str); + mkdirp.sync(path.dirname(filepath), options); + fs.writeFileSync(filepath, data, options); }; /** - * Uses `fs.createWriteStream`, but also creates any intermediate - * directories if they don't already exist. + * Uses `fs.createWriteStream` to write data to a file, replacing the + * file if it already exists and creating any intermediate directories + * if they don't already exist. Data can be a string or a buffer. Returns + * a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) + * object. * * ```js - * var write = require('write'); - * write.stream('foo.txt'); + * var fs = require('fs'); + * var writeFile = require('write'); + * fs.createReadStream('README.md') + * .pipe(writeFile.stream('a/b/c/other-file.md')) + * .on('close', function() { + * // do stuff + * }); * ``` - * - * @name writeFile.stream - * @param {String} `dest` Destination file path - * @return {Stream} Returns a write stream. + * @name .stream + * @param {string|Buffer|integer} `filepath` filepath or file descriptor. + * @param {object} `options` Options to pass to [mkdirp][] and [fs.createWriteStream][fs]{#fs_fs_createwritestream_path_options} + * @return {Stream} Returns a new [WriteStream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) object. (See [Writable Stream](https://nodejs.org/api/stream.html#stream_class_stream_writable)). * @api public */ -module.exports.stream = function writeFileStream(dest) { - var dir = path.dirname(dest); - if (!fs.existsSync(dir)) { - mkdir.sync(dir); - } - return fs.createWriteStream(dest); +writeFile.stream = function(filepath, options) { + mkdirp.sync(path.dirname(filepath), options); + return fs.createWriteStream(filepath, options); }; + +/** + * Expose `writeFile` + */ + +module.exports = writeFile; diff --git a/tools/node_modules/eslint/node_modules/write/package.json b/tools/node_modules/eslint/node_modules/write/package.json index dd3dc91a5b3796..4805b30afd5c42 100644 --- a/tools/node_modules/eslint/node_modules/write/package.json +++ b/tools/node_modules/eslint/node_modules/write/package.json @@ -7,19 +7,29 @@ "url": "https://github.com/jonschlinkert/write/issues" }, "bundleDependencies": false, + "contributors": [ + { + "name": "Charlike Mike Reagent", + "url": "https://i.am.charlike.online" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], "dependencies": { "mkdirp": "^0.5.1" }, "deprecated": false, - "description": "Write files to disk, creating intermediate directories if they don't exist.", + "description": "Write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Thin wrapper around node's native fs methods.", "devDependencies": { - "async": "^1.4.0", - "delete": "^0.2.1", - "mocha": "^2.2.5", - "should": "^7.0.2" + "async-each": "^1.0.1", + "delete": "^1.1.0", + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "files": [ "index.js" @@ -47,5 +57,32 @@ "scripts": { "test": "mocha" }, - "version": "0.2.1" + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "delete", + "read-data", + "read-yaml", + "write-data", + "write-json", + "write-yaml" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.3" } \ No newline at end of file diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 4ef338ee35b850..3dfde8476c3c2c 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -12,30 +12,30 @@ "bundleDependencies": false, "dependencies": { "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", + "ajv": "^6.9.1", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-plugin-markdown": "^1.0.0-rc.1", + "doctrine": "^3.0.0", + "eslint-plugin-markdown": "^1.0.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", + "espree": "^5.0.1", "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", + "inquirer": "^6.2.2", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", @@ -46,21 +46,22 @@ "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^5.0.2", + "table": "^5.2.3", "text-table": "^0.2.0" }, "deprecated": false, "description": "An AST-based pattern checker for JavaScript.", "devDependencies": { - "babel-core": "^6.26.3", - "babel-polyfill": "^6.26.0", - "babel-preset-es2015": "^6.24.1", - "babelify": "^8.0.0", + "@babel/core": "^7.2.2", + "@babel/polyfill": "^7.2.5", + "@babel/preset-env": "^7.3.1", + "babelify": "^10.0.0", "beefy": "^2.1.8", "brfs": "^2.0.0", "browserify": "^16.2.2", "chai": "^4.0.1", "cheerio": "^0.22.0", + "common-tags": "^1.8.0", "coveralls": "^3.0.1", "dateformat": "^3.0.3", "ejs": "^2.6.1", @@ -69,26 +70,26 @@ "eslint-plugin-rulesdir": "^0.1.0", "eslint-release": "^1.2.0", "eslint-rule-composer": "^0.3.0", - "eslump": "^1.6.2", + "eslump": "^2.0.0", "esprima": "^4.0.1", "istanbul": "^0.4.5", "jsdoc": "^3.5.5", - "karma": "^3.0.0", - "karma-babel-preprocessor": "^7.0.0", + "karma": "^3.1.4", + "karma-babel-preprocessor": "^8.0.0", "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.3.0", "karma-mocha-reporter": "^2.2.3", "leche": "^2.2.3", "load-perf": "^0.2.0", - "markdownlint": "^0.11.0", + "markdownlint": "^0.12.0", "mocha": "^5.0.5", - "mock-fs": "^4.6.0", + "mock-fs": "^4.8.0", "npm-license": "^0.3.3", "proxyquire": "^2.0.1", - "puppeteer": "^1.9.0", + "puppeteer": "^1.12.2", "shelljs": "^0.8.2", "sinon": "^3.3.0", - "temp": "^0.8.3", + "temp": "^0.9.0", "through": "^2.3.8" }, "engines": { @@ -133,5 +134,5 @@ "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test" }, - "version": "5.13.0" + "version": "5.14.1" } \ No newline at end of file diff --git a/tools/test.py b/tools/test.py index e6fc7be73f11b1..bf99c499024b00 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1393,6 +1393,8 @@ def BuildOptions(): default="") result.add_option('--temp-dir', help='Optional path to change directory used for tests', default=False) + result.add_option('--test-root', + help='Optional path to change test directory', dest='test_root', default=None) result.add_option('--repeat', help='Number of times to repeat given tests', default=1, type="int") @@ -1576,8 +1578,10 @@ def Main(): workspace = abspath(join(dirname(sys.argv[0]), '..')) test_root = join(workspace, 'test') + if options.test_root is not None: + test_root = options.test_root suites = GetSuites(test_root) - repositories = [TestRepository(join(workspace, 'test', name)) for name in suites] + repositories = [TestRepository(join(test_root, name)) for name in suites] repositories += [TestRepository(a) for a in options.suite] root = LiteralTestSuite(repositories, test_root) diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh index 9a2f5f4401e892..ad9bcc8d65ce2c 100755 --- a/tools/update-eslint.sh +++ b/tools/update-eslint.sh @@ -16,7 +16,7 @@ npm init --yes npm install --global-style --no-bin-links --production --no-package-lock eslint@latest cd node_modules/eslint -npm install --no-bin-links --production --no-package-lock eslint-plugin-markdown@next +npm install --no-bin-links --production --no-package-lock eslint-plugin-markdown@latest cd ../.. # Use dmn to remove some unneeded files.